diff --git a/README.md b/README.md index 52ba6df9cb448c8448f3c4fd5aa2ec4aa04cbacb..c805259ac4f04256bbbcde728ed0ad184d107277 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ real dataset and a question, and asks it to explore the data, compute the answer Every answer is checked deterministically. -Packaged in [Harbor](https://github.com/harbor-framework/harbor) format, so each task is a ready-made -agentic environment: a standard Python image, its own data, and its own verifier. +Packaged in [Harbor](https://github.com/huggingface/OpenEnv) format, so each task is a ready-made +agentic environment: its own container, its own data, its own verifier. ## What's inside @@ -55,7 +55,7 @@ agentic environment: a standard Python image, its own data, and its own verifier tasks// task.toml # metadata, the question, the gold answer, grading tolerances instruction.md # the prompt the agent sees - environment/ # bootstrap.sh, pinned requirements.txt, and pull_bucket.py + environment/ # Dockerfile (shared base image) + the data-pull hook tests/ # grader.py (deterministic) + test.sh registry.json # the suite manifest manifest.parquet # one row per task, for filtering without walking the tree @@ -70,52 +70,6 @@ pip install "openenv[harbor]" # tested with openenv 0.6.0, needs Python 3.12+ The `[harbor]` extra is what brings in the sandboxes. A plain `pip install openenv` gives you the CLI but nothing to run a task in. `--sandbox e2b` also needs `E2B_API_KEY` set. -## Runtime setup without a custom image - -Each `task.toml` declares the same digest-pinned Docker Official Image, -`python:3.12-slim-trixie`, and `workdir = "/workdir"`. There is no task-specific -image to build or publish. Use Harbor **0.25.0 or newer** with a backend that supports -prebuilt images, uploading `environment/`, and pre-agent healthchecks. - -Harbor uploads `environment/` into `/workdir`, then the task's healthcheck runs -`bash /workdir/bootstrap.sh` **before agent setup**. The script installs curl/git -and the pinned Python dependencies, creates the input directory, and downloads -that task's bucket prefix. Setup needs package/data network access and permission -to install system packages. The Python requirements were captured from -`savatar101/env-data-agent-train@sha256:7b3f7e22780b431ce0d43717dcef6875cde84baeee824cc87e968374d62d3470` -to preserve the existing package versions. - -The HF Sandbox backend can now use the original dataset directly: - -```bash -openenv harbor rollout \ - --dataset FineEnvs/SmolDataEnvs-harbor-train \ - --llm-url http://127.0.0.1:8000/v1 --model \ - --harness opencode --sandbox hf-sandbox --task-index 0 -``` - -Set `HF_TOKEN` on the server for HF Sandbox and bucket access. A model running in -a remote sandbox also needs a reachable capture proxy, as in the usual Harbor -deployment. This changes task provisioning; it does not change model serving. - -Keep `environment/` free of `Dockerfile` and `docker-compose.yaml`: Harbor skips -automatic setup-file upload when either exists. `TAR_OPTIONS=--no-same-owner` in -the task environment prevents GNU tar from restoring archive ownership during -HF Sandbox uploads. Bash and tar are already present in the standard base. - -Dependencies are installed once per sandbox, so cold startup is slower than a -prebuilt environment. Setup has a 600-second timeout and fails before the agent -starts if installation or data download fails. Repeated healthchecks reuse the -dependency installation but finish the complete data pull, including after an -interrupted download. If using another base image, retain Bash/tar, installation -permissions, and the task dependencies; changing only `docker_image` is not enough. - -Offline regression checks: - -```bash -python3 -m unittest discover -s tests -v -``` - ## Serve it ```bash diff --git a/tasks/0000_324_324276_qa_3/environment/bootstrap.sh b/tasks/0000_324_324276_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_324_324276_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_324_324276_qa_3/environment/pull_bucket.py b/tasks/0000_324_324276_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_324_324276_qa_3/environment/pull_bucket.py +++ b/tasks/0000_324_324276_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_324_324276_qa_3/task.toml b/tasks/0000_324_324276_qa_3/task.toml index 13f2f23d6df97c88cfe5f37e511597abc61b2e1f..e9d91b88056327f7d0981a293e6668c20d1f7cda 100644 --- a/tasks/0000_324_324276_qa_3/task.toml +++ b/tasks/0000_324_324276_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_369_369503_qa_1/environment/bootstrap.sh b/tasks/0000_369_369503_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_369_369503_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_369_369503_qa_1/environment/pull_bucket.py b/tasks/0000_369_369503_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_369_369503_qa_1/environment/pull_bucket.py +++ b/tasks/0000_369_369503_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_369_369503_qa_1/task.toml b/tasks/0000_369_369503_qa_1/task.toml index 66e5fb658e182fa69f5ceb249693961698338f22..c7bb59bdc10715670664405f11b67ee745fecf40 100644 --- a/tasks/0000_369_369503_qa_1/task.toml +++ b/tasks/0000_369_369503_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_455_455459_qa_4/environment/bootstrap.sh b/tasks/0000_455_455459_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_455_455459_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_455_455459_qa_4/environment/pull_bucket.py b/tasks/0000_455_455459_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_455_455459_qa_4/environment/pull_bucket.py +++ b/tasks/0000_455_455459_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_455_455459_qa_4/task.toml b/tasks/0000_455_455459_qa_4/task.toml index 8d91a2c96e5facd840a644c1e546c8a770e6953a..673a1f5262bdf82bd5e0b62697729fad4f66cba9 100644 --- a/tasks/0000_455_455459_qa_4/task.toml +++ b/tasks/0000_455_455459_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_465_465850_qa_5/environment/bootstrap.sh b/tasks/0000_465_465850_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_465_465850_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_465_465850_qa_5/environment/pull_bucket.py b/tasks/0000_465_465850_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_465_465850_qa_5/environment/pull_bucket.py +++ b/tasks/0000_465_465850_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_465_465850_qa_5/task.toml b/tasks/0000_465_465850_qa_5/task.toml index dd8c4c5d73447f11562ffe2311cf8c9864ad6184..a97d4005b1fa5f3fb7d85f46e2984416256574c3 100644 --- a/tasks/0000_465_465850_qa_5/task.toml +++ b/tasks/0000_465_465850_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_526_526258_qa_2/environment/bootstrap.sh b/tasks/0000_526_526258_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_526_526258_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_526_526258_qa_2/environment/pull_bucket.py b/tasks/0000_526_526258_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_526_526258_qa_2/environment/pull_bucket.py +++ b/tasks/0000_526_526258_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_526_526258_qa_2/task.toml b/tasks/0000_526_526258_qa_2/task.toml index c9b2aedc9864de6e8b28c4544911c2e864ca046a..793bdbce69cd8f8ceecc7510b529472a4e71f357 100644 --- a/tasks/0000_526_526258_qa_2/task.toml +++ b/tasks/0000_526_526258_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_539_539873_qa_3/environment/bootstrap.sh b/tasks/0000_539_539873_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_539_539873_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_539_539873_qa_3/environment/pull_bucket.py b/tasks/0000_539_539873_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_539_539873_qa_3/environment/pull_bucket.py +++ b/tasks/0000_539_539873_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_539_539873_qa_3/task.toml b/tasks/0000_539_539873_qa_3/task.toml index 8aec359f004335b8754ed32328f5ea8800aa452f..e18fc598ae7fc1075901ddcd3841925e15a40ddf 100644 --- a/tasks/0000_539_539873_qa_3/task.toml +++ b/tasks/0000_539_539873_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_582_582934_qa_4/environment/bootstrap.sh b/tasks/0000_582_582934_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_582_582934_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_582_582934_qa_4/environment/pull_bucket.py b/tasks/0000_582_582934_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_582_582934_qa_4/environment/pull_bucket.py +++ b/tasks/0000_582_582934_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_582_582934_qa_4/task.toml b/tasks/0000_582_582934_qa_4/task.toml index d68765d2cdf56ef18d25db3b3ca65849d8d0d6d9..6f8a4164a47b94a1c9ea1794c75c41b362ec78fd 100644 --- a/tasks/0000_582_582934_qa_4/task.toml +++ b/tasks/0000_582_582934_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_587_587336_qa_5/environment/bootstrap.sh b/tasks/0000_587_587336_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_587_587336_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_587_587336_qa_5/environment/pull_bucket.py b/tasks/0000_587_587336_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_587_587336_qa_5/environment/pull_bucket.py +++ b/tasks/0000_587_587336_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_587_587336_qa_5/task.toml b/tasks/0000_587_587336_qa_5/task.toml index 73534c541ada673b9d4cf85e4c200509f11409f9..d912eab535c09bdd79a75bbc1e2cc55d9a59e77e 100644 --- a/tasks/0000_587_587336_qa_5/task.toml +++ b/tasks/0000_587_587336_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_641_641256_qa_1/environment/bootstrap.sh b/tasks/0000_641_641256_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_641_641256_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_641_641256_qa_1/environment/pull_bucket.py b/tasks/0000_641_641256_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_641_641256_qa_1/environment/pull_bucket.py +++ b/tasks/0000_641_641256_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_641_641256_qa_1/task.toml b/tasks/0000_641_641256_qa_1/task.toml index 4333a28d0ef42e60aa31daf1668840e19ba62051..cab60ce6fbb277f9d19610504a99e724a27a414b 100644 --- a/tasks/0000_641_641256_qa_1/task.toml +++ b/tasks/0000_641_641256_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_656_656399_qa_2/environment/bootstrap.sh b/tasks/0000_656_656399_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_656_656399_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_656_656399_qa_2/environment/pull_bucket.py b/tasks/0000_656_656399_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_656_656399_qa_2/environment/pull_bucket.py +++ b/tasks/0000_656_656399_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_656_656399_qa_2/task.toml b/tasks/0000_656_656399_qa_2/task.toml index d35dba98c718484db123d3a2c122db8e5f457f51..fbd3ec4d5ddd01e0ac0c124f0969d6fa6f994ab7 100644 --- a/tasks/0000_656_656399_qa_2/task.toml +++ b/tasks/0000_656_656399_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_767_767688_qa_4/environment/bootstrap.sh b/tasks/0000_767_767688_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_767_767688_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_767_767688_qa_4/environment/pull_bucket.py b/tasks/0000_767_767688_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_767_767688_qa_4/environment/pull_bucket.py +++ b/tasks/0000_767_767688_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_767_767688_qa_4/task.toml b/tasks/0000_767_767688_qa_4/task.toml index 46fe7b16d3d4b48280de7b3982b82c098fd6c526..feec31e25d25a59d1b2d90e175caa443e1a027d0 100644 --- a/tasks/0000_767_767688_qa_4/task.toml +++ b/tasks/0000_767_767688_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_780_780974_qa_4/environment/bootstrap.sh b/tasks/0000_780_780974_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_780_780974_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_780_780974_qa_4/environment/pull_bucket.py b/tasks/0000_780_780974_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_780_780974_qa_4/environment/pull_bucket.py +++ b/tasks/0000_780_780974_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_780_780974_qa_4/task.toml b/tasks/0000_780_780974_qa_4/task.toml index 08e023657f335c217d6d67948a96632f083bd89f..a2317458631860734981c8103bc243c7444ebaef 100644 --- a/tasks/0000_780_780974_qa_4/task.toml +++ b/tasks/0000_780_780974_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_804_804467_qa_1/environment/bootstrap.sh b/tasks/0000_804_804467_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_804_804467_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_804_804467_qa_1/environment/pull_bucket.py b/tasks/0000_804_804467_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_804_804467_qa_1/environment/pull_bucket.py +++ b/tasks/0000_804_804467_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_804_804467_qa_1/task.toml b/tasks/0000_804_804467_qa_1/task.toml index 3d05a8dacfcddd5a13ec2626399f97a795c03d4b..5ebc1f1038f6ec1e27f083efd3195c2bb621775f 100644 --- a/tasks/0000_804_804467_qa_1/task.toml +++ b/tasks/0000_804_804467_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_804_804467_qa_3/environment/bootstrap.sh b/tasks/0000_804_804467_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_804_804467_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_804_804467_qa_3/environment/pull_bucket.py b/tasks/0000_804_804467_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_804_804467_qa_3/environment/pull_bucket.py +++ b/tasks/0000_804_804467_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_804_804467_qa_3/task.toml b/tasks/0000_804_804467_qa_3/task.toml index bd9948b38a5289b4dced5518217ac199f6229060..d96b230aaf3864153f646c2496ac17134e01bd79 100644 --- a/tasks/0000_804_804467_qa_3/task.toml +++ b/tasks/0000_804_804467_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_806_806826_qa_3/environment/bootstrap.sh b/tasks/0000_806_806826_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_806_806826_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_806_806826_qa_3/environment/pull_bucket.py b/tasks/0000_806_806826_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_806_806826_qa_3/environment/pull_bucket.py +++ b/tasks/0000_806_806826_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_806_806826_qa_3/task.toml b/tasks/0000_806_806826_qa_3/task.toml index e5679493aef33d43568302ef6f66db4d0fa6ae41..bc4eb2924edd7796c94bccfea5217b58be361b84 100644 --- a/tasks/0000_806_806826_qa_3/task.toml +++ b/tasks/0000_806_806826_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_849_849952_qa_4/environment/bootstrap.sh b/tasks/0000_849_849952_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_849_849952_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_849_849952_qa_4/environment/pull_bucket.py b/tasks/0000_849_849952_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_849_849952_qa_4/environment/pull_bucket.py +++ b/tasks/0000_849_849952_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_849_849952_qa_4/task.toml b/tasks/0000_849_849952_qa_4/task.toml index 4fdea68b362077a3020c33da771b4ab03de9b4f9..430adb4813a56f059e87c84b7bc8494d594fae29 100644 --- a/tasks/0000_849_849952_qa_4/task.toml +++ b/tasks/0000_849_849952_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_886_886039_qa_2/environment/bootstrap.sh b/tasks/0000_886_886039_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_886_886039_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_886_886039_qa_2/environment/pull_bucket.py b/tasks/0000_886_886039_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_886_886039_qa_2/environment/pull_bucket.py +++ b/tasks/0000_886_886039_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_886_886039_qa_2/task.toml b/tasks/0000_886_886039_qa_2/task.toml index 3505b9a277ab0cccd998e08b31a1878b7f0c1727..1806f86af8926bcfc1e8c414d471e0ff9cdc5bc8 100644 --- a/tasks/0000_886_886039_qa_2/task.toml +++ b/tasks/0000_886_886039_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_981_981197_qa_1/environment/bootstrap.sh b/tasks/0000_981_981197_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_981_981197_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_981_981197_qa_1/environment/pull_bucket.py b/tasks/0000_981_981197_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_981_981197_qa_1/environment/pull_bucket.py +++ b/tasks/0000_981_981197_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_981_981197_qa_1/task.toml b/tasks/0000_981_981197_qa_1/task.toml index 5323ba9f9f9e955e046535b41fe33c09355336ed..7bf4294c025c12fbe85d1d476fe94b0f83962aa2 100644 --- a/tasks/0000_981_981197_qa_1/task.toml +++ b/tasks/0000_981_981197_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_982_982280_qa_2/environment/bootstrap.sh b/tasks/0000_982_982280_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_982_982280_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_982_982280_qa_2/environment/pull_bucket.py b/tasks/0000_982_982280_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_982_982280_qa_2/environment/pull_bucket.py +++ b/tasks/0000_982_982280_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_982_982280_qa_2/task.toml b/tasks/0000_982_982280_qa_2/task.toml index 671788699da47a045e0ca267b56e2119b4dd6ec0..2c298d5dad75d60670f2c837a817dde8c7eede7e 100644 --- a/tasks/0000_982_982280_qa_2/task.toml +++ b/tasks/0000_982_982280_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0000_992_992184_qa_3/environment/bootstrap.sh b/tasks/0000_992_992184_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0000_992_992184_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0000_992_992184_qa_3/environment/pull_bucket.py b/tasks/0000_992_992184_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0000_992_992184_qa_3/environment/pull_bucket.py +++ b/tasks/0000_992_992184_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0000_992_992184_qa_3/task.toml b/tasks/0000_992_992184_qa_3/task.toml index 1b9243e97ab5acce9a39ac7a23b8014405faabdf..aa871615d7235a61984588fcb896afa153c3f9a9 100644 --- a/tasks/0000_992_992184_qa_3/task.toml +++ b/tasks/0000_992_992184_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_042_1042725_qa_5/environment/bootstrap.sh b/tasks/0001_042_1042725_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_042_1042725_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_042_1042725_qa_5/environment/pull_bucket.py b/tasks/0001_042_1042725_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_042_1042725_qa_5/environment/pull_bucket.py +++ b/tasks/0001_042_1042725_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_042_1042725_qa_5/task.toml b/tasks/0001_042_1042725_qa_5/task.toml index 877789d164b9d9173f80bb622ccd375dde9eaa73..4c4e9b1c7bef15ee5b0304ce0abd552542238baa 100644 --- a/tasks/0001_042_1042725_qa_5/task.toml +++ b/tasks/0001_042_1042725_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_074_1074738_qa_1/environment/bootstrap.sh b/tasks/0001_074_1074738_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_074_1074738_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_074_1074738_qa_1/environment/pull_bucket.py b/tasks/0001_074_1074738_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_074_1074738_qa_1/environment/pull_bucket.py +++ b/tasks/0001_074_1074738_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_074_1074738_qa_1/task.toml b/tasks/0001_074_1074738_qa_1/task.toml index f12c842f3de1a760884dbfad5ac9bb9948e4f62c..eb3cf7c4bbcaf94863ed71a2bcd484912623b3ab 100644 --- a/tasks/0001_074_1074738_qa_1/task.toml +++ b/tasks/0001_074_1074738_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_074_1074738_qa_4/environment/bootstrap.sh b/tasks/0001_074_1074738_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_074_1074738_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_074_1074738_qa_4/environment/pull_bucket.py b/tasks/0001_074_1074738_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_074_1074738_qa_4/environment/pull_bucket.py +++ b/tasks/0001_074_1074738_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_074_1074738_qa_4/task.toml b/tasks/0001_074_1074738_qa_4/task.toml index 896fd91e60218099971bd547a858fdd44e834ca0..04597366d46f6ac099b8366d4322f9c1b2f90909 100644 --- a/tasks/0001_074_1074738_qa_4/task.toml +++ b/tasks/0001_074_1074738_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_085_1085629_qa_2/environment/bootstrap.sh b/tasks/0001_085_1085629_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_085_1085629_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_085_1085629_qa_2/environment/pull_bucket.py b/tasks/0001_085_1085629_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_085_1085629_qa_2/environment/pull_bucket.py +++ b/tasks/0001_085_1085629_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_085_1085629_qa_2/task.toml b/tasks/0001_085_1085629_qa_2/task.toml index 89906c3def51bda80747f6fd5d9e5f10b0118ef7..fc5c874784a4de7a63abd4ab428c99e15fe9b691 100644 --- a/tasks/0001_085_1085629_qa_2/task.toml +++ b/tasks/0001_085_1085629_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_085_1085629_qa_4/environment/bootstrap.sh b/tasks/0001_085_1085629_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_085_1085629_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_085_1085629_qa_4/environment/pull_bucket.py b/tasks/0001_085_1085629_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_085_1085629_qa_4/environment/pull_bucket.py +++ b/tasks/0001_085_1085629_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_085_1085629_qa_4/task.toml b/tasks/0001_085_1085629_qa_4/task.toml index ed50909fcabed5fb3ab3139230f2d923ac8f1c18..d34a56b1e3a9205f71ad922e12a17a01cd09e52d 100644 --- a/tasks/0001_085_1085629_qa_4/task.toml +++ b/tasks/0001_085_1085629_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_090_1090499_qa_1/environment/bootstrap.sh b/tasks/0001_090_1090499_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_090_1090499_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_090_1090499_qa_1/environment/pull_bucket.py b/tasks/0001_090_1090499_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_090_1090499_qa_1/environment/pull_bucket.py +++ b/tasks/0001_090_1090499_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_090_1090499_qa_1/task.toml b/tasks/0001_090_1090499_qa_1/task.toml index d1494f139897a4b693666b36f3f1c07f8d24e005..abb79266327bbbc27f695012172742d3788bdfd7 100644 --- a/tasks/0001_090_1090499_qa_1/task.toml +++ b/tasks/0001_090_1090499_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_133_1133625_qa_4/environment/bootstrap.sh b/tasks/0001_133_1133625_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_133_1133625_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_133_1133625_qa_4/environment/pull_bucket.py b/tasks/0001_133_1133625_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_133_1133625_qa_4/environment/pull_bucket.py +++ b/tasks/0001_133_1133625_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_133_1133625_qa_4/task.toml b/tasks/0001_133_1133625_qa_4/task.toml index fb198453f187895dd8cfa3ddb26a0d01834a86dc..72f5652e32a6dee66cd338b50dbb164fa6fdfcb5 100644 --- a/tasks/0001_133_1133625_qa_4/task.toml +++ b/tasks/0001_133_1133625_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_137_1137361_qa_2/environment/bootstrap.sh b/tasks/0001_137_1137361_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_137_1137361_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_137_1137361_qa_2/environment/pull_bucket.py b/tasks/0001_137_1137361_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_137_1137361_qa_2/environment/pull_bucket.py +++ b/tasks/0001_137_1137361_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_137_1137361_qa_2/task.toml b/tasks/0001_137_1137361_qa_2/task.toml index 2a91e2faf724aad46c68f92419933054e11467d3..cc1a48841cef27ab46fe18b91ccd646dba8401d8 100644 --- a/tasks/0001_137_1137361_qa_2/task.toml +++ b/tasks/0001_137_1137361_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_137_1137537_qa_2/environment/bootstrap.sh b/tasks/0001_137_1137537_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_137_1137537_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_137_1137537_qa_2/environment/pull_bucket.py b/tasks/0001_137_1137537_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_137_1137537_qa_2/environment/pull_bucket.py +++ b/tasks/0001_137_1137537_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_137_1137537_qa_2/task.toml b/tasks/0001_137_1137537_qa_2/task.toml index 11063da9f1b34936b8a3225e6324df3c4b853cf2..d025d5db951abd1916eda429efc0500aad23c7b1 100644 --- a/tasks/0001_137_1137537_qa_2/task.toml +++ b/tasks/0001_137_1137537_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_155_1155051_qa_5/environment/bootstrap.sh b/tasks/0001_155_1155051_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_155_1155051_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_155_1155051_qa_5/environment/pull_bucket.py b/tasks/0001_155_1155051_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_155_1155051_qa_5/environment/pull_bucket.py +++ b/tasks/0001_155_1155051_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_155_1155051_qa_5/task.toml b/tasks/0001_155_1155051_qa_5/task.toml index 596c7483ccebb2783400459696bae58efa676f22..7d607ea91561b5f0c6be65414b65f74d3d0e8f8d 100644 --- a/tasks/0001_155_1155051_qa_5/task.toml +++ b/tasks/0001_155_1155051_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_155_1155264_qa_5/environment/bootstrap.sh b/tasks/0001_155_1155264_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_155_1155264_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_155_1155264_qa_5/environment/pull_bucket.py b/tasks/0001_155_1155264_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_155_1155264_qa_5/environment/pull_bucket.py +++ b/tasks/0001_155_1155264_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_155_1155264_qa_5/task.toml b/tasks/0001_155_1155264_qa_5/task.toml index 0c2bf032fe6a659cea3bc114a5e79f822d56979d..4f0e47a82290bcb8869420968cdb10ff447bd5c6 100644 --- a/tasks/0001_155_1155264_qa_5/task.toml +++ b/tasks/0001_155_1155264_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_160_1160639_qa_1/environment/bootstrap.sh b/tasks/0001_160_1160639_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_160_1160639_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_160_1160639_qa_1/environment/pull_bucket.py b/tasks/0001_160_1160639_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_160_1160639_qa_1/environment/pull_bucket.py +++ b/tasks/0001_160_1160639_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_160_1160639_qa_1/task.toml b/tasks/0001_160_1160639_qa_1/task.toml index c0d8625cc37dd95201ad928afeb56744b24847a8..d8c50cc3aefce8b91851031b87a314862e380498 100644 --- a/tasks/0001_160_1160639_qa_1/task.toml +++ b/tasks/0001_160_1160639_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_170_1170198_qa_3/environment/bootstrap.sh b/tasks/0001_170_1170198_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_170_1170198_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_170_1170198_qa_3/environment/pull_bucket.py b/tasks/0001_170_1170198_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_170_1170198_qa_3/environment/pull_bucket.py +++ b/tasks/0001_170_1170198_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_170_1170198_qa_3/task.toml b/tasks/0001_170_1170198_qa_3/task.toml index e0cb8e69fbe2aa613eb4264c0ded3baa4767762e..d18a6e33a4b37b06c82257d8e73ee461bfbf2c84 100644 --- a/tasks/0001_170_1170198_qa_3/task.toml +++ b/tasks/0001_170_1170198_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_170_1170198_qa_4/environment/bootstrap.sh b/tasks/0001_170_1170198_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_170_1170198_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_170_1170198_qa_4/environment/pull_bucket.py b/tasks/0001_170_1170198_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_170_1170198_qa_4/environment/pull_bucket.py +++ b/tasks/0001_170_1170198_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_170_1170198_qa_4/task.toml b/tasks/0001_170_1170198_qa_4/task.toml index ebef359d53dd026447a5073c0e268b92f4c47f05..67c82ab70a907d490229eb8fa2c8e1d306256aa9 100644 --- a/tasks/0001_170_1170198_qa_4/task.toml +++ b/tasks/0001_170_1170198_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_173_1173665_qa_3/environment/bootstrap.sh b/tasks/0001_173_1173665_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_173_1173665_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_173_1173665_qa_3/environment/pull_bucket.py b/tasks/0001_173_1173665_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_173_1173665_qa_3/environment/pull_bucket.py +++ b/tasks/0001_173_1173665_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_173_1173665_qa_3/task.toml b/tasks/0001_173_1173665_qa_3/task.toml index 29e85fad41e65e824a1caba068ee76c24f5e1ad7..ff11755e8e2434978679f3fc779642ed2f967023 100644 --- a/tasks/0001_173_1173665_qa_3/task.toml +++ b/tasks/0001_173_1173665_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_173_1173665_qa_5/environment/bootstrap.sh b/tasks/0001_173_1173665_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_173_1173665_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_173_1173665_qa_5/environment/pull_bucket.py b/tasks/0001_173_1173665_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_173_1173665_qa_5/environment/pull_bucket.py +++ b/tasks/0001_173_1173665_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_173_1173665_qa_5/task.toml b/tasks/0001_173_1173665_qa_5/task.toml index a0a05edb04d094aab0b49cef9c4f06888ff7ac7a..dd948e001803c9fcdc129bf5ef712256f75b24c8 100644 --- a/tasks/0001_173_1173665_qa_5/task.toml +++ b/tasks/0001_173_1173665_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_175_1175291_qa_4/environment/bootstrap.sh b/tasks/0001_175_1175291_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_175_1175291_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_175_1175291_qa_4/environment/pull_bucket.py b/tasks/0001_175_1175291_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_175_1175291_qa_4/environment/pull_bucket.py +++ b/tasks/0001_175_1175291_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_175_1175291_qa_4/task.toml b/tasks/0001_175_1175291_qa_4/task.toml index 82bb2ce87656e966bf616302d28dec9a433df357..b926b28a20217425347425d2f5fc3cc8770ac933 100644 --- a/tasks/0001_175_1175291_qa_4/task.toml +++ b/tasks/0001_175_1175291_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_181_1181828_qa_4/environment/bootstrap.sh b/tasks/0001_181_1181828_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_181_1181828_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_181_1181828_qa_4/environment/pull_bucket.py b/tasks/0001_181_1181828_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_181_1181828_qa_4/environment/pull_bucket.py +++ b/tasks/0001_181_1181828_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_181_1181828_qa_4/task.toml b/tasks/0001_181_1181828_qa_4/task.toml index a8f96212dc206da1990841872e8cb453b978402f..af1791cee2c70c9fdec4a9a05299a1272b5e8356 100644 --- a/tasks/0001_181_1181828_qa_4/task.toml +++ b/tasks/0001_181_1181828_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_182_1182948_qa_1/environment/bootstrap.sh b/tasks/0001_182_1182948_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_182_1182948_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_182_1182948_qa_1/environment/pull_bucket.py b/tasks/0001_182_1182948_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_182_1182948_qa_1/environment/pull_bucket.py +++ b/tasks/0001_182_1182948_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_182_1182948_qa_1/task.toml b/tasks/0001_182_1182948_qa_1/task.toml index 80086351927fc1776f9bf0542cbc1a10b524c78b..1c0b36621a2e082ff86e18116234a930d0f543b4 100644 --- a/tasks/0001_182_1182948_qa_1/task.toml +++ b/tasks/0001_182_1182948_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_188_1188925_qa_1/environment/bootstrap.sh b/tasks/0001_188_1188925_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_188_1188925_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_188_1188925_qa_1/environment/pull_bucket.py b/tasks/0001_188_1188925_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_188_1188925_qa_1/environment/pull_bucket.py +++ b/tasks/0001_188_1188925_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_188_1188925_qa_1/task.toml b/tasks/0001_188_1188925_qa_1/task.toml index 3036763d743c3ff3bc71dabb0472403517f4578a..fcbf90391101109e1746ad7134771c68c2559d69 100644 --- a/tasks/0001_188_1188925_qa_1/task.toml +++ b/tasks/0001_188_1188925_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_188_1188925_qa_3/environment/bootstrap.sh b/tasks/0001_188_1188925_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_188_1188925_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_188_1188925_qa_3/environment/pull_bucket.py b/tasks/0001_188_1188925_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_188_1188925_qa_3/environment/pull_bucket.py +++ b/tasks/0001_188_1188925_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_188_1188925_qa_3/task.toml b/tasks/0001_188_1188925_qa_3/task.toml index b2848f10b1e1f4aea30b87f98420aa1ee994cdd1..2dc2501d0f89836cf1956293afbf5ae4b1ea2478 100644 --- a/tasks/0001_188_1188925_qa_3/task.toml +++ b/tasks/0001_188_1188925_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_189_1189227_qa_1/environment/bootstrap.sh b/tasks/0001_189_1189227_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_189_1189227_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_189_1189227_qa_1/environment/pull_bucket.py b/tasks/0001_189_1189227_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_189_1189227_qa_1/environment/pull_bucket.py +++ b/tasks/0001_189_1189227_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_189_1189227_qa_1/task.toml b/tasks/0001_189_1189227_qa_1/task.toml index 2eed39acfd9a648c137d41df22129f5f70fbbf3d..61781744f8e9b844f9dbbc1bd45382d046c6ec4c 100644 --- a/tasks/0001_189_1189227_qa_1/task.toml +++ b/tasks/0001_189_1189227_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_189_1189227_qa_2/environment/bootstrap.sh b/tasks/0001_189_1189227_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_189_1189227_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_189_1189227_qa_2/environment/pull_bucket.py b/tasks/0001_189_1189227_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_189_1189227_qa_2/environment/pull_bucket.py +++ b/tasks/0001_189_1189227_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_189_1189227_qa_2/task.toml b/tasks/0001_189_1189227_qa_2/task.toml index a44717a0ffccb380a125aaf2ed4e49ba9e73dca7..117419f969172a3f7a3fe5e2115d647e1ccefdcf 100644 --- a/tasks/0001_189_1189227_qa_2/task.toml +++ b/tasks/0001_189_1189227_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_189_1189227_qa_5/environment/bootstrap.sh b/tasks/0001_189_1189227_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_189_1189227_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_189_1189227_qa_5/environment/pull_bucket.py b/tasks/0001_189_1189227_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_189_1189227_qa_5/environment/pull_bucket.py +++ b/tasks/0001_189_1189227_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_189_1189227_qa_5/task.toml b/tasks/0001_189_1189227_qa_5/task.toml index 37d16c5e36e99cf20d63ded21376806098f349b2..c761473bff836a942a1a966ce3906f225d36c5c8 100644 --- a/tasks/0001_189_1189227_qa_5/task.toml +++ b/tasks/0001_189_1189227_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_191_1191057_qa_4/environment/bootstrap.sh b/tasks/0001_191_1191057_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_191_1191057_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_191_1191057_qa_4/environment/pull_bucket.py b/tasks/0001_191_1191057_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_191_1191057_qa_4/environment/pull_bucket.py +++ b/tasks/0001_191_1191057_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_191_1191057_qa_4/task.toml b/tasks/0001_191_1191057_qa_4/task.toml index eff0d6767a7a7afe749d0f68b48e617dd50f5416..24e4edd599b1721a4e01e183bafe01f893431e51 100644 --- a/tasks/0001_191_1191057_qa_4/task.toml +++ b/tasks/0001_191_1191057_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_193_1193343_qa_3/environment/bootstrap.sh b/tasks/0001_193_1193343_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_193_1193343_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_193_1193343_qa_3/environment/pull_bucket.py b/tasks/0001_193_1193343_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_193_1193343_qa_3/environment/pull_bucket.py +++ b/tasks/0001_193_1193343_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_193_1193343_qa_3/task.toml b/tasks/0001_193_1193343_qa_3/task.toml index dc1ed5e288cf2f29b863892329dfd78d8d60965f..a38f1e27f4ffe9b837c15df8f1e9a010292c7a11 100644 --- a/tasks/0001_193_1193343_qa_3/task.toml +++ b/tasks/0001_193_1193343_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_196_1196803_qa_3/environment/bootstrap.sh b/tasks/0001_196_1196803_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_196_1196803_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_196_1196803_qa_3/environment/pull_bucket.py b/tasks/0001_196_1196803_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_196_1196803_qa_3/environment/pull_bucket.py +++ b/tasks/0001_196_1196803_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_196_1196803_qa_3/task.toml b/tasks/0001_196_1196803_qa_3/task.toml index fb0eb8e2fb17f0cb37f851d5997b9606cf2ff4db..47d99bd04537811a66b72f4dacc6d870154e3d0f 100644 --- a/tasks/0001_196_1196803_qa_3/task.toml +++ b/tasks/0001_196_1196803_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_197_1197721_qa_2/environment/bootstrap.sh b/tasks/0001_197_1197721_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_197_1197721_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_197_1197721_qa_2/environment/pull_bucket.py b/tasks/0001_197_1197721_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_197_1197721_qa_2/environment/pull_bucket.py +++ b/tasks/0001_197_1197721_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_197_1197721_qa_2/task.toml b/tasks/0001_197_1197721_qa_2/task.toml index ad6a2bcc56598eed5000bb4400119af5b4f5f758..0884e62d2965a97b218e6b1bedd08699ba813842 100644 --- a/tasks/0001_197_1197721_qa_2/task.toml +++ b/tasks/0001_197_1197721_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_202_1202888_qa_1/environment/bootstrap.sh b/tasks/0001_202_1202888_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_202_1202888_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_202_1202888_qa_1/environment/pull_bucket.py b/tasks/0001_202_1202888_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_202_1202888_qa_1/environment/pull_bucket.py +++ b/tasks/0001_202_1202888_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_202_1202888_qa_1/task.toml b/tasks/0001_202_1202888_qa_1/task.toml index f89dc9d028f9bc136a1bf5dc19a0b61cbeb8a871..263a5bd0593e43d17e9996c249fe9ea172a705c7 100644 --- a/tasks/0001_202_1202888_qa_1/task.toml +++ b/tasks/0001_202_1202888_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_221_1221016_qa_1/environment/bootstrap.sh b/tasks/0001_221_1221016_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_221_1221016_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_221_1221016_qa_1/environment/pull_bucket.py b/tasks/0001_221_1221016_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_221_1221016_qa_1/environment/pull_bucket.py +++ b/tasks/0001_221_1221016_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_221_1221016_qa_1/task.toml b/tasks/0001_221_1221016_qa_1/task.toml index 6ea6cf284bf6616866decd4c07e18177022184ca..c23586995dcb936c1d095a807a3c7081c9cf5ba2 100644 --- a/tasks/0001_221_1221016_qa_1/task.toml +++ b/tasks/0001_221_1221016_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_231_1231918_qa_1/environment/bootstrap.sh b/tasks/0001_231_1231918_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_231_1231918_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_231_1231918_qa_1/environment/pull_bucket.py b/tasks/0001_231_1231918_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_231_1231918_qa_1/environment/pull_bucket.py +++ b/tasks/0001_231_1231918_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_231_1231918_qa_1/task.toml b/tasks/0001_231_1231918_qa_1/task.toml index e2d8b95b65c70ba77d5eddc25e57eb36e210a97f..ce778b46a33ed29b54c873d4fac6a2217e5acacb 100644 --- a/tasks/0001_231_1231918_qa_1/task.toml +++ b/tasks/0001_231_1231918_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_231_1231918_qa_2/environment/bootstrap.sh b/tasks/0001_231_1231918_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_231_1231918_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_231_1231918_qa_2/environment/pull_bucket.py b/tasks/0001_231_1231918_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_231_1231918_qa_2/environment/pull_bucket.py +++ b/tasks/0001_231_1231918_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_231_1231918_qa_2/task.toml b/tasks/0001_231_1231918_qa_2/task.toml index 01df8708028f90c8056940427fc73ae4fbff3bc0..f1ceaeaec2e1882002558bca4dab13afbdf20edf 100644 --- a/tasks/0001_231_1231918_qa_2/task.toml +++ b/tasks/0001_231_1231918_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_233_1233959_qa_2/environment/bootstrap.sh b/tasks/0001_233_1233959_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_233_1233959_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_233_1233959_qa_2/environment/pull_bucket.py b/tasks/0001_233_1233959_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_233_1233959_qa_2/environment/pull_bucket.py +++ b/tasks/0001_233_1233959_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_233_1233959_qa_2/task.toml b/tasks/0001_233_1233959_qa_2/task.toml index 6bf53658616ad604f384ea9328adec7cfd34c478..a47cc1dab9b69b75f7d6d8a923fdf7a28cbe50c0 100644 --- a/tasks/0001_233_1233959_qa_2/task.toml +++ b/tasks/0001_233_1233959_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_233_1233959_qa_5/environment/bootstrap.sh b/tasks/0001_233_1233959_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_233_1233959_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_233_1233959_qa_5/environment/pull_bucket.py b/tasks/0001_233_1233959_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_233_1233959_qa_5/environment/pull_bucket.py +++ b/tasks/0001_233_1233959_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_233_1233959_qa_5/task.toml b/tasks/0001_233_1233959_qa_5/task.toml index 22538e37fcf51f838c47b2245d212eb73a6d2d39..03a95657bb606c040d309c5f87e7648c4d2d7630 100644 --- a/tasks/0001_233_1233959_qa_5/task.toml +++ b/tasks/0001_233_1233959_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_234_1234901_qa_3/environment/bootstrap.sh b/tasks/0001_234_1234901_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_234_1234901_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_234_1234901_qa_3/environment/pull_bucket.py b/tasks/0001_234_1234901_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_234_1234901_qa_3/environment/pull_bucket.py +++ b/tasks/0001_234_1234901_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_234_1234901_qa_3/task.toml b/tasks/0001_234_1234901_qa_3/task.toml index 350892b5ba682bb9ceae12aa541c1553e0e029dc..1faabb8e5919cf4fd232a5d747246a86ce3bae74 100644 --- a/tasks/0001_234_1234901_qa_3/task.toml +++ b/tasks/0001_234_1234901_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_234_1234901_qa_5/environment/bootstrap.sh b/tasks/0001_234_1234901_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_234_1234901_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_234_1234901_qa_5/environment/pull_bucket.py b/tasks/0001_234_1234901_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_234_1234901_qa_5/environment/pull_bucket.py +++ b/tasks/0001_234_1234901_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_234_1234901_qa_5/task.toml b/tasks/0001_234_1234901_qa_5/task.toml index 98668ebc5b4638059c1f4f64f519f81924bfd7c4..a0d1370f1ac897b4a73b5249ee53e35fb1541b3c 100644 --- a/tasks/0001_234_1234901_qa_5/task.toml +++ b/tasks/0001_234_1234901_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_238_1238370_qa_1/environment/bootstrap.sh b/tasks/0001_238_1238370_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_238_1238370_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_238_1238370_qa_1/environment/pull_bucket.py b/tasks/0001_238_1238370_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_238_1238370_qa_1/environment/pull_bucket.py +++ b/tasks/0001_238_1238370_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_238_1238370_qa_1/task.toml b/tasks/0001_238_1238370_qa_1/task.toml index 5f3bfd8d591e5fc6eda5bec850bac30810737620..ccf8ba63258cd20940785ddd9bfe119836c72dd2 100644 --- a/tasks/0001_238_1238370_qa_1/task.toml +++ b/tasks/0001_238_1238370_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_239_1239559_qa_4/environment/bootstrap.sh b/tasks/0001_239_1239559_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_239_1239559_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_239_1239559_qa_4/environment/pull_bucket.py b/tasks/0001_239_1239559_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_239_1239559_qa_4/environment/pull_bucket.py +++ b/tasks/0001_239_1239559_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_239_1239559_qa_4/task.toml b/tasks/0001_239_1239559_qa_4/task.toml index 9feb5d6761b6a6d7ebebff3e3401e91fffaf5f6d..238c3860aec85ebc5f3f8dc6ea9cc4491c7dbccc 100644 --- a/tasks/0001_239_1239559_qa_4/task.toml +++ b/tasks/0001_239_1239559_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_240_1240535_qa_1/environment/bootstrap.sh b/tasks/0001_240_1240535_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_240_1240535_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_240_1240535_qa_1/environment/pull_bucket.py b/tasks/0001_240_1240535_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_240_1240535_qa_1/environment/pull_bucket.py +++ b/tasks/0001_240_1240535_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_240_1240535_qa_1/task.toml b/tasks/0001_240_1240535_qa_1/task.toml index 0df154b54f1adbc96cf08ca4aff1af197acc37cb..e9ccd07fcfe0d86322d62101f8548e8ef2c9c317 100644 --- a/tasks/0001_240_1240535_qa_1/task.toml +++ b/tasks/0001_240_1240535_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_243_1243037_qa_1/environment/bootstrap.sh b/tasks/0001_243_1243037_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_243_1243037_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_243_1243037_qa_1/environment/pull_bucket.py b/tasks/0001_243_1243037_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_243_1243037_qa_1/environment/pull_bucket.py +++ b/tasks/0001_243_1243037_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_243_1243037_qa_1/task.toml b/tasks/0001_243_1243037_qa_1/task.toml index 0053e71cc1d50bd910f3330ce1a90a1674650369..7d196404eee17fb993eca188d279da45616a62af 100644 --- a/tasks/0001_243_1243037_qa_1/task.toml +++ b/tasks/0001_243_1243037_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_243_1243037_qa_2/environment/bootstrap.sh b/tasks/0001_243_1243037_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_243_1243037_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_243_1243037_qa_2/environment/pull_bucket.py b/tasks/0001_243_1243037_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_243_1243037_qa_2/environment/pull_bucket.py +++ b/tasks/0001_243_1243037_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_243_1243037_qa_2/task.toml b/tasks/0001_243_1243037_qa_2/task.toml index 4c8a03a72b96429ebd530f6a8b531da43526e004..9f43af67380017b0b0e843fdb5f0c032564d3a84 100644 --- a/tasks/0001_243_1243037_qa_2/task.toml +++ b/tasks/0001_243_1243037_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_244_1244861_qa_4/environment/bootstrap.sh b/tasks/0001_244_1244861_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_244_1244861_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_244_1244861_qa_4/environment/pull_bucket.py b/tasks/0001_244_1244861_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_244_1244861_qa_4/environment/pull_bucket.py +++ b/tasks/0001_244_1244861_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_244_1244861_qa_4/task.toml b/tasks/0001_244_1244861_qa_4/task.toml index 4fbc3f37f75e80eb5b81787674f189b038c75c31..03f20888870f703ae54aa38c6ddcf0fccdadfe87 100644 --- a/tasks/0001_244_1244861_qa_4/task.toml +++ b/tasks/0001_244_1244861_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_247_1247152_qa_1/environment/bootstrap.sh b/tasks/0001_247_1247152_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_247_1247152_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_247_1247152_qa_1/environment/pull_bucket.py b/tasks/0001_247_1247152_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_247_1247152_qa_1/environment/pull_bucket.py +++ b/tasks/0001_247_1247152_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_247_1247152_qa_1/task.toml b/tasks/0001_247_1247152_qa_1/task.toml index 9fe5c7eb214e1ccdf397870e68a23b0b11cb4207..92810ff0466ef9bd74719f7cb5b828e8544f5a9c 100644 --- a/tasks/0001_247_1247152_qa_1/task.toml +++ b/tasks/0001_247_1247152_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_250_1250826_qa_3/environment/bootstrap.sh b/tasks/0001_250_1250826_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_250_1250826_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_250_1250826_qa_3/environment/pull_bucket.py b/tasks/0001_250_1250826_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_250_1250826_qa_3/environment/pull_bucket.py +++ b/tasks/0001_250_1250826_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_250_1250826_qa_3/task.toml b/tasks/0001_250_1250826_qa_3/task.toml index f1dc6506dc9badb629f5b5e644aed289052091df..3e9bf5d678c246eefcb526be07d5447d769b438f 100644 --- a/tasks/0001_250_1250826_qa_3/task.toml +++ b/tasks/0001_250_1250826_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_257_1257061_qa_1/environment/bootstrap.sh b/tasks/0001_257_1257061_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_257_1257061_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_257_1257061_qa_1/environment/pull_bucket.py b/tasks/0001_257_1257061_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_257_1257061_qa_1/environment/pull_bucket.py +++ b/tasks/0001_257_1257061_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_257_1257061_qa_1/task.toml b/tasks/0001_257_1257061_qa_1/task.toml index 537c57427fd051e1b144d86cfa03c448c99ea013..cce467e685a67e77bea44a8b0c66c386a1ec6963 100644 --- a/tasks/0001_257_1257061_qa_1/task.toml +++ b/tasks/0001_257_1257061_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_257_1257061_qa_2/environment/bootstrap.sh b/tasks/0001_257_1257061_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_257_1257061_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_257_1257061_qa_2/environment/pull_bucket.py b/tasks/0001_257_1257061_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_257_1257061_qa_2/environment/pull_bucket.py +++ b/tasks/0001_257_1257061_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_257_1257061_qa_2/task.toml b/tasks/0001_257_1257061_qa_2/task.toml index d79ac44f28bed1e7fa0dcfbfe83e6bb3798a6229..dd0ce29a249d084327ea8b129da423f91fd1af4b 100644 --- a/tasks/0001_257_1257061_qa_2/task.toml +++ b/tasks/0001_257_1257061_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_257_1257061_qa_3/environment/bootstrap.sh b/tasks/0001_257_1257061_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_257_1257061_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_257_1257061_qa_3/environment/pull_bucket.py b/tasks/0001_257_1257061_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_257_1257061_qa_3/environment/pull_bucket.py +++ b/tasks/0001_257_1257061_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_257_1257061_qa_3/task.toml b/tasks/0001_257_1257061_qa_3/task.toml index e95e0fe7faa9a7e1856976ef914f96bbb28844a6..f25fef3f54c53a79be6050e38df0d7a9ab33ea5a 100644 --- a/tasks/0001_257_1257061_qa_3/task.toml +++ b/tasks/0001_257_1257061_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_257_1257756_qa_1/environment/bootstrap.sh b/tasks/0001_257_1257756_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_257_1257756_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_257_1257756_qa_1/environment/pull_bucket.py b/tasks/0001_257_1257756_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_257_1257756_qa_1/environment/pull_bucket.py +++ b/tasks/0001_257_1257756_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_257_1257756_qa_1/task.toml b/tasks/0001_257_1257756_qa_1/task.toml index f41057acd9fd8b77a0c154cc072faeaf07a9314e..58e8aa0a4fa18b2c6011ee50aba2c4e9a485bff0 100644 --- a/tasks/0001_257_1257756_qa_1/task.toml +++ b/tasks/0001_257_1257756_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_257_1257756_qa_2/environment/bootstrap.sh b/tasks/0001_257_1257756_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_257_1257756_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_257_1257756_qa_2/environment/pull_bucket.py b/tasks/0001_257_1257756_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_257_1257756_qa_2/environment/pull_bucket.py +++ b/tasks/0001_257_1257756_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_257_1257756_qa_2/task.toml b/tasks/0001_257_1257756_qa_2/task.toml index 6318624bd6d86343fbc6e42fc5ba3449204eb8f5..c0bce50b0e6e2a079a5714cf9822b919e28bece4 100644 --- a/tasks/0001_257_1257756_qa_2/task.toml +++ b/tasks/0001_257_1257756_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_257_1257756_qa_3/environment/bootstrap.sh b/tasks/0001_257_1257756_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_257_1257756_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_257_1257756_qa_3/environment/pull_bucket.py b/tasks/0001_257_1257756_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_257_1257756_qa_3/environment/pull_bucket.py +++ b/tasks/0001_257_1257756_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_257_1257756_qa_3/task.toml b/tasks/0001_257_1257756_qa_3/task.toml index fa7186138ebfd2ac6267a6ec4b850c93b15e8b9c..e61bf342a261bb24e610b0554464accef1c721e7 100644 --- a/tasks/0001_257_1257756_qa_3/task.toml +++ b/tasks/0001_257_1257756_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_261_1261978_qa_5/environment/bootstrap.sh b/tasks/0001_261_1261978_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_261_1261978_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_261_1261978_qa_5/environment/pull_bucket.py b/tasks/0001_261_1261978_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_261_1261978_qa_5/environment/pull_bucket.py +++ b/tasks/0001_261_1261978_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_261_1261978_qa_5/task.toml b/tasks/0001_261_1261978_qa_5/task.toml index be91a650b0bef795a302b80747569d2e4457e46a..6ff3e23ea245121918e4c1a0aba3962bef94029b 100644 --- a/tasks/0001_261_1261978_qa_5/task.toml +++ b/tasks/0001_261_1261978_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_262_1262014_qa_4/environment/bootstrap.sh b/tasks/0001_262_1262014_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_262_1262014_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_262_1262014_qa_4/environment/pull_bucket.py b/tasks/0001_262_1262014_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_262_1262014_qa_4/environment/pull_bucket.py +++ b/tasks/0001_262_1262014_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_262_1262014_qa_4/task.toml b/tasks/0001_262_1262014_qa_4/task.toml index 79cf89a2e4f3921b3107b1cbc2b51a11b790f424..7fcccad32b68c554db72f4f2cf5eec70dde50d90 100644 --- a/tasks/0001_262_1262014_qa_4/task.toml +++ b/tasks/0001_262_1262014_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_272_1272652_qa_1/environment/bootstrap.sh b/tasks/0001_272_1272652_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_272_1272652_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_272_1272652_qa_1/environment/pull_bucket.py b/tasks/0001_272_1272652_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_272_1272652_qa_1/environment/pull_bucket.py +++ b/tasks/0001_272_1272652_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_272_1272652_qa_1/task.toml b/tasks/0001_272_1272652_qa_1/task.toml index 0545a8cd900487f362617e6c7367dbd011121ce7..4777d4c644a1b30e3352a6e78ab261c252524998 100644 --- a/tasks/0001_272_1272652_qa_1/task.toml +++ b/tasks/0001_272_1272652_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_273_1273208_qa_1/environment/bootstrap.sh b/tasks/0001_273_1273208_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_273_1273208_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_273_1273208_qa_1/environment/pull_bucket.py b/tasks/0001_273_1273208_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_273_1273208_qa_1/environment/pull_bucket.py +++ b/tasks/0001_273_1273208_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_273_1273208_qa_1/task.toml b/tasks/0001_273_1273208_qa_1/task.toml index 4e0748a9a1b2fe6db551c65f2813ea97d111f48f..0950a94f71034ccee1799b4d37e11dcf9ef3635a 100644 --- a/tasks/0001_273_1273208_qa_1/task.toml +++ b/tasks/0001_273_1273208_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_273_1273208_qa_2/environment/bootstrap.sh b/tasks/0001_273_1273208_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_273_1273208_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_273_1273208_qa_2/environment/pull_bucket.py b/tasks/0001_273_1273208_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_273_1273208_qa_2/environment/pull_bucket.py +++ b/tasks/0001_273_1273208_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_273_1273208_qa_2/task.toml b/tasks/0001_273_1273208_qa_2/task.toml index d7bfb3b89cf829c706d8dfc9ddfc0b323194cea7..4828957578db274f0cc63d44b0cc60d828d36fa9 100644 --- a/tasks/0001_273_1273208_qa_2/task.toml +++ b/tasks/0001_273_1273208_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_275_1275171_qa_3/environment/bootstrap.sh b/tasks/0001_275_1275171_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_275_1275171_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_275_1275171_qa_3/environment/pull_bucket.py b/tasks/0001_275_1275171_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_275_1275171_qa_3/environment/pull_bucket.py +++ b/tasks/0001_275_1275171_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_275_1275171_qa_3/task.toml b/tasks/0001_275_1275171_qa_3/task.toml index 57caeefd26a53130af6a73ccbc04d65d6ca2c291..d6e854aec8753a87edbc06c8d76da87bf489c484 100644 --- a/tasks/0001_275_1275171_qa_3/task.toml +++ b/tasks/0001_275_1275171_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_275_1275171_qa_4/environment/bootstrap.sh b/tasks/0001_275_1275171_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_275_1275171_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_275_1275171_qa_4/environment/pull_bucket.py b/tasks/0001_275_1275171_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_275_1275171_qa_4/environment/pull_bucket.py +++ b/tasks/0001_275_1275171_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_275_1275171_qa_4/task.toml b/tasks/0001_275_1275171_qa_4/task.toml index 38e0f6b89e1996640dfeeaccd267a0da6f7274f7..fae989e07bdf88f3e34399df73871d1075270cd7 100644 --- a/tasks/0001_275_1275171_qa_4/task.toml +++ b/tasks/0001_275_1275171_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_277_1277058_qa_1/environment/bootstrap.sh b/tasks/0001_277_1277058_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_277_1277058_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_277_1277058_qa_1/environment/pull_bucket.py b/tasks/0001_277_1277058_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_277_1277058_qa_1/environment/pull_bucket.py +++ b/tasks/0001_277_1277058_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_277_1277058_qa_1/task.toml b/tasks/0001_277_1277058_qa_1/task.toml index 0a23fbdd1ec72dc9e77132eeb032e0d0f08cc359..b93ff0781f7a7d775682d0312a3e41039ce41ad2 100644 --- a/tasks/0001_277_1277058_qa_1/task.toml +++ b/tasks/0001_277_1277058_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_277_1277058_qa_2/environment/bootstrap.sh b/tasks/0001_277_1277058_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_277_1277058_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_277_1277058_qa_2/environment/pull_bucket.py b/tasks/0001_277_1277058_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_277_1277058_qa_2/environment/pull_bucket.py +++ b/tasks/0001_277_1277058_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_277_1277058_qa_2/task.toml b/tasks/0001_277_1277058_qa_2/task.toml index 25d3fd67bbbf8e5a8b6ffc6f0979a34432078ea1..a81f203191757e31462023a3e9074eb93525a23c 100644 --- a/tasks/0001_277_1277058_qa_2/task.toml +++ b/tasks/0001_277_1277058_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_277_1277058_qa_5/environment/bootstrap.sh b/tasks/0001_277_1277058_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_277_1277058_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_277_1277058_qa_5/environment/pull_bucket.py b/tasks/0001_277_1277058_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_277_1277058_qa_5/environment/pull_bucket.py +++ b/tasks/0001_277_1277058_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_277_1277058_qa_5/task.toml b/tasks/0001_277_1277058_qa_5/task.toml index 503223df4493ce9bcc8937123ed6b4e81aa138d4..8b7ce8e523c9e4cfb03b986024798ee996c4a38b 100644 --- a/tasks/0001_277_1277058_qa_5/task.toml +++ b/tasks/0001_277_1277058_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_282_1282413_qa_5/environment/bootstrap.sh b/tasks/0001_282_1282413_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_282_1282413_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_282_1282413_qa_5/environment/pull_bucket.py b/tasks/0001_282_1282413_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_282_1282413_qa_5/environment/pull_bucket.py +++ b/tasks/0001_282_1282413_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_282_1282413_qa_5/task.toml b/tasks/0001_282_1282413_qa_5/task.toml index fdc16766e8bd4b0997715f411f1eb4eae3db74e0..dccf792911e553fa693a4cce1dbc7ab63f324491 100644 --- a/tasks/0001_282_1282413_qa_5/task.toml +++ b/tasks/0001_282_1282413_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_289_1289812_qa_4/environment/bootstrap.sh b/tasks/0001_289_1289812_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_289_1289812_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_289_1289812_qa_4/environment/pull_bucket.py b/tasks/0001_289_1289812_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_289_1289812_qa_4/environment/pull_bucket.py +++ b/tasks/0001_289_1289812_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_289_1289812_qa_4/task.toml b/tasks/0001_289_1289812_qa_4/task.toml index ef56199d5e0b76bce473fad4b77e4c870240da3c..358527ea0525f1fc502450793a6542aa2e0c75bb 100644 --- a/tasks/0001_289_1289812_qa_4/task.toml +++ b/tasks/0001_289_1289812_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_293_1293142_qa_5/environment/bootstrap.sh b/tasks/0001_293_1293142_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_293_1293142_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_293_1293142_qa_5/environment/pull_bucket.py b/tasks/0001_293_1293142_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_293_1293142_qa_5/environment/pull_bucket.py +++ b/tasks/0001_293_1293142_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_293_1293142_qa_5/task.toml b/tasks/0001_293_1293142_qa_5/task.toml index 273842e7bbf987c7da5e5c2c39e754735f5c9428..dea4e932c57ad439334f2e9c0834c0abcc6f6d55 100644 --- a/tasks/0001_293_1293142_qa_5/task.toml +++ b/tasks/0001_293_1293142_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_312_1312239_qa_2/environment/bootstrap.sh b/tasks/0001_312_1312239_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_312_1312239_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_312_1312239_qa_2/environment/pull_bucket.py b/tasks/0001_312_1312239_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_312_1312239_qa_2/environment/pull_bucket.py +++ b/tasks/0001_312_1312239_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_312_1312239_qa_2/task.toml b/tasks/0001_312_1312239_qa_2/task.toml index 2fb7e55d40f35677d7f9052d4f6b65cab83b02b1..a77fd0f1af6fd06d1619db99bd62934dca56371b 100644 --- a/tasks/0001_312_1312239_qa_2/task.toml +++ b/tasks/0001_312_1312239_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_315_1315610_qa_2/environment/bootstrap.sh b/tasks/0001_315_1315610_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_315_1315610_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_315_1315610_qa_2/environment/pull_bucket.py b/tasks/0001_315_1315610_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_315_1315610_qa_2/environment/pull_bucket.py +++ b/tasks/0001_315_1315610_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_315_1315610_qa_2/task.toml b/tasks/0001_315_1315610_qa_2/task.toml index 29fbaf7302d037d0937f3922954a539fd0792131..b7aa69e5ae94d661c8078e596ed0239fb4cc9318 100644 --- a/tasks/0001_315_1315610_qa_2/task.toml +++ b/tasks/0001_315_1315610_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_323_1323152_qa_1/environment/bootstrap.sh b/tasks/0001_323_1323152_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_323_1323152_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_323_1323152_qa_1/environment/pull_bucket.py b/tasks/0001_323_1323152_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_323_1323152_qa_1/environment/pull_bucket.py +++ b/tasks/0001_323_1323152_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_323_1323152_qa_1/task.toml b/tasks/0001_323_1323152_qa_1/task.toml index 99688757a666c8a273f4f1cf2616d82fae958744..81f17ee8ef473f1411872e97a7a7b0cc3a5c54a6 100644 --- a/tasks/0001_323_1323152_qa_1/task.toml +++ b/tasks/0001_323_1323152_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_325_1325110_qa_5/environment/bootstrap.sh b/tasks/0001_325_1325110_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_325_1325110_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_325_1325110_qa_5/environment/pull_bucket.py b/tasks/0001_325_1325110_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_325_1325110_qa_5/environment/pull_bucket.py +++ b/tasks/0001_325_1325110_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_325_1325110_qa_5/task.toml b/tasks/0001_325_1325110_qa_5/task.toml index 3481589f5025abf2285c11371f1e20ba81a365d3..49f6a8c3e577c819625029823b234b34a2463ca5 100644 --- a/tasks/0001_325_1325110_qa_5/task.toml +++ b/tasks/0001_325_1325110_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_330_1330281_qa_3/environment/bootstrap.sh b/tasks/0001_330_1330281_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_330_1330281_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_330_1330281_qa_3/environment/pull_bucket.py b/tasks/0001_330_1330281_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_330_1330281_qa_3/environment/pull_bucket.py +++ b/tasks/0001_330_1330281_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_330_1330281_qa_3/task.toml b/tasks/0001_330_1330281_qa_3/task.toml index c434b8d12c51b6b21dc0379161f819272427a8fe..f2d8eb2ab8a7dcbb49eaaf573f7881df947d6fa9 100644 --- a/tasks/0001_330_1330281_qa_3/task.toml +++ b/tasks/0001_330_1330281_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_330_1330281_qa_4/environment/bootstrap.sh b/tasks/0001_330_1330281_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_330_1330281_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_330_1330281_qa_4/environment/pull_bucket.py b/tasks/0001_330_1330281_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_330_1330281_qa_4/environment/pull_bucket.py +++ b/tasks/0001_330_1330281_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_330_1330281_qa_4/task.toml b/tasks/0001_330_1330281_qa_4/task.toml index ce9561a2e28f410cb1da6229829482b21a0e7748..d2714427fb8f4a4b3bfdf16f8bde7dfbce1eaa75 100644 --- a/tasks/0001_330_1330281_qa_4/task.toml +++ b/tasks/0001_330_1330281_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_341_1341821_qa_1/environment/bootstrap.sh b/tasks/0001_341_1341821_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_341_1341821_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_341_1341821_qa_1/environment/pull_bucket.py b/tasks/0001_341_1341821_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_341_1341821_qa_1/environment/pull_bucket.py +++ b/tasks/0001_341_1341821_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_341_1341821_qa_1/task.toml b/tasks/0001_341_1341821_qa_1/task.toml index c72ba038bc38ee6ee99f160762c33d8c07cf0ec3..e205eebb31c5ebb33bcac3c9ea33d5de5934f337 100644 --- a/tasks/0001_341_1341821_qa_1/task.toml +++ b/tasks/0001_341_1341821_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_349_1349978_qa_4/environment/bootstrap.sh b/tasks/0001_349_1349978_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_349_1349978_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_349_1349978_qa_4/environment/pull_bucket.py b/tasks/0001_349_1349978_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_349_1349978_qa_4/environment/pull_bucket.py +++ b/tasks/0001_349_1349978_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_349_1349978_qa_4/task.toml b/tasks/0001_349_1349978_qa_4/task.toml index 86e4ed13e49cfd3ff84c9e0d39836fb0d4121934..cc8f58079d14b6e2cce5dd1e7d7c4cdd257e494b 100644 --- a/tasks/0001_349_1349978_qa_4/task.toml +++ b/tasks/0001_349_1349978_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_351_1351211_qa_2/environment/bootstrap.sh b/tasks/0001_351_1351211_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_351_1351211_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_351_1351211_qa_2/environment/pull_bucket.py b/tasks/0001_351_1351211_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_351_1351211_qa_2/environment/pull_bucket.py +++ b/tasks/0001_351_1351211_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_351_1351211_qa_2/task.toml b/tasks/0001_351_1351211_qa_2/task.toml index feca42e30af6df2f54ecb83ada92460c0abb8715..003f61267a01798ac906f002f0ab173f33fa7cb0 100644 --- a/tasks/0001_351_1351211_qa_2/task.toml +++ b/tasks/0001_351_1351211_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_352_1352372_qa_1/environment/bootstrap.sh b/tasks/0001_352_1352372_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_352_1352372_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_352_1352372_qa_1/environment/pull_bucket.py b/tasks/0001_352_1352372_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_352_1352372_qa_1/environment/pull_bucket.py +++ b/tasks/0001_352_1352372_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_352_1352372_qa_1/task.toml b/tasks/0001_352_1352372_qa_1/task.toml index 13a57127e54bf083fdc58dc30392d734d3033d0c..9375be8187797845ea898072b709d6cd1be7048a 100644 --- a/tasks/0001_352_1352372_qa_1/task.toml +++ b/tasks/0001_352_1352372_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_352_1352372_qa_5/environment/bootstrap.sh b/tasks/0001_352_1352372_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_352_1352372_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_352_1352372_qa_5/environment/pull_bucket.py b/tasks/0001_352_1352372_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_352_1352372_qa_5/environment/pull_bucket.py +++ b/tasks/0001_352_1352372_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_352_1352372_qa_5/task.toml b/tasks/0001_352_1352372_qa_5/task.toml index df2cb437c621a71318e705ce85297f4c6ccb9d2d..ca9a81e0e613f9b041b820a42b846193657c700a 100644 --- a/tasks/0001_352_1352372_qa_5/task.toml +++ b/tasks/0001_352_1352372_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_353_1353632_qa_3/environment/bootstrap.sh b/tasks/0001_353_1353632_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_353_1353632_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_353_1353632_qa_3/environment/pull_bucket.py b/tasks/0001_353_1353632_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_353_1353632_qa_3/environment/pull_bucket.py +++ b/tasks/0001_353_1353632_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_353_1353632_qa_3/task.toml b/tasks/0001_353_1353632_qa_3/task.toml index b25fef271127af9ea0ea026f2348b7ecaad5f2c1..5a8259e13ff467c5c3e50f7134d15d0e7f18ceaa 100644 --- a/tasks/0001_353_1353632_qa_3/task.toml +++ b/tasks/0001_353_1353632_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_353_1353930_qa_1/environment/bootstrap.sh b/tasks/0001_353_1353930_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_353_1353930_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_353_1353930_qa_1/environment/pull_bucket.py b/tasks/0001_353_1353930_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_353_1353930_qa_1/environment/pull_bucket.py +++ b/tasks/0001_353_1353930_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_353_1353930_qa_1/task.toml b/tasks/0001_353_1353930_qa_1/task.toml index 3600553376d059b969456b543b734825b62300ab..104b264d1a127c631627c280ff4b6815cde97dbd 100644 --- a/tasks/0001_353_1353930_qa_1/task.toml +++ b/tasks/0001_353_1353930_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_354_1354131_qa_1/environment/bootstrap.sh b/tasks/0001_354_1354131_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_354_1354131_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_354_1354131_qa_1/environment/pull_bucket.py b/tasks/0001_354_1354131_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_354_1354131_qa_1/environment/pull_bucket.py +++ b/tasks/0001_354_1354131_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_354_1354131_qa_1/task.toml b/tasks/0001_354_1354131_qa_1/task.toml index ce5fd87f1698f5baa6a878fde65dd03c43073fe9..a071569fb0cacf4bdbcf0aa11924f2cd2592094e 100644 --- a/tasks/0001_354_1354131_qa_1/task.toml +++ b/tasks/0001_354_1354131_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_361_1361614_qa_1/environment/bootstrap.sh b/tasks/0001_361_1361614_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_361_1361614_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_361_1361614_qa_1/environment/pull_bucket.py b/tasks/0001_361_1361614_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_361_1361614_qa_1/environment/pull_bucket.py +++ b/tasks/0001_361_1361614_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_361_1361614_qa_1/task.toml b/tasks/0001_361_1361614_qa_1/task.toml index 2f4e66d6067aa1b23b83e59e7df3764e29e79c74..40b0db93393866612e27af1cc9ae09ca948053c8 100644 --- a/tasks/0001_361_1361614_qa_1/task.toml +++ b/tasks/0001_361_1361614_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_364_1364936_qa_3/environment/bootstrap.sh b/tasks/0001_364_1364936_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_364_1364936_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_364_1364936_qa_3/environment/pull_bucket.py b/tasks/0001_364_1364936_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_364_1364936_qa_3/environment/pull_bucket.py +++ b/tasks/0001_364_1364936_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_364_1364936_qa_3/task.toml b/tasks/0001_364_1364936_qa_3/task.toml index 4fad6fa388d157d75e98a9f1535b9fc559ff24e0..5dcc0c40bbeb7da0bcda646bfa610a0a917b6e2c 100644 --- a/tasks/0001_364_1364936_qa_3/task.toml +++ b/tasks/0001_364_1364936_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_364_1364936_qa_4/environment/bootstrap.sh b/tasks/0001_364_1364936_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_364_1364936_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_364_1364936_qa_4/environment/pull_bucket.py b/tasks/0001_364_1364936_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_364_1364936_qa_4/environment/pull_bucket.py +++ b/tasks/0001_364_1364936_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_364_1364936_qa_4/task.toml b/tasks/0001_364_1364936_qa_4/task.toml index a9bdcbdc331801f0f22e407d8d2ee9ae94455e91..5b00e0f1449d93ddab9cf634f10263984e52d0ef 100644 --- a/tasks/0001_364_1364936_qa_4/task.toml +++ b/tasks/0001_364_1364936_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_367_1367107_qa_1/environment/bootstrap.sh b/tasks/0001_367_1367107_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_367_1367107_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_367_1367107_qa_1/environment/pull_bucket.py b/tasks/0001_367_1367107_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_367_1367107_qa_1/environment/pull_bucket.py +++ b/tasks/0001_367_1367107_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_367_1367107_qa_1/task.toml b/tasks/0001_367_1367107_qa_1/task.toml index 08a90ddd9bee0c6a981d39a680415ca5b6da4e65..357f87e00d0385fa27bf8acb86712244e0cdcf67 100644 --- a/tasks/0001_367_1367107_qa_1/task.toml +++ b/tasks/0001_367_1367107_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_367_1367483_qa_4/environment/bootstrap.sh b/tasks/0001_367_1367483_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_367_1367483_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_367_1367483_qa_4/environment/pull_bucket.py b/tasks/0001_367_1367483_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_367_1367483_qa_4/environment/pull_bucket.py +++ b/tasks/0001_367_1367483_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_367_1367483_qa_4/task.toml b/tasks/0001_367_1367483_qa_4/task.toml index 4061a9c38fba6143e385cae66b1f1869dcd329b1..5d4e0a78fc35b818198ac3abb6ee86fb3cf79040 100644 --- a/tasks/0001_367_1367483_qa_4/task.toml +++ b/tasks/0001_367_1367483_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_368_1368371_qa_2/environment/bootstrap.sh b/tasks/0001_368_1368371_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_368_1368371_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_368_1368371_qa_2/environment/pull_bucket.py b/tasks/0001_368_1368371_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_368_1368371_qa_2/environment/pull_bucket.py +++ b/tasks/0001_368_1368371_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_368_1368371_qa_2/task.toml b/tasks/0001_368_1368371_qa_2/task.toml index dd5b6a45e21e54f8ca572ee57d8bfffe89b7b221..544e9dc1ff9de08255c664ff371d8d0a36e89bba 100644 --- a/tasks/0001_368_1368371_qa_2/task.toml +++ b/tasks/0001_368_1368371_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_374_1374329_qa_2/environment/bootstrap.sh b/tasks/0001_374_1374329_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_374_1374329_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_374_1374329_qa_2/environment/pull_bucket.py b/tasks/0001_374_1374329_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_374_1374329_qa_2/environment/pull_bucket.py +++ b/tasks/0001_374_1374329_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_374_1374329_qa_2/task.toml b/tasks/0001_374_1374329_qa_2/task.toml index f0dac144a50e370d933a52c2273c47263a84b2e2..14577ce472f2f9f54676ddd0c94aa88906017cec 100644 --- a/tasks/0001_374_1374329_qa_2/task.toml +++ b/tasks/0001_374_1374329_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_374_1374329_qa_3/environment/bootstrap.sh b/tasks/0001_374_1374329_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_374_1374329_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_374_1374329_qa_3/environment/pull_bucket.py b/tasks/0001_374_1374329_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_374_1374329_qa_3/environment/pull_bucket.py +++ b/tasks/0001_374_1374329_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_374_1374329_qa_3/task.toml b/tasks/0001_374_1374329_qa_3/task.toml index 7be8f8de84588bd54e4951635874961054101d73..e7d5416de171f2535c8cc117e912209fd5a5fd1b 100644 --- a/tasks/0001_374_1374329_qa_3/task.toml +++ b/tasks/0001_374_1374329_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_379_1379568_qa_1/environment/bootstrap.sh b/tasks/0001_379_1379568_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_379_1379568_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_379_1379568_qa_1/environment/pull_bucket.py b/tasks/0001_379_1379568_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_379_1379568_qa_1/environment/pull_bucket.py +++ b/tasks/0001_379_1379568_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_379_1379568_qa_1/task.toml b/tasks/0001_379_1379568_qa_1/task.toml index bd1bdb8803ec7967541ff63a3f8a996073318837..b035bdff1846041fc8a489875e3287249ccb44e7 100644 --- a/tasks/0001_379_1379568_qa_1/task.toml +++ b/tasks/0001_379_1379568_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_379_1379568_qa_4/environment/bootstrap.sh b/tasks/0001_379_1379568_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_379_1379568_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_379_1379568_qa_4/environment/pull_bucket.py b/tasks/0001_379_1379568_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_379_1379568_qa_4/environment/pull_bucket.py +++ b/tasks/0001_379_1379568_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_379_1379568_qa_4/task.toml b/tasks/0001_379_1379568_qa_4/task.toml index c0ae92b6455160d011d88b3217514df3115caffd..28b2aa474e4a58121afa8e6da435e88a89fe2e77 100644 --- a/tasks/0001_379_1379568_qa_4/task.toml +++ b/tasks/0001_379_1379568_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_380_1380018_qa_1/environment/bootstrap.sh b/tasks/0001_380_1380018_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_380_1380018_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_380_1380018_qa_1/environment/pull_bucket.py b/tasks/0001_380_1380018_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_380_1380018_qa_1/environment/pull_bucket.py +++ b/tasks/0001_380_1380018_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_380_1380018_qa_1/task.toml b/tasks/0001_380_1380018_qa_1/task.toml index 35d6bdc663732ed16b7a1f21d84ffa37ec53b67c..4c9407aa1c4de72f2ea6d187e01cf46fd6ea2d28 100644 --- a/tasks/0001_380_1380018_qa_1/task.toml +++ b/tasks/0001_380_1380018_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_380_1380018_qa_3/environment/bootstrap.sh b/tasks/0001_380_1380018_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_380_1380018_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_380_1380018_qa_3/environment/pull_bucket.py b/tasks/0001_380_1380018_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_380_1380018_qa_3/environment/pull_bucket.py +++ b/tasks/0001_380_1380018_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_380_1380018_qa_3/task.toml b/tasks/0001_380_1380018_qa_3/task.toml index fba0695945b7c419b190754fa4fc1ad75e161dbc..23b3ca12fc15140834b26581274d1cb0d6b822ca 100644 --- a/tasks/0001_380_1380018_qa_3/task.toml +++ b/tasks/0001_380_1380018_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_392_1392811_qa_3/environment/bootstrap.sh b/tasks/0001_392_1392811_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_392_1392811_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_392_1392811_qa_3/environment/pull_bucket.py b/tasks/0001_392_1392811_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_392_1392811_qa_3/environment/pull_bucket.py +++ b/tasks/0001_392_1392811_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_392_1392811_qa_3/task.toml b/tasks/0001_392_1392811_qa_3/task.toml index 3cc0752dbdc357b810e1e322bdc2036acf17f20f..b77bf704e47b3c8b9eaa443109f005bf94bb529f 100644 --- a/tasks/0001_392_1392811_qa_3/task.toml +++ b/tasks/0001_392_1392811_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_400_1400936_qa_5/environment/bootstrap.sh b/tasks/0001_400_1400936_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_400_1400936_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_400_1400936_qa_5/environment/pull_bucket.py b/tasks/0001_400_1400936_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_400_1400936_qa_5/environment/pull_bucket.py +++ b/tasks/0001_400_1400936_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_400_1400936_qa_5/task.toml b/tasks/0001_400_1400936_qa_5/task.toml index 4a5a9e6e4ea529d154cc25cc6dcdaa693b612ab6..60cf8e09a0db765710ce7a19977c09425a4e0564 100644 --- a/tasks/0001_400_1400936_qa_5/task.toml +++ b/tasks/0001_400_1400936_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_404_1404790_qa_3/environment/bootstrap.sh b/tasks/0001_404_1404790_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_404_1404790_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_404_1404790_qa_3/environment/pull_bucket.py b/tasks/0001_404_1404790_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_404_1404790_qa_3/environment/pull_bucket.py +++ b/tasks/0001_404_1404790_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_404_1404790_qa_3/task.toml b/tasks/0001_404_1404790_qa_3/task.toml index 83872947b1ab5e91671705f1b424905926fe6aae..170b665e8d9bcb066fd49e58918db6c4aa4d65ae 100644 --- a/tasks/0001_404_1404790_qa_3/task.toml +++ b/tasks/0001_404_1404790_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_404_1404839_qa_4/environment/bootstrap.sh b/tasks/0001_404_1404839_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_404_1404839_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_404_1404839_qa_4/environment/pull_bucket.py b/tasks/0001_404_1404839_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_404_1404839_qa_4/environment/pull_bucket.py +++ b/tasks/0001_404_1404839_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_404_1404839_qa_4/task.toml b/tasks/0001_404_1404839_qa_4/task.toml index ebbe008cec685ee3c0c77e3666cd5c0ad2941bce..e21933c4d9ba79acdb3a28509591030588f88f5e 100644 --- a/tasks/0001_404_1404839_qa_4/task.toml +++ b/tasks/0001_404_1404839_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_413_1413239_qa_1/environment/bootstrap.sh b/tasks/0001_413_1413239_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_413_1413239_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_413_1413239_qa_1/environment/pull_bucket.py b/tasks/0001_413_1413239_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_413_1413239_qa_1/environment/pull_bucket.py +++ b/tasks/0001_413_1413239_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_413_1413239_qa_1/task.toml b/tasks/0001_413_1413239_qa_1/task.toml index c5f1c9846abef61db87911aab2e9507e0a26092b..802e19593285dd889ddb578b371eb95a645d3690 100644 --- a/tasks/0001_413_1413239_qa_1/task.toml +++ b/tasks/0001_413_1413239_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_413_1413239_qa_2/environment/bootstrap.sh b/tasks/0001_413_1413239_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_413_1413239_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_413_1413239_qa_2/environment/pull_bucket.py b/tasks/0001_413_1413239_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_413_1413239_qa_2/environment/pull_bucket.py +++ b/tasks/0001_413_1413239_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_413_1413239_qa_2/task.toml b/tasks/0001_413_1413239_qa_2/task.toml index 6292f0e145e7646df465c6e54c1656a68fbdb2ef..05c60bde10753b8839708f28c471a17039d272e3 100644 --- a/tasks/0001_413_1413239_qa_2/task.toml +++ b/tasks/0001_413_1413239_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_413_1413239_qa_3/environment/bootstrap.sh b/tasks/0001_413_1413239_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_413_1413239_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_413_1413239_qa_3/environment/pull_bucket.py b/tasks/0001_413_1413239_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_413_1413239_qa_3/environment/pull_bucket.py +++ b/tasks/0001_413_1413239_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_413_1413239_qa_3/task.toml b/tasks/0001_413_1413239_qa_3/task.toml index 65c4aca38d421af07bad96aba2610d046d988554..28ed329f8f54d667a52315f4dee252d8c9fb320e 100644 --- a/tasks/0001_413_1413239_qa_3/task.toml +++ b/tasks/0001_413_1413239_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_425_1425114_qa_5/environment/bootstrap.sh b/tasks/0001_425_1425114_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_425_1425114_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_425_1425114_qa_5/environment/pull_bucket.py b/tasks/0001_425_1425114_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_425_1425114_qa_5/environment/pull_bucket.py +++ b/tasks/0001_425_1425114_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_425_1425114_qa_5/task.toml b/tasks/0001_425_1425114_qa_5/task.toml index daa73fc50189b8191828e47decd23ba3ed2f0692..6b2650457816b95a53c2012bea2ec9799feab436 100644 --- a/tasks/0001_425_1425114_qa_5/task.toml +++ b/tasks/0001_425_1425114_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_426_1426219_qa_2/environment/bootstrap.sh b/tasks/0001_426_1426219_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_426_1426219_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_426_1426219_qa_2/environment/pull_bucket.py b/tasks/0001_426_1426219_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_426_1426219_qa_2/environment/pull_bucket.py +++ b/tasks/0001_426_1426219_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_426_1426219_qa_2/task.toml b/tasks/0001_426_1426219_qa_2/task.toml index 2867bc4e194cba8c0d701816d5dc56f94bb2c0be..43c53e066facdd25f0d2f4a785080bb4e03a149a 100644 --- a/tasks/0001_426_1426219_qa_2/task.toml +++ b/tasks/0001_426_1426219_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_426_1426219_qa_4/environment/bootstrap.sh b/tasks/0001_426_1426219_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_426_1426219_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_426_1426219_qa_4/environment/pull_bucket.py b/tasks/0001_426_1426219_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_426_1426219_qa_4/environment/pull_bucket.py +++ b/tasks/0001_426_1426219_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_426_1426219_qa_4/task.toml b/tasks/0001_426_1426219_qa_4/task.toml index 92b54741f14d1aae9e5f454ab3de9219071e73d2..fc06b2ac8efc3aea474b83eba8936c5d033003e4 100644 --- a/tasks/0001_426_1426219_qa_4/task.toml +++ b/tasks/0001_426_1426219_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_426_1426833_qa_1/environment/bootstrap.sh b/tasks/0001_426_1426833_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_426_1426833_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_426_1426833_qa_1/environment/pull_bucket.py b/tasks/0001_426_1426833_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_426_1426833_qa_1/environment/pull_bucket.py +++ b/tasks/0001_426_1426833_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_426_1426833_qa_1/task.toml b/tasks/0001_426_1426833_qa_1/task.toml index 9c71afdab3bd2b36f9b84deb4ab67e87983729d3..1d84cff3fcb8ec9407e479e0ee6a34d76204747f 100644 --- a/tasks/0001_426_1426833_qa_1/task.toml +++ b/tasks/0001_426_1426833_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_435_1435960_qa_3/environment/bootstrap.sh b/tasks/0001_435_1435960_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_435_1435960_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_435_1435960_qa_3/environment/pull_bucket.py b/tasks/0001_435_1435960_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_435_1435960_qa_3/environment/pull_bucket.py +++ b/tasks/0001_435_1435960_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_435_1435960_qa_3/task.toml b/tasks/0001_435_1435960_qa_3/task.toml index 0cf55ac882d6f6d56338055f5b5a23d81cd4404a..6a0e799cac3ed955ffce53fd296050f4342ce7fc 100644 --- a/tasks/0001_435_1435960_qa_3/task.toml +++ b/tasks/0001_435_1435960_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_435_1435960_qa_4/environment/bootstrap.sh b/tasks/0001_435_1435960_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_435_1435960_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_435_1435960_qa_4/environment/pull_bucket.py b/tasks/0001_435_1435960_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_435_1435960_qa_4/environment/pull_bucket.py +++ b/tasks/0001_435_1435960_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_435_1435960_qa_4/task.toml b/tasks/0001_435_1435960_qa_4/task.toml index 1c6a6a0c6adb0809643e136d7d91f01954f8efc6..1ce82d15870817e81d078553231a0fb2d17e31dd 100644 --- a/tasks/0001_435_1435960_qa_4/task.toml +++ b/tasks/0001_435_1435960_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_445_1445407_qa_4/environment/bootstrap.sh b/tasks/0001_445_1445407_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_445_1445407_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_445_1445407_qa_4/environment/pull_bucket.py b/tasks/0001_445_1445407_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_445_1445407_qa_4/environment/pull_bucket.py +++ b/tasks/0001_445_1445407_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_445_1445407_qa_4/task.toml b/tasks/0001_445_1445407_qa_4/task.toml index ccf2667601b28d41096bf9330b9545d721fd55c3..0f0ef741bb9be4b25c0dae173d3867320f1cba7a 100644 --- a/tasks/0001_445_1445407_qa_4/task.toml +++ b/tasks/0001_445_1445407_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_448_1448587_qa_3/environment/bootstrap.sh b/tasks/0001_448_1448587_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_448_1448587_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_448_1448587_qa_3/environment/pull_bucket.py b/tasks/0001_448_1448587_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_448_1448587_qa_3/environment/pull_bucket.py +++ b/tasks/0001_448_1448587_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_448_1448587_qa_3/task.toml b/tasks/0001_448_1448587_qa_3/task.toml index b1ea749b3342615c37aadab1dc6ee45c310dbaa2..36a75c4e5b0aa96489ec08feace8c8b22b94ead6 100644 --- a/tasks/0001_448_1448587_qa_3/task.toml +++ b/tasks/0001_448_1448587_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_451_1451212_qa_2/environment/bootstrap.sh b/tasks/0001_451_1451212_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_451_1451212_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_451_1451212_qa_2/environment/pull_bucket.py b/tasks/0001_451_1451212_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_451_1451212_qa_2/environment/pull_bucket.py +++ b/tasks/0001_451_1451212_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_451_1451212_qa_2/task.toml b/tasks/0001_451_1451212_qa_2/task.toml index 29b8b1338f7ecd3459329150dcbab78d19a40859..5cffd500669df76e0fa9c2ff9358a55231c73535 100644 --- a/tasks/0001_451_1451212_qa_2/task.toml +++ b/tasks/0001_451_1451212_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_452_1452536_qa_1/environment/bootstrap.sh b/tasks/0001_452_1452536_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_452_1452536_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_452_1452536_qa_1/environment/pull_bucket.py b/tasks/0001_452_1452536_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_452_1452536_qa_1/environment/pull_bucket.py +++ b/tasks/0001_452_1452536_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_452_1452536_qa_1/task.toml b/tasks/0001_452_1452536_qa_1/task.toml index bc69c315409f04b0e0d8d6b80e0a762ac1c8c52e..32c46b2d0411cf87e027f3095767c2de4c76b898 100644 --- a/tasks/0001_452_1452536_qa_1/task.toml +++ b/tasks/0001_452_1452536_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_464_1464229_qa_3/environment/bootstrap.sh b/tasks/0001_464_1464229_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_464_1464229_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_464_1464229_qa_3/environment/pull_bucket.py b/tasks/0001_464_1464229_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_464_1464229_qa_3/environment/pull_bucket.py +++ b/tasks/0001_464_1464229_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_464_1464229_qa_3/task.toml b/tasks/0001_464_1464229_qa_3/task.toml index e7f2e77cf2a4109cc433e757015bf8fc75e7ea82..1a1dac3b0546e78bb76800025378f5b12a717402 100644 --- a/tasks/0001_464_1464229_qa_3/task.toml +++ b/tasks/0001_464_1464229_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_464_1464229_qa_4/environment/bootstrap.sh b/tasks/0001_464_1464229_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_464_1464229_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_464_1464229_qa_4/environment/pull_bucket.py b/tasks/0001_464_1464229_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_464_1464229_qa_4/environment/pull_bucket.py +++ b/tasks/0001_464_1464229_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_464_1464229_qa_4/task.toml b/tasks/0001_464_1464229_qa_4/task.toml index 4de46212d8c64ade1e747147d8b3d957ecab1cc3..9af8bb6ff45a48f3674fd5f6bc9a436a99d4bbb8 100644 --- a/tasks/0001_464_1464229_qa_4/task.toml +++ b/tasks/0001_464_1464229_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_471_1471274_qa_1/environment/bootstrap.sh b/tasks/0001_471_1471274_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_471_1471274_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_471_1471274_qa_1/environment/pull_bucket.py b/tasks/0001_471_1471274_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_471_1471274_qa_1/environment/pull_bucket.py +++ b/tasks/0001_471_1471274_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_471_1471274_qa_1/task.toml b/tasks/0001_471_1471274_qa_1/task.toml index 35386448cc36eef0fef7c8770b14a989b18ae1df..d0645b74551e885a7f3793499a99ab8b6d878636 100644 --- a/tasks/0001_471_1471274_qa_1/task.toml +++ b/tasks/0001_471_1471274_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_473_1473187_qa_1/environment/bootstrap.sh b/tasks/0001_473_1473187_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_473_1473187_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_473_1473187_qa_1/environment/pull_bucket.py b/tasks/0001_473_1473187_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_473_1473187_qa_1/environment/pull_bucket.py +++ b/tasks/0001_473_1473187_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_473_1473187_qa_1/task.toml b/tasks/0001_473_1473187_qa_1/task.toml index 59edb1270211b7b2304004024a36992631e75525..1422da316ce18a07f5afe4aae5d4cf6ddefe68ff 100644 --- a/tasks/0001_473_1473187_qa_1/task.toml +++ b/tasks/0001_473_1473187_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_473_1473187_qa_2/environment/bootstrap.sh b/tasks/0001_473_1473187_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_473_1473187_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_473_1473187_qa_2/environment/pull_bucket.py b/tasks/0001_473_1473187_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_473_1473187_qa_2/environment/pull_bucket.py +++ b/tasks/0001_473_1473187_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_473_1473187_qa_2/task.toml b/tasks/0001_473_1473187_qa_2/task.toml index 778149edc8ff54d0419328fc2b0ec8dd54f22450..32d22a1203a392dc046c086148aa20ebf3a7727d 100644 --- a/tasks/0001_473_1473187_qa_2/task.toml +++ b/tasks/0001_473_1473187_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_473_1473187_qa_4/environment/bootstrap.sh b/tasks/0001_473_1473187_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_473_1473187_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_473_1473187_qa_4/environment/pull_bucket.py b/tasks/0001_473_1473187_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_473_1473187_qa_4/environment/pull_bucket.py +++ b/tasks/0001_473_1473187_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_473_1473187_qa_4/task.toml b/tasks/0001_473_1473187_qa_4/task.toml index 83826cc20510abf1a0dfb927d215b92f734da398..b9556359490b57a746061059b5e97a4b49df8885 100644 --- a/tasks/0001_473_1473187_qa_4/task.toml +++ b/tasks/0001_473_1473187_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_480_1480111_qa_3/environment/bootstrap.sh b/tasks/0001_480_1480111_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_480_1480111_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_480_1480111_qa_3/environment/pull_bucket.py b/tasks/0001_480_1480111_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_480_1480111_qa_3/environment/pull_bucket.py +++ b/tasks/0001_480_1480111_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_480_1480111_qa_3/task.toml b/tasks/0001_480_1480111_qa_3/task.toml index 2a7a22c774ea7f121cd4e243197c9253eddc0f22..fd1bdce70121fa350aadd17befbee5ec7c490ac8 100644 --- a/tasks/0001_480_1480111_qa_3/task.toml +++ b/tasks/0001_480_1480111_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_483_1483764_qa_5/environment/bootstrap.sh b/tasks/0001_483_1483764_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_483_1483764_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_483_1483764_qa_5/environment/pull_bucket.py b/tasks/0001_483_1483764_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_483_1483764_qa_5/environment/pull_bucket.py +++ b/tasks/0001_483_1483764_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_483_1483764_qa_5/task.toml b/tasks/0001_483_1483764_qa_5/task.toml index 65ca0cfcc29be102a5ae02579dec056a6801b6b7..a3a2ad59a5a794c92c205c7a2bd05418f7a45640 100644 --- a/tasks/0001_483_1483764_qa_5/task.toml +++ b/tasks/0001_483_1483764_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_487_1487950_qa_1/environment/bootstrap.sh b/tasks/0001_487_1487950_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_487_1487950_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_487_1487950_qa_1/environment/pull_bucket.py b/tasks/0001_487_1487950_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_487_1487950_qa_1/environment/pull_bucket.py +++ b/tasks/0001_487_1487950_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_487_1487950_qa_1/task.toml b/tasks/0001_487_1487950_qa_1/task.toml index b41b734fa60b2ad2119348ba85155a2f795035a8..478c1c4ce2e3f6151095ac398b092381ba3dd8ed 100644 --- a/tasks/0001_487_1487950_qa_1/task.toml +++ b/tasks/0001_487_1487950_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_487_1487950_qa_3/environment/bootstrap.sh b/tasks/0001_487_1487950_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_487_1487950_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_487_1487950_qa_3/environment/pull_bucket.py b/tasks/0001_487_1487950_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_487_1487950_qa_3/environment/pull_bucket.py +++ b/tasks/0001_487_1487950_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_487_1487950_qa_3/task.toml b/tasks/0001_487_1487950_qa_3/task.toml index 33e05ad37195325ceb4f59758f2b3fab9e900a6b..b10414e55112c6bb1e537f30a8f0aad177b1ce11 100644 --- a/tasks/0001_487_1487950_qa_3/task.toml +++ b/tasks/0001_487_1487950_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_494_1494820_qa_3/environment/bootstrap.sh b/tasks/0001_494_1494820_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_494_1494820_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_494_1494820_qa_3/environment/pull_bucket.py b/tasks/0001_494_1494820_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_494_1494820_qa_3/environment/pull_bucket.py +++ b/tasks/0001_494_1494820_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_494_1494820_qa_3/task.toml b/tasks/0001_494_1494820_qa_3/task.toml index c852530468b1aafbcc9c9d0b2c5632fc1603a2e7..1b650abf2736254b3c710103fd8bffe206332a3d 100644 --- a/tasks/0001_494_1494820_qa_3/task.toml +++ b/tasks/0001_494_1494820_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_518_1518668_qa_3/environment/bootstrap.sh b/tasks/0001_518_1518668_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_518_1518668_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_518_1518668_qa_3/environment/pull_bucket.py b/tasks/0001_518_1518668_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_518_1518668_qa_3/environment/pull_bucket.py +++ b/tasks/0001_518_1518668_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_518_1518668_qa_3/task.toml b/tasks/0001_518_1518668_qa_3/task.toml index 5d07819641169814dd2e3da2f367bf5cfe8ef974..b167dc4947a189202627938491cef821e2963a02 100644 --- a/tasks/0001_518_1518668_qa_3/task.toml +++ b/tasks/0001_518_1518668_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_520_1520172_qa_1/environment/bootstrap.sh b/tasks/0001_520_1520172_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_520_1520172_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_520_1520172_qa_1/environment/pull_bucket.py b/tasks/0001_520_1520172_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_520_1520172_qa_1/environment/pull_bucket.py +++ b/tasks/0001_520_1520172_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_520_1520172_qa_1/task.toml b/tasks/0001_520_1520172_qa_1/task.toml index 97d49d3bf7373ad513cad0ed63c91928f0ae8edd..b698d25a32158df54a72c3edd1870b67524f4461 100644 --- a/tasks/0001_520_1520172_qa_1/task.toml +++ b/tasks/0001_520_1520172_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_520_1520172_qa_4/environment/bootstrap.sh b/tasks/0001_520_1520172_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_520_1520172_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_520_1520172_qa_4/environment/pull_bucket.py b/tasks/0001_520_1520172_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_520_1520172_qa_4/environment/pull_bucket.py +++ b/tasks/0001_520_1520172_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_520_1520172_qa_4/task.toml b/tasks/0001_520_1520172_qa_4/task.toml index dc75126d5b4ef58ee26cbd3828b30b08938db6d9..3c7d596f9ffa0fe19172ae81bfbf4cce896a4efa 100644 --- a/tasks/0001_520_1520172_qa_4/task.toml +++ b/tasks/0001_520_1520172_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_521_1521206_qa_1/environment/bootstrap.sh b/tasks/0001_521_1521206_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_521_1521206_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_521_1521206_qa_1/environment/pull_bucket.py b/tasks/0001_521_1521206_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_521_1521206_qa_1/environment/pull_bucket.py +++ b/tasks/0001_521_1521206_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_521_1521206_qa_1/task.toml b/tasks/0001_521_1521206_qa_1/task.toml index 4d2c8e0da4f5621d5892994bf51f9221689b6629..b70f8298f29f1db2fba1431bb29fe667ca2db51e 100644 --- a/tasks/0001_521_1521206_qa_1/task.toml +++ b/tasks/0001_521_1521206_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_521_1521206_qa_2/environment/bootstrap.sh b/tasks/0001_521_1521206_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_521_1521206_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_521_1521206_qa_2/environment/pull_bucket.py b/tasks/0001_521_1521206_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_521_1521206_qa_2/environment/pull_bucket.py +++ b/tasks/0001_521_1521206_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_521_1521206_qa_2/task.toml b/tasks/0001_521_1521206_qa_2/task.toml index 01d871bfb77669b8ca4985e238b956f01decb681..189e815faa2d1a1cb4ac96ae4296622b598e44be 100644 --- a/tasks/0001_521_1521206_qa_2/task.toml +++ b/tasks/0001_521_1521206_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_522_1522371_qa_2/environment/bootstrap.sh b/tasks/0001_522_1522371_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_522_1522371_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_522_1522371_qa_2/environment/pull_bucket.py b/tasks/0001_522_1522371_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_522_1522371_qa_2/environment/pull_bucket.py +++ b/tasks/0001_522_1522371_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_522_1522371_qa_2/task.toml b/tasks/0001_522_1522371_qa_2/task.toml index 9b2cfada426890818805c356423d4f7fdbc91dfb..2cf2ca49e4216f883db57de4bb042cbd1e7682a1 100644 --- a/tasks/0001_522_1522371_qa_2/task.toml +++ b/tasks/0001_522_1522371_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_522_1522371_qa_5/environment/bootstrap.sh b/tasks/0001_522_1522371_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_522_1522371_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_522_1522371_qa_5/environment/pull_bucket.py b/tasks/0001_522_1522371_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_522_1522371_qa_5/environment/pull_bucket.py +++ b/tasks/0001_522_1522371_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_522_1522371_qa_5/task.toml b/tasks/0001_522_1522371_qa_5/task.toml index 3d961ca2ebbb7f5031e9f5753b5a951c8b34f1e4..bea6bd576a68f17f33f3aaf689d7e9d4667f3cca 100644 --- a/tasks/0001_522_1522371_qa_5/task.toml +++ b/tasks/0001_522_1522371_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_526_1526706_qa_4/environment/bootstrap.sh b/tasks/0001_526_1526706_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_526_1526706_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_526_1526706_qa_4/environment/pull_bucket.py b/tasks/0001_526_1526706_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_526_1526706_qa_4/environment/pull_bucket.py +++ b/tasks/0001_526_1526706_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_526_1526706_qa_4/task.toml b/tasks/0001_526_1526706_qa_4/task.toml index c44a52f0b237dbad9bf26921ccae8d6a75272893..75b61306058f30d2e164b9d84a1be938ec8d30b3 100644 --- a/tasks/0001_526_1526706_qa_4/task.toml +++ b/tasks/0001_526_1526706_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_527_1527039_qa_2/environment/bootstrap.sh b/tasks/0001_527_1527039_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_527_1527039_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_527_1527039_qa_2/environment/pull_bucket.py b/tasks/0001_527_1527039_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_527_1527039_qa_2/environment/pull_bucket.py +++ b/tasks/0001_527_1527039_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_527_1527039_qa_2/task.toml b/tasks/0001_527_1527039_qa_2/task.toml index 4b973e8e362d7e67dc3da0c1fc28689365580b6c..3f64c56b9149cab86f5f2da0d2a5fe2a187fd625 100644 --- a/tasks/0001_527_1527039_qa_2/task.toml +++ b/tasks/0001_527_1527039_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_527_1527039_qa_3/environment/bootstrap.sh b/tasks/0001_527_1527039_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_527_1527039_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_527_1527039_qa_3/environment/pull_bucket.py b/tasks/0001_527_1527039_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_527_1527039_qa_3/environment/pull_bucket.py +++ b/tasks/0001_527_1527039_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_527_1527039_qa_3/task.toml b/tasks/0001_527_1527039_qa_3/task.toml index cc66349636ed9718deac9908dabf422407d9beb3..49de77b465d3c2508c70efd55e0d89475d20ca49 100644 --- a/tasks/0001_527_1527039_qa_3/task.toml +++ b/tasks/0001_527_1527039_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_527_1527054_qa_2/environment/bootstrap.sh b/tasks/0001_527_1527054_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_527_1527054_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_527_1527054_qa_2/environment/pull_bucket.py b/tasks/0001_527_1527054_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_527_1527054_qa_2/environment/pull_bucket.py +++ b/tasks/0001_527_1527054_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_527_1527054_qa_2/task.toml b/tasks/0001_527_1527054_qa_2/task.toml index 121e308878c71ad76c87f2ed133d26b28c457090..8383963b934a246c8e000dc72deeeb612dfaeebe 100644 --- a/tasks/0001_527_1527054_qa_2/task.toml +++ b/tasks/0001_527_1527054_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_527_1527054_qa_5/environment/bootstrap.sh b/tasks/0001_527_1527054_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_527_1527054_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_527_1527054_qa_5/environment/pull_bucket.py b/tasks/0001_527_1527054_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_527_1527054_qa_5/environment/pull_bucket.py +++ b/tasks/0001_527_1527054_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_527_1527054_qa_5/task.toml b/tasks/0001_527_1527054_qa_5/task.toml index 2803a6859ee8a24eb6aabac192b1222dd506d41f..aca5acae7b46d0b6b36705aec3531e5d420b88fe 100644 --- a/tasks/0001_527_1527054_qa_5/task.toml +++ b/tasks/0001_527_1527054_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_531_1531545_qa_2/environment/bootstrap.sh b/tasks/0001_531_1531545_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_531_1531545_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_531_1531545_qa_2/environment/pull_bucket.py b/tasks/0001_531_1531545_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_531_1531545_qa_2/environment/pull_bucket.py +++ b/tasks/0001_531_1531545_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_531_1531545_qa_2/task.toml b/tasks/0001_531_1531545_qa_2/task.toml index 56087ca97dd332e39c1057f8a7c1374f4a438325..a485d94cfdac7aef61ab212191732ae70fd0766a 100644 --- a/tasks/0001_531_1531545_qa_2/task.toml +++ b/tasks/0001_531_1531545_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_531_1531545_qa_3/environment/bootstrap.sh b/tasks/0001_531_1531545_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_531_1531545_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_531_1531545_qa_3/environment/pull_bucket.py b/tasks/0001_531_1531545_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_531_1531545_qa_3/environment/pull_bucket.py +++ b/tasks/0001_531_1531545_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_531_1531545_qa_3/task.toml b/tasks/0001_531_1531545_qa_3/task.toml index fc2b1736d044bd343c873387e85209f679488ef8..7d6c5094728da538600c4709339905b75379cc02 100644 --- a/tasks/0001_531_1531545_qa_3/task.toml +++ b/tasks/0001_531_1531545_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_531_1531559_qa_2/environment/bootstrap.sh b/tasks/0001_531_1531559_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_531_1531559_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_531_1531559_qa_2/environment/pull_bucket.py b/tasks/0001_531_1531559_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_531_1531559_qa_2/environment/pull_bucket.py +++ b/tasks/0001_531_1531559_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_531_1531559_qa_2/task.toml b/tasks/0001_531_1531559_qa_2/task.toml index cce1d6b77efec4f04ac8831c7dcd7f5455f934aa..2776b8a9094b91c460b3546e2f8a6bbab09053ae 100644 --- a/tasks/0001_531_1531559_qa_2/task.toml +++ b/tasks/0001_531_1531559_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_531_1531776_qa_2/environment/bootstrap.sh b/tasks/0001_531_1531776_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_531_1531776_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_531_1531776_qa_2/environment/pull_bucket.py b/tasks/0001_531_1531776_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_531_1531776_qa_2/environment/pull_bucket.py +++ b/tasks/0001_531_1531776_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_531_1531776_qa_2/task.toml b/tasks/0001_531_1531776_qa_2/task.toml index 93f1703f11ab7a634bd191254a0d5cf2301777b8..3be4a825343516d47f6a11c0d3f23675b533b4e1 100644 --- a/tasks/0001_531_1531776_qa_2/task.toml +++ b/tasks/0001_531_1531776_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_532_1532154_qa_1/environment/bootstrap.sh b/tasks/0001_532_1532154_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_532_1532154_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_532_1532154_qa_1/environment/pull_bucket.py b/tasks/0001_532_1532154_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_532_1532154_qa_1/environment/pull_bucket.py +++ b/tasks/0001_532_1532154_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_532_1532154_qa_1/task.toml b/tasks/0001_532_1532154_qa_1/task.toml index 6ff5f0d58e99fb81c1bf5d3ffc933dd8f1fcb852..fbcb54d2fa69eadd54479fa5ddaddd78fdf8a2c4 100644 --- a/tasks/0001_532_1532154_qa_1/task.toml +++ b/tasks/0001_532_1532154_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_532_1532154_qa_3/environment/bootstrap.sh b/tasks/0001_532_1532154_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_532_1532154_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_532_1532154_qa_3/environment/pull_bucket.py b/tasks/0001_532_1532154_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_532_1532154_qa_3/environment/pull_bucket.py +++ b/tasks/0001_532_1532154_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_532_1532154_qa_3/task.toml b/tasks/0001_532_1532154_qa_3/task.toml index 301877238e4ae6601d566f4b00d08fddb0ecdf19..31fb3cb2685178651ae85ed5d3179ea57aa3714f 100644 --- a/tasks/0001_532_1532154_qa_3/task.toml +++ b/tasks/0001_532_1532154_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_532_1532154_qa_4/environment/bootstrap.sh b/tasks/0001_532_1532154_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_532_1532154_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_532_1532154_qa_4/environment/pull_bucket.py b/tasks/0001_532_1532154_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_532_1532154_qa_4/environment/pull_bucket.py +++ b/tasks/0001_532_1532154_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_532_1532154_qa_4/task.toml b/tasks/0001_532_1532154_qa_4/task.toml index adc4454cc1a0aa5ad6e3ee338f702082ec6b7fc9..b0cda23358c700e5e428d1b3a772043b2c75dc0d 100644 --- a/tasks/0001_532_1532154_qa_4/task.toml +++ b/tasks/0001_532_1532154_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_532_1532154_qa_5/environment/bootstrap.sh b/tasks/0001_532_1532154_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_532_1532154_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_532_1532154_qa_5/environment/pull_bucket.py b/tasks/0001_532_1532154_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_532_1532154_qa_5/environment/pull_bucket.py +++ b/tasks/0001_532_1532154_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_532_1532154_qa_5/task.toml b/tasks/0001_532_1532154_qa_5/task.toml index 3380238010ed007cc0b28a68b3d753c0f196e2e8..ac256d6905abc72c2a9b9031784929faa9c13e3e 100644 --- a/tasks/0001_532_1532154_qa_5/task.toml +++ b/tasks/0001_532_1532154_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_532_1532619_qa_4/environment/bootstrap.sh b/tasks/0001_532_1532619_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_532_1532619_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_532_1532619_qa_4/environment/pull_bucket.py b/tasks/0001_532_1532619_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_532_1532619_qa_4/environment/pull_bucket.py +++ b/tasks/0001_532_1532619_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_532_1532619_qa_4/task.toml b/tasks/0001_532_1532619_qa_4/task.toml index 75161ae10edc51496a1295b29ef38cb373a96dcc..c414b0f6f715f2704508db5b2a66c1f3092b22ed 100644 --- a/tasks/0001_532_1532619_qa_4/task.toml +++ b/tasks/0001_532_1532619_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_532_1532619_qa_5/environment/bootstrap.sh b/tasks/0001_532_1532619_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_532_1532619_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_532_1532619_qa_5/environment/pull_bucket.py b/tasks/0001_532_1532619_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_532_1532619_qa_5/environment/pull_bucket.py +++ b/tasks/0001_532_1532619_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_532_1532619_qa_5/task.toml b/tasks/0001_532_1532619_qa_5/task.toml index 23f11bc85696d6b7c1658b2e7312731df1f2a11b..e73797d9f1aa94e12c17586b65bc316ff42d1172 100644 --- a/tasks/0001_532_1532619_qa_5/task.toml +++ b/tasks/0001_532_1532619_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_533_1533644_qa_1/environment/bootstrap.sh b/tasks/0001_533_1533644_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_533_1533644_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_533_1533644_qa_1/environment/pull_bucket.py b/tasks/0001_533_1533644_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_533_1533644_qa_1/environment/pull_bucket.py +++ b/tasks/0001_533_1533644_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_533_1533644_qa_1/task.toml b/tasks/0001_533_1533644_qa_1/task.toml index 22d28aa7cb3620e21d504bd80a5d125e7e427d1a..9aa985abc8cbb225c39bf9ad0450b5ea4c0a8917 100644 --- a/tasks/0001_533_1533644_qa_1/task.toml +++ b/tasks/0001_533_1533644_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_538_1538781_qa_4/environment/bootstrap.sh b/tasks/0001_538_1538781_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_538_1538781_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_538_1538781_qa_4/environment/pull_bucket.py b/tasks/0001_538_1538781_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_538_1538781_qa_4/environment/pull_bucket.py +++ b/tasks/0001_538_1538781_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_538_1538781_qa_4/task.toml b/tasks/0001_538_1538781_qa_4/task.toml index eff03cab6c72694a5593507b57044fd08e00db83..23df36eeb4a019cc940d89aa7fb439abc351d89d 100644 --- a/tasks/0001_538_1538781_qa_4/task.toml +++ b/tasks/0001_538_1538781_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_540_1540077_qa_4/environment/bootstrap.sh b/tasks/0001_540_1540077_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_540_1540077_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_540_1540077_qa_4/environment/pull_bucket.py b/tasks/0001_540_1540077_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_540_1540077_qa_4/environment/pull_bucket.py +++ b/tasks/0001_540_1540077_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_540_1540077_qa_4/task.toml b/tasks/0001_540_1540077_qa_4/task.toml index 9b0c765206555184d15f8019330f799c73aa2976..854308d9b9ff01c319adac751b7697c156eafa38 100644 --- a/tasks/0001_540_1540077_qa_4/task.toml +++ b/tasks/0001_540_1540077_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_541_1541002_qa_1/environment/bootstrap.sh b/tasks/0001_541_1541002_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_541_1541002_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_541_1541002_qa_1/environment/pull_bucket.py b/tasks/0001_541_1541002_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_541_1541002_qa_1/environment/pull_bucket.py +++ b/tasks/0001_541_1541002_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_541_1541002_qa_1/task.toml b/tasks/0001_541_1541002_qa_1/task.toml index 240bb946e07bff6b804c9b7d5c4e563b58036aa4..79605a83c3025a1fbebb5a63c01b3eb75bc3ac44 100644 --- a/tasks/0001_541_1541002_qa_1/task.toml +++ b/tasks/0001_541_1541002_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_541_1541002_qa_2/environment/bootstrap.sh b/tasks/0001_541_1541002_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_541_1541002_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_541_1541002_qa_2/environment/pull_bucket.py b/tasks/0001_541_1541002_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_541_1541002_qa_2/environment/pull_bucket.py +++ b/tasks/0001_541_1541002_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_541_1541002_qa_2/task.toml b/tasks/0001_541_1541002_qa_2/task.toml index 0adbbbd935d30e9036377b19fcc9e82a314a2f09..cc44493d0a71715a65d1bfbdaa185227b218249a 100644 --- a/tasks/0001_541_1541002_qa_2/task.toml +++ b/tasks/0001_541_1541002_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_541_1541002_qa_4/environment/bootstrap.sh b/tasks/0001_541_1541002_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_541_1541002_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_541_1541002_qa_4/environment/pull_bucket.py b/tasks/0001_541_1541002_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_541_1541002_qa_4/environment/pull_bucket.py +++ b/tasks/0001_541_1541002_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_541_1541002_qa_4/task.toml b/tasks/0001_541_1541002_qa_4/task.toml index 5693b35dd44759c18eae71be2e31d2de56d1f6c9..a13a5424d1c5ef269a52ef3cbca1aab368dfe6ed 100644 --- a/tasks/0001_541_1541002_qa_4/task.toml +++ b/tasks/0001_541_1541002_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_541_1541084_qa_4/environment/bootstrap.sh b/tasks/0001_541_1541084_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_541_1541084_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_541_1541084_qa_4/environment/pull_bucket.py b/tasks/0001_541_1541084_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_541_1541084_qa_4/environment/pull_bucket.py +++ b/tasks/0001_541_1541084_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_541_1541084_qa_4/task.toml b/tasks/0001_541_1541084_qa_4/task.toml index e58efba169327c7aa5f5cde298e2d98d492b049c..a402eb327602d8e8bf181e5fc8a75f2989aeaedb 100644 --- a/tasks/0001_541_1541084_qa_4/task.toml +++ b/tasks/0001_541_1541084_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_545_1545221_qa_3/environment/bootstrap.sh b/tasks/0001_545_1545221_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_545_1545221_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_545_1545221_qa_3/environment/pull_bucket.py b/tasks/0001_545_1545221_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_545_1545221_qa_3/environment/pull_bucket.py +++ b/tasks/0001_545_1545221_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_545_1545221_qa_3/task.toml b/tasks/0001_545_1545221_qa_3/task.toml index ef458a72488a37ce70a083eb988bd8c2e1ce7b0a..917b5c0bb03cdc07d6fad5ba7efe3e45d5715b2f 100644 --- a/tasks/0001_545_1545221_qa_3/task.toml +++ b/tasks/0001_545_1545221_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_545_1545776_qa_1/environment/bootstrap.sh b/tasks/0001_545_1545776_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_545_1545776_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_545_1545776_qa_1/environment/pull_bucket.py b/tasks/0001_545_1545776_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_545_1545776_qa_1/environment/pull_bucket.py +++ b/tasks/0001_545_1545776_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_545_1545776_qa_1/task.toml b/tasks/0001_545_1545776_qa_1/task.toml index 1679471536b2880602bc94137ab509b4d9d44a67..72d72a19d37d19b4cb19df7422249faaae31652f 100644 --- a/tasks/0001_545_1545776_qa_1/task.toml +++ b/tasks/0001_545_1545776_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_548_1548830_qa_1/environment/bootstrap.sh b/tasks/0001_548_1548830_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_548_1548830_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_548_1548830_qa_1/environment/pull_bucket.py b/tasks/0001_548_1548830_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_548_1548830_qa_1/environment/pull_bucket.py +++ b/tasks/0001_548_1548830_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_548_1548830_qa_1/task.toml b/tasks/0001_548_1548830_qa_1/task.toml index 1db645e7c85d9de3acb3e89956ec36adc0a5ce4c..92a6b54a3d414c84c5e3d92feacbc285d07a9c85 100644 --- a/tasks/0001_548_1548830_qa_1/task.toml +++ b/tasks/0001_548_1548830_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_551_1551019_qa_2/environment/bootstrap.sh b/tasks/0001_551_1551019_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_551_1551019_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_551_1551019_qa_2/environment/pull_bucket.py b/tasks/0001_551_1551019_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_551_1551019_qa_2/environment/pull_bucket.py +++ b/tasks/0001_551_1551019_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_551_1551019_qa_2/task.toml b/tasks/0001_551_1551019_qa_2/task.toml index 7d919c63e8030301b1631125e18d775f02217a96..9aeefb9ecd4c7b8882f082fa64bbe3dc116c7825 100644 --- a/tasks/0001_551_1551019_qa_2/task.toml +++ b/tasks/0001_551_1551019_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_570_1570948_qa_4/environment/bootstrap.sh b/tasks/0001_570_1570948_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_570_1570948_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_570_1570948_qa_4/environment/pull_bucket.py b/tasks/0001_570_1570948_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_570_1570948_qa_4/environment/pull_bucket.py +++ b/tasks/0001_570_1570948_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_570_1570948_qa_4/task.toml b/tasks/0001_570_1570948_qa_4/task.toml index 266390b859e889db6b881b0a419c8ddb72162c94..50dc9169c13dedf9dc9a2c82bb17a5e212105992 100644 --- a/tasks/0001_570_1570948_qa_4/task.toml +++ b/tasks/0001_570_1570948_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_575_1575012_qa_4/environment/bootstrap.sh b/tasks/0001_575_1575012_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_575_1575012_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_575_1575012_qa_4/environment/pull_bucket.py b/tasks/0001_575_1575012_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_575_1575012_qa_4/environment/pull_bucket.py +++ b/tasks/0001_575_1575012_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_575_1575012_qa_4/task.toml b/tasks/0001_575_1575012_qa_4/task.toml index 89c893898743c6c991bb30e106e87e2ca4554fe9..92d53748d945ea3a4a1852480763598e8b0c9ebd 100644 --- a/tasks/0001_575_1575012_qa_4/task.toml +++ b/tasks/0001_575_1575012_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_576_1576253_qa_2/environment/bootstrap.sh b/tasks/0001_576_1576253_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_576_1576253_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_576_1576253_qa_2/environment/pull_bucket.py b/tasks/0001_576_1576253_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_576_1576253_qa_2/environment/pull_bucket.py +++ b/tasks/0001_576_1576253_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_576_1576253_qa_2/task.toml b/tasks/0001_576_1576253_qa_2/task.toml index 38aed162b26ad3079eebb1ec89d23d584b953892..711d037d6c484f23fdbce9e689ae7c5da9134b0e 100644 --- a/tasks/0001_576_1576253_qa_2/task.toml +++ b/tasks/0001_576_1576253_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_576_1576253_qa_5/environment/bootstrap.sh b/tasks/0001_576_1576253_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_576_1576253_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_576_1576253_qa_5/environment/pull_bucket.py b/tasks/0001_576_1576253_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_576_1576253_qa_5/environment/pull_bucket.py +++ b/tasks/0001_576_1576253_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_576_1576253_qa_5/task.toml b/tasks/0001_576_1576253_qa_5/task.toml index ba9d0be89673ed57284cee68a815b3b896267de8..65d5fc9b2bc22f358cc0df6dc4b9d8f4ff1919f9 100644 --- a/tasks/0001_576_1576253_qa_5/task.toml +++ b/tasks/0001_576_1576253_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_579_1579979_qa_2/environment/bootstrap.sh b/tasks/0001_579_1579979_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_579_1579979_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_579_1579979_qa_2/environment/pull_bucket.py b/tasks/0001_579_1579979_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_579_1579979_qa_2/environment/pull_bucket.py +++ b/tasks/0001_579_1579979_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_579_1579979_qa_2/task.toml b/tasks/0001_579_1579979_qa_2/task.toml index aa500c647ae2223f5184498f56eafa18b50cf90b..1fff32acbe794f85967956525aa0060a97d4fe6b 100644 --- a/tasks/0001_579_1579979_qa_2/task.toml +++ b/tasks/0001_579_1579979_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_580_1580188_qa_4/environment/bootstrap.sh b/tasks/0001_580_1580188_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_580_1580188_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_580_1580188_qa_4/environment/pull_bucket.py b/tasks/0001_580_1580188_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_580_1580188_qa_4/environment/pull_bucket.py +++ b/tasks/0001_580_1580188_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_580_1580188_qa_4/task.toml b/tasks/0001_580_1580188_qa_4/task.toml index 2d2cbffc0a221f4ea8f7a7f4c56fcbb3efa118c9..3b9936bf308065e315948ca0c6302643e77e0d04 100644 --- a/tasks/0001_580_1580188_qa_4/task.toml +++ b/tasks/0001_580_1580188_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_580_1580188_qa_5/environment/bootstrap.sh b/tasks/0001_580_1580188_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_580_1580188_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_580_1580188_qa_5/environment/pull_bucket.py b/tasks/0001_580_1580188_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_580_1580188_qa_5/environment/pull_bucket.py +++ b/tasks/0001_580_1580188_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_580_1580188_qa_5/task.toml b/tasks/0001_580_1580188_qa_5/task.toml index 384d8f7d40364379cfdce4aa9160b98ed4ef1905..449c04eb7bed74b08749a45b7c1019b42076ca6a 100644 --- a/tasks/0001_580_1580188_qa_5/task.toml +++ b/tasks/0001_580_1580188_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_580_1580621_qa_1/environment/bootstrap.sh b/tasks/0001_580_1580621_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_580_1580621_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_580_1580621_qa_1/environment/pull_bucket.py b/tasks/0001_580_1580621_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_580_1580621_qa_1/environment/pull_bucket.py +++ b/tasks/0001_580_1580621_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_580_1580621_qa_1/task.toml b/tasks/0001_580_1580621_qa_1/task.toml index 6acca915d3c0ff3623166d99cfd73903e61bb011..bd088592417a5e6e7d0f1148a7cbe2629e31268d 100644 --- a/tasks/0001_580_1580621_qa_1/task.toml +++ b/tasks/0001_580_1580621_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_580_1580621_qa_2/environment/bootstrap.sh b/tasks/0001_580_1580621_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_580_1580621_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_580_1580621_qa_2/environment/pull_bucket.py b/tasks/0001_580_1580621_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_580_1580621_qa_2/environment/pull_bucket.py +++ b/tasks/0001_580_1580621_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_580_1580621_qa_2/task.toml b/tasks/0001_580_1580621_qa_2/task.toml index d1aea6ec858e4ae824f098b8e23155daab592662..9168008f4f79c2e8117f5efd37654b6b48249c71 100644 --- a/tasks/0001_580_1580621_qa_2/task.toml +++ b/tasks/0001_580_1580621_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_580_1580621_qa_4/environment/bootstrap.sh b/tasks/0001_580_1580621_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_580_1580621_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_580_1580621_qa_4/environment/pull_bucket.py b/tasks/0001_580_1580621_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_580_1580621_qa_4/environment/pull_bucket.py +++ b/tasks/0001_580_1580621_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_580_1580621_qa_4/task.toml b/tasks/0001_580_1580621_qa_4/task.toml index 014dcbd27c9c348d044d87a7db7c95b62939a3e1..3e1366b0b98b5243dc82faf239d8fe64495d3e74 100644 --- a/tasks/0001_580_1580621_qa_4/task.toml +++ b/tasks/0001_580_1580621_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_580_1580621_qa_5/environment/bootstrap.sh b/tasks/0001_580_1580621_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_580_1580621_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_580_1580621_qa_5/environment/pull_bucket.py b/tasks/0001_580_1580621_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_580_1580621_qa_5/environment/pull_bucket.py +++ b/tasks/0001_580_1580621_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_580_1580621_qa_5/task.toml b/tasks/0001_580_1580621_qa_5/task.toml index bfd402cb6c25cd7f2fcdf93f8036d04828df96b1..4d08ec345366c30abbee02852bcd5858bf2ec598 100644 --- a/tasks/0001_580_1580621_qa_5/task.toml +++ b/tasks/0001_580_1580621_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_583_1583897_qa_3/environment/bootstrap.sh b/tasks/0001_583_1583897_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_583_1583897_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_583_1583897_qa_3/environment/pull_bucket.py b/tasks/0001_583_1583897_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_583_1583897_qa_3/environment/pull_bucket.py +++ b/tasks/0001_583_1583897_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_583_1583897_qa_3/task.toml b/tasks/0001_583_1583897_qa_3/task.toml index ed9c28d1edf48c360b2f5831b2c29ce60b18b569..cbe14c46942ca6cec3d274112e2363e508b1354c 100644 --- a/tasks/0001_583_1583897_qa_3/task.toml +++ b/tasks/0001_583_1583897_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_586_1586397_qa_2/environment/bootstrap.sh b/tasks/0001_586_1586397_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_586_1586397_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_586_1586397_qa_2/environment/pull_bucket.py b/tasks/0001_586_1586397_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_586_1586397_qa_2/environment/pull_bucket.py +++ b/tasks/0001_586_1586397_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_586_1586397_qa_2/task.toml b/tasks/0001_586_1586397_qa_2/task.toml index 8eb1f5d27e368418a3e736f2fb615d4aec6dd538..5fc56ec0c3caf27779cb9d5c1c33621f032785fa 100644 --- a/tasks/0001_586_1586397_qa_2/task.toml +++ b/tasks/0001_586_1586397_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_593_1593034_qa_5/environment/bootstrap.sh b/tasks/0001_593_1593034_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_593_1593034_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_593_1593034_qa_5/environment/pull_bucket.py b/tasks/0001_593_1593034_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_593_1593034_qa_5/environment/pull_bucket.py +++ b/tasks/0001_593_1593034_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_593_1593034_qa_5/task.toml b/tasks/0001_593_1593034_qa_5/task.toml index ecc14fffc52d2bc774a34b8d838f07895cbfd0fa..f04fd4b98e00db7bc36956151a35f3950fff26d6 100644 --- a/tasks/0001_593_1593034_qa_5/task.toml +++ b/tasks/0001_593_1593034_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_593_1593609_qa_5/environment/bootstrap.sh b/tasks/0001_593_1593609_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_593_1593609_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_593_1593609_qa_5/environment/pull_bucket.py b/tasks/0001_593_1593609_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_593_1593609_qa_5/environment/pull_bucket.py +++ b/tasks/0001_593_1593609_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_593_1593609_qa_5/task.toml b/tasks/0001_593_1593609_qa_5/task.toml index d00a9133b8b022dcdd41b6e8de4b97b0603dce35..2a9417114505a73798d82eafeb0f74bb3a7b3612 100644 --- a/tasks/0001_593_1593609_qa_5/task.toml +++ b/tasks/0001_593_1593609_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_598_1598064_qa_3/environment/bootstrap.sh b/tasks/0001_598_1598064_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_598_1598064_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_598_1598064_qa_3/environment/pull_bucket.py b/tasks/0001_598_1598064_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_598_1598064_qa_3/environment/pull_bucket.py +++ b/tasks/0001_598_1598064_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_598_1598064_qa_3/task.toml b/tasks/0001_598_1598064_qa_3/task.toml index 54d2802960dfe3c22de7a5688de7e47dd1f2cd27..c240f5fd56f99a7829a567be829012970a7d9055 100644 --- a/tasks/0001_598_1598064_qa_3/task.toml +++ b/tasks/0001_598_1598064_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_598_1598981_qa_3/environment/bootstrap.sh b/tasks/0001_598_1598981_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_598_1598981_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_598_1598981_qa_3/environment/pull_bucket.py b/tasks/0001_598_1598981_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_598_1598981_qa_3/environment/pull_bucket.py +++ b/tasks/0001_598_1598981_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_598_1598981_qa_3/task.toml b/tasks/0001_598_1598981_qa_3/task.toml index bb45c7c203ada1a65d33e836c8ba9cc0e3a69af0..9e15fe2ed70c935fd4cd22e6e717c991c98ed711 100644 --- a/tasks/0001_598_1598981_qa_3/task.toml +++ b/tasks/0001_598_1598981_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_599_1599781_qa_5/environment/bootstrap.sh b/tasks/0001_599_1599781_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_599_1599781_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_599_1599781_qa_5/environment/pull_bucket.py b/tasks/0001_599_1599781_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_599_1599781_qa_5/environment/pull_bucket.py +++ b/tasks/0001_599_1599781_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_599_1599781_qa_5/task.toml b/tasks/0001_599_1599781_qa_5/task.toml index eb36d99eac52e8d8884810d7a3500a5854cd104c..52b08ed68d6fa9bec3a2d76057c163c7edbcdc7e 100644 --- a/tasks/0001_599_1599781_qa_5/task.toml +++ b/tasks/0001_599_1599781_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_599_1599947_qa_3/environment/bootstrap.sh b/tasks/0001_599_1599947_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_599_1599947_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_599_1599947_qa_3/environment/pull_bucket.py b/tasks/0001_599_1599947_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_599_1599947_qa_3/environment/pull_bucket.py +++ b/tasks/0001_599_1599947_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_599_1599947_qa_3/task.toml b/tasks/0001_599_1599947_qa_3/task.toml index e04c608025f0eaad6287ca99e05b954d9d6fce56..2465cfb4b5b761b29d0a24eb06a3a4b9666e0b64 100644 --- a/tasks/0001_599_1599947_qa_3/task.toml +++ b/tasks/0001_599_1599947_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_604_1604140_qa_2/environment/bootstrap.sh b/tasks/0001_604_1604140_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_604_1604140_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_604_1604140_qa_2/environment/pull_bucket.py b/tasks/0001_604_1604140_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_604_1604140_qa_2/environment/pull_bucket.py +++ b/tasks/0001_604_1604140_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_604_1604140_qa_2/task.toml b/tasks/0001_604_1604140_qa_2/task.toml index 6c8fe87f3ebcb3f20f641562609072b17fae19db..2571bcb1f8afb26e2ce9adb9b794c678414a38fc 100644 --- a/tasks/0001_604_1604140_qa_2/task.toml +++ b/tasks/0001_604_1604140_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_604_1604140_qa_4/environment/bootstrap.sh b/tasks/0001_604_1604140_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_604_1604140_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_604_1604140_qa_4/environment/pull_bucket.py b/tasks/0001_604_1604140_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_604_1604140_qa_4/environment/pull_bucket.py +++ b/tasks/0001_604_1604140_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_604_1604140_qa_4/task.toml b/tasks/0001_604_1604140_qa_4/task.toml index 480fe56a3270c7bd6195e8caff85cfb8edd90c6e..c2441ba2d35d90071ed4c34d5cab271504c7383e 100644 --- a/tasks/0001_604_1604140_qa_4/task.toml +++ b/tasks/0001_604_1604140_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_604_1604140_qa_5/environment/bootstrap.sh b/tasks/0001_604_1604140_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_604_1604140_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_604_1604140_qa_5/environment/pull_bucket.py b/tasks/0001_604_1604140_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_604_1604140_qa_5/environment/pull_bucket.py +++ b/tasks/0001_604_1604140_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_604_1604140_qa_5/task.toml b/tasks/0001_604_1604140_qa_5/task.toml index 8bad300d798efa52cb6c6eadc817bdf3adc9f377..cc74d3ef366f3bb4868c52eb26223b9c92ed82f1 100644 --- a/tasks/0001_604_1604140_qa_5/task.toml +++ b/tasks/0001_604_1604140_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_623_1623388_qa_1/environment/bootstrap.sh b/tasks/0001_623_1623388_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_623_1623388_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_623_1623388_qa_1/environment/pull_bucket.py b/tasks/0001_623_1623388_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_623_1623388_qa_1/environment/pull_bucket.py +++ b/tasks/0001_623_1623388_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_623_1623388_qa_1/task.toml b/tasks/0001_623_1623388_qa_1/task.toml index 41cc0ce1ae3022a3202b8bd5d56fccea72a4eb47..82e50a7e9ec4123708aa8bdb0805ff338290c218 100644 --- a/tasks/0001_623_1623388_qa_1/task.toml +++ b/tasks/0001_623_1623388_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_623_1623388_qa_5/environment/bootstrap.sh b/tasks/0001_623_1623388_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_623_1623388_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_623_1623388_qa_5/environment/pull_bucket.py b/tasks/0001_623_1623388_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_623_1623388_qa_5/environment/pull_bucket.py +++ b/tasks/0001_623_1623388_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_623_1623388_qa_5/task.toml b/tasks/0001_623_1623388_qa_5/task.toml index 38ea7d4593980f30376df07948e66c9cb429b130..b36a06bfd420617d7160a4d973cbe8c5644a39da 100644 --- a/tasks/0001_623_1623388_qa_5/task.toml +++ b/tasks/0001_623_1623388_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_628_1628992_qa_4/environment/bootstrap.sh b/tasks/0001_628_1628992_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_628_1628992_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_628_1628992_qa_4/environment/pull_bucket.py b/tasks/0001_628_1628992_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_628_1628992_qa_4/environment/pull_bucket.py +++ b/tasks/0001_628_1628992_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_628_1628992_qa_4/task.toml b/tasks/0001_628_1628992_qa_4/task.toml index 05727028d6cef176cd17bd206117b37de47f6b01..41763207697695e2db11f892eaa1c9c3f2918046 100644 --- a/tasks/0001_628_1628992_qa_4/task.toml +++ b/tasks/0001_628_1628992_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_632_1632608_qa_2/environment/bootstrap.sh b/tasks/0001_632_1632608_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_632_1632608_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_632_1632608_qa_2/environment/pull_bucket.py b/tasks/0001_632_1632608_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_632_1632608_qa_2/environment/pull_bucket.py +++ b/tasks/0001_632_1632608_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_632_1632608_qa_2/task.toml b/tasks/0001_632_1632608_qa_2/task.toml index eec02b6d3cd34339829fd17aa1dab325ed2a1128..a0e72005f3a8002334eabbc0ae927bb2a4fd4a7d 100644 --- a/tasks/0001_632_1632608_qa_2/task.toml +++ b/tasks/0001_632_1632608_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_633_1633600_qa_1/environment/bootstrap.sh b/tasks/0001_633_1633600_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_633_1633600_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_633_1633600_qa_1/environment/pull_bucket.py b/tasks/0001_633_1633600_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_633_1633600_qa_1/environment/pull_bucket.py +++ b/tasks/0001_633_1633600_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_633_1633600_qa_1/task.toml b/tasks/0001_633_1633600_qa_1/task.toml index 8159ab4fcd24c31b1d6fa0da191d30cb5bd7c57a..66b236235f01320aaec7dd5b623625f490f3b2d7 100644 --- a/tasks/0001_633_1633600_qa_1/task.toml +++ b/tasks/0001_633_1633600_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_633_1633600_qa_4/environment/bootstrap.sh b/tasks/0001_633_1633600_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_633_1633600_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_633_1633600_qa_4/environment/pull_bucket.py b/tasks/0001_633_1633600_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_633_1633600_qa_4/environment/pull_bucket.py +++ b/tasks/0001_633_1633600_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_633_1633600_qa_4/task.toml b/tasks/0001_633_1633600_qa_4/task.toml index 34df60bda6604399270639562a1155570d4ddb1d..43491a78c347db8a30c5668dd5f0ab5580616b70 100644 --- a/tasks/0001_633_1633600_qa_4/task.toml +++ b/tasks/0001_633_1633600_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_636_1636611_qa_2/environment/bootstrap.sh b/tasks/0001_636_1636611_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_636_1636611_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_636_1636611_qa_2/environment/pull_bucket.py b/tasks/0001_636_1636611_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_636_1636611_qa_2/environment/pull_bucket.py +++ b/tasks/0001_636_1636611_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_636_1636611_qa_2/task.toml b/tasks/0001_636_1636611_qa_2/task.toml index 1f8b5a048e1956a2c44a8ae0dd33f12c603a636f..b4921edfb884025cf3e5cfbc5ca7782a3fc0e773 100644 --- a/tasks/0001_636_1636611_qa_2/task.toml +++ b/tasks/0001_636_1636611_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_637_1637985_qa_3/environment/bootstrap.sh b/tasks/0001_637_1637985_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_637_1637985_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_637_1637985_qa_3/environment/pull_bucket.py b/tasks/0001_637_1637985_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_637_1637985_qa_3/environment/pull_bucket.py +++ b/tasks/0001_637_1637985_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_637_1637985_qa_3/task.toml b/tasks/0001_637_1637985_qa_3/task.toml index 41ff9587a2dd39af2f2e97698b000aa68a43a224..a1b52fd807356cfce882e106cb1587e0a66ee3b3 100644 --- a/tasks/0001_637_1637985_qa_3/task.toml +++ b/tasks/0001_637_1637985_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_638_1638617_qa_4/environment/bootstrap.sh b/tasks/0001_638_1638617_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_638_1638617_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_638_1638617_qa_4/environment/pull_bucket.py b/tasks/0001_638_1638617_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_638_1638617_qa_4/environment/pull_bucket.py +++ b/tasks/0001_638_1638617_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_638_1638617_qa_4/task.toml b/tasks/0001_638_1638617_qa_4/task.toml index 5ee40cd5bdc7eefa9dd16ce8c603c719f79d3cfd..c78299f729213e069b5b726823b0d060f62e6246 100644 --- a/tasks/0001_638_1638617_qa_4/task.toml +++ b/tasks/0001_638_1638617_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_645_1645214_qa_2/environment/bootstrap.sh b/tasks/0001_645_1645214_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_645_1645214_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_645_1645214_qa_2/environment/pull_bucket.py b/tasks/0001_645_1645214_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_645_1645214_qa_2/environment/pull_bucket.py +++ b/tasks/0001_645_1645214_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_645_1645214_qa_2/task.toml b/tasks/0001_645_1645214_qa_2/task.toml index 9929e05fbe64f54a33349ca708b7eadaa7d44b7e..cf864811820f233936574021129251977cbcc05c 100644 --- a/tasks/0001_645_1645214_qa_2/task.toml +++ b/tasks/0001_645_1645214_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_646_1646297_qa_2/environment/bootstrap.sh b/tasks/0001_646_1646297_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_646_1646297_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_646_1646297_qa_2/environment/pull_bucket.py b/tasks/0001_646_1646297_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_646_1646297_qa_2/environment/pull_bucket.py +++ b/tasks/0001_646_1646297_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_646_1646297_qa_2/task.toml b/tasks/0001_646_1646297_qa_2/task.toml index 786619edeabb1b6e2148111a50d1190581e07a11..24a6719b98c4fab50fe03f460e411f7b37998845 100644 --- a/tasks/0001_646_1646297_qa_2/task.toml +++ b/tasks/0001_646_1646297_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_656_1656907_qa_2/environment/bootstrap.sh b/tasks/0001_656_1656907_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_656_1656907_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_656_1656907_qa_2/environment/pull_bucket.py b/tasks/0001_656_1656907_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_656_1656907_qa_2/environment/pull_bucket.py +++ b/tasks/0001_656_1656907_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_656_1656907_qa_2/task.toml b/tasks/0001_656_1656907_qa_2/task.toml index 521a19349997a9996a9e41da88cbc9f5ae528f99..05cfba774f26e80dd519d431056253bd5d18ee96 100644 --- a/tasks/0001_656_1656907_qa_2/task.toml +++ b/tasks/0001_656_1656907_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_656_1656907_qa_4/environment/bootstrap.sh b/tasks/0001_656_1656907_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_656_1656907_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_656_1656907_qa_4/environment/pull_bucket.py b/tasks/0001_656_1656907_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_656_1656907_qa_4/environment/pull_bucket.py +++ b/tasks/0001_656_1656907_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_656_1656907_qa_4/task.toml b/tasks/0001_656_1656907_qa_4/task.toml index bccba35fb99bb0cee197f838904f485f35f59d57..28812e3287eaeac9751813b411b1e2bde8ceb927 100644 --- a/tasks/0001_656_1656907_qa_4/task.toml +++ b/tasks/0001_656_1656907_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_656_1656907_qa_5/environment/bootstrap.sh b/tasks/0001_656_1656907_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_656_1656907_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_656_1656907_qa_5/environment/pull_bucket.py b/tasks/0001_656_1656907_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_656_1656907_qa_5/environment/pull_bucket.py +++ b/tasks/0001_656_1656907_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_656_1656907_qa_5/task.toml b/tasks/0001_656_1656907_qa_5/task.toml index fc8c075960ed763e0735da7377b3f7dfafc0b961..3781999436f788031a9ad83d8c479b051d09fd2c 100644 --- a/tasks/0001_656_1656907_qa_5/task.toml +++ b/tasks/0001_656_1656907_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_657_1657214_qa_3/environment/bootstrap.sh b/tasks/0001_657_1657214_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_657_1657214_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_657_1657214_qa_3/environment/pull_bucket.py b/tasks/0001_657_1657214_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_657_1657214_qa_3/environment/pull_bucket.py +++ b/tasks/0001_657_1657214_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_657_1657214_qa_3/task.toml b/tasks/0001_657_1657214_qa_3/task.toml index 92897b82f6b9c4502dbd9f991ab6ecb7dd998fae..073825d5d13506d77e849652cc25183b42996684 100644 --- a/tasks/0001_657_1657214_qa_3/task.toml +++ b/tasks/0001_657_1657214_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_659_1659062_qa_3/environment/bootstrap.sh b/tasks/0001_659_1659062_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_659_1659062_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_659_1659062_qa_3/environment/pull_bucket.py b/tasks/0001_659_1659062_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_659_1659062_qa_3/environment/pull_bucket.py +++ b/tasks/0001_659_1659062_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_659_1659062_qa_3/task.toml b/tasks/0001_659_1659062_qa_3/task.toml index bba7558bbe6fc8923efbce57e32c36f8fdb073f2..d6cfe2063fa5de70dcbdbff80355b7de5cee7295 100644 --- a/tasks/0001_659_1659062_qa_3/task.toml +++ b/tasks/0001_659_1659062_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_659_1659621_qa_3/environment/bootstrap.sh b/tasks/0001_659_1659621_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_659_1659621_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_659_1659621_qa_3/environment/pull_bucket.py b/tasks/0001_659_1659621_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_659_1659621_qa_3/environment/pull_bucket.py +++ b/tasks/0001_659_1659621_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_659_1659621_qa_3/task.toml b/tasks/0001_659_1659621_qa_3/task.toml index f6a16dc971becd85645c10414022a83a3a2a6517..a0f809f73d11b0be41a3de6a59db5f2c9e634b0f 100644 --- a/tasks/0001_659_1659621_qa_3/task.toml +++ b/tasks/0001_659_1659621_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_660_1660748_qa_2/environment/bootstrap.sh b/tasks/0001_660_1660748_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_660_1660748_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_660_1660748_qa_2/environment/pull_bucket.py b/tasks/0001_660_1660748_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_660_1660748_qa_2/environment/pull_bucket.py +++ b/tasks/0001_660_1660748_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_660_1660748_qa_2/task.toml b/tasks/0001_660_1660748_qa_2/task.toml index fc4ee41c62a4ef2e55d0087898e9ea3e91495fc9..ca9bf2188e70f7e5ae6fe066b67bad7af92255fc 100644 --- a/tasks/0001_660_1660748_qa_2/task.toml +++ b/tasks/0001_660_1660748_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_660_1660748_qa_4/environment/bootstrap.sh b/tasks/0001_660_1660748_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_660_1660748_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_660_1660748_qa_4/environment/pull_bucket.py b/tasks/0001_660_1660748_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_660_1660748_qa_4/environment/pull_bucket.py +++ b/tasks/0001_660_1660748_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_660_1660748_qa_4/task.toml b/tasks/0001_660_1660748_qa_4/task.toml index 6421c90a48e9a480e2fc50c6c315a346841b8de9..2b983dd2d19c0ae4f671d7b24c9dcf8cdb5833ee 100644 --- a/tasks/0001_660_1660748_qa_4/task.toml +++ b/tasks/0001_660_1660748_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_660_1660748_qa_5/environment/bootstrap.sh b/tasks/0001_660_1660748_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_660_1660748_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_660_1660748_qa_5/environment/pull_bucket.py b/tasks/0001_660_1660748_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_660_1660748_qa_5/environment/pull_bucket.py +++ b/tasks/0001_660_1660748_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_660_1660748_qa_5/task.toml b/tasks/0001_660_1660748_qa_5/task.toml index ffb5f46df55356c720803dc5810d9cd7661956d8..8a24e00d459c6e3877a224e5c21a84b8ee9e7193 100644 --- a/tasks/0001_660_1660748_qa_5/task.toml +++ b/tasks/0001_660_1660748_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_661_1661005_qa_1/environment/bootstrap.sh b/tasks/0001_661_1661005_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_661_1661005_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_661_1661005_qa_1/environment/pull_bucket.py b/tasks/0001_661_1661005_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_661_1661005_qa_1/environment/pull_bucket.py +++ b/tasks/0001_661_1661005_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_661_1661005_qa_1/task.toml b/tasks/0001_661_1661005_qa_1/task.toml index 85a33ead342a02a1c9787a202a9401c617147273..15024f4eb32c8aa6a28620a5338a9ebd943372c3 100644 --- a/tasks/0001_661_1661005_qa_1/task.toml +++ b/tasks/0001_661_1661005_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_661_1661005_qa_3/environment/bootstrap.sh b/tasks/0001_661_1661005_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_661_1661005_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_661_1661005_qa_3/environment/pull_bucket.py b/tasks/0001_661_1661005_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_661_1661005_qa_3/environment/pull_bucket.py +++ b/tasks/0001_661_1661005_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_661_1661005_qa_3/task.toml b/tasks/0001_661_1661005_qa_3/task.toml index 49aba5bfc409b36892660c505f783acbac53fd8f..d47d8d4789ee111f1cbd80bddfb68906812d6355 100644 --- a/tasks/0001_661_1661005_qa_3/task.toml +++ b/tasks/0001_661_1661005_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_662_1662961_qa_3/environment/bootstrap.sh b/tasks/0001_662_1662961_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_662_1662961_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_662_1662961_qa_3/environment/pull_bucket.py b/tasks/0001_662_1662961_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_662_1662961_qa_3/environment/pull_bucket.py +++ b/tasks/0001_662_1662961_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_662_1662961_qa_3/task.toml b/tasks/0001_662_1662961_qa_3/task.toml index baab33b039619c6bf9d1c22b34135353004638bb..5ababb24a4430b028adf19e39640dc1396c2116f 100644 --- a/tasks/0001_662_1662961_qa_3/task.toml +++ b/tasks/0001_662_1662961_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_662_1662961_qa_5/environment/bootstrap.sh b/tasks/0001_662_1662961_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_662_1662961_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_662_1662961_qa_5/environment/pull_bucket.py b/tasks/0001_662_1662961_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_662_1662961_qa_5/environment/pull_bucket.py +++ b/tasks/0001_662_1662961_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_662_1662961_qa_5/task.toml b/tasks/0001_662_1662961_qa_5/task.toml index 9f373dfdb211e815cb39fd5249143cbc539ebf23..27a3ad398da98b90d5b472523a28ada30097ca32 100644 --- a/tasks/0001_662_1662961_qa_5/task.toml +++ b/tasks/0001_662_1662961_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_664_1664478_qa_1/environment/bootstrap.sh b/tasks/0001_664_1664478_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_664_1664478_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_664_1664478_qa_1/environment/pull_bucket.py b/tasks/0001_664_1664478_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_664_1664478_qa_1/environment/pull_bucket.py +++ b/tasks/0001_664_1664478_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_664_1664478_qa_1/task.toml b/tasks/0001_664_1664478_qa_1/task.toml index c71ef4da8bcf44a9623bc37f4186cca7f072b304..052d458d986f6ea12abe50af4d3cdf0007967cb7 100644 --- a/tasks/0001_664_1664478_qa_1/task.toml +++ b/tasks/0001_664_1664478_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_666_1666101_qa_5/environment/bootstrap.sh b/tasks/0001_666_1666101_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_666_1666101_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_666_1666101_qa_5/environment/pull_bucket.py b/tasks/0001_666_1666101_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_666_1666101_qa_5/environment/pull_bucket.py +++ b/tasks/0001_666_1666101_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_666_1666101_qa_5/task.toml b/tasks/0001_666_1666101_qa_5/task.toml index 5bd20ecfab461597a493b69d13b3a8e055a3d1d2..12e51860cf4fe6cb4ac6696f6e18f483f8918762 100644 --- a/tasks/0001_666_1666101_qa_5/task.toml +++ b/tasks/0001_666_1666101_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_667_1667317_qa_1/environment/bootstrap.sh b/tasks/0001_667_1667317_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_667_1667317_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_667_1667317_qa_1/environment/pull_bucket.py b/tasks/0001_667_1667317_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_667_1667317_qa_1/environment/pull_bucket.py +++ b/tasks/0001_667_1667317_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_667_1667317_qa_1/task.toml b/tasks/0001_667_1667317_qa_1/task.toml index 7846d9e5702607d6638294ab010a69cb06421155..47b24a018098cb0da2c7c1d1460d3f49ab984cf7 100644 --- a/tasks/0001_667_1667317_qa_1/task.toml +++ b/tasks/0001_667_1667317_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_667_1667317_qa_4/environment/bootstrap.sh b/tasks/0001_667_1667317_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_667_1667317_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_667_1667317_qa_4/environment/pull_bucket.py b/tasks/0001_667_1667317_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_667_1667317_qa_4/environment/pull_bucket.py +++ b/tasks/0001_667_1667317_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_667_1667317_qa_4/task.toml b/tasks/0001_667_1667317_qa_4/task.toml index e2de8fb94c49d4b08d5dacb7b3a694a679732809..21edca67aefb2a748d9135a58627b510c586256f 100644 --- a/tasks/0001_667_1667317_qa_4/task.toml +++ b/tasks/0001_667_1667317_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_667_1667317_qa_5/environment/bootstrap.sh b/tasks/0001_667_1667317_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_667_1667317_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_667_1667317_qa_5/environment/pull_bucket.py b/tasks/0001_667_1667317_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_667_1667317_qa_5/environment/pull_bucket.py +++ b/tasks/0001_667_1667317_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_667_1667317_qa_5/task.toml b/tasks/0001_667_1667317_qa_5/task.toml index 7f0c50e79f11e29bfd0685117ad71df08a9cb49a..931f17af2a9421e97bc8fbd083470ad50fcf3e23 100644 --- a/tasks/0001_667_1667317_qa_5/task.toml +++ b/tasks/0001_667_1667317_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_668_1668567_qa_3/environment/bootstrap.sh b/tasks/0001_668_1668567_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_668_1668567_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_668_1668567_qa_3/environment/pull_bucket.py b/tasks/0001_668_1668567_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_668_1668567_qa_3/environment/pull_bucket.py +++ b/tasks/0001_668_1668567_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_668_1668567_qa_3/task.toml b/tasks/0001_668_1668567_qa_3/task.toml index 4e10c688a0f6739b298091a0eb529c08ceb0bac2..261d388c79977a6eefc891c1084ae6a95a8ebae8 100644 --- a/tasks/0001_668_1668567_qa_3/task.toml +++ b/tasks/0001_668_1668567_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_672_1672543_qa_1/environment/bootstrap.sh b/tasks/0001_672_1672543_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_672_1672543_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_672_1672543_qa_1/environment/pull_bucket.py b/tasks/0001_672_1672543_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_672_1672543_qa_1/environment/pull_bucket.py +++ b/tasks/0001_672_1672543_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_672_1672543_qa_1/task.toml b/tasks/0001_672_1672543_qa_1/task.toml index bcb2ab1ec4a2010e05b5522b3f1a1eac62dff09a..0a5eec4007b218e9e3e150d81f6a17dfc07b45f1 100644 --- a/tasks/0001_672_1672543_qa_1/task.toml +++ b/tasks/0001_672_1672543_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_672_1672543_qa_3/environment/bootstrap.sh b/tasks/0001_672_1672543_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_672_1672543_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_672_1672543_qa_3/environment/pull_bucket.py b/tasks/0001_672_1672543_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_672_1672543_qa_3/environment/pull_bucket.py +++ b/tasks/0001_672_1672543_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_672_1672543_qa_3/task.toml b/tasks/0001_672_1672543_qa_3/task.toml index 724ca43af11f6f46227d132a37a70c7d8e334750..06b60f3f8235fedd76c28d27dc17b172f6001c13 100644 --- a/tasks/0001_672_1672543_qa_3/task.toml +++ b/tasks/0001_672_1672543_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_673_1673862_qa_4/environment/bootstrap.sh b/tasks/0001_673_1673862_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_673_1673862_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_673_1673862_qa_4/environment/pull_bucket.py b/tasks/0001_673_1673862_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_673_1673862_qa_4/environment/pull_bucket.py +++ b/tasks/0001_673_1673862_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_673_1673862_qa_4/task.toml b/tasks/0001_673_1673862_qa_4/task.toml index e08cfe6344ad5f77808d3a80f74b03bc9ab26a94..52d3e0be108113c2e731925953064baee4ed5f15 100644 --- a/tasks/0001_673_1673862_qa_4/task.toml +++ b/tasks/0001_673_1673862_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_674_1674081_qa_1/environment/bootstrap.sh b/tasks/0001_674_1674081_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_674_1674081_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_674_1674081_qa_1/environment/pull_bucket.py b/tasks/0001_674_1674081_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_674_1674081_qa_1/environment/pull_bucket.py +++ b/tasks/0001_674_1674081_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_674_1674081_qa_1/task.toml b/tasks/0001_674_1674081_qa_1/task.toml index 940aed267f1c22320dce99d3eb676039b7967b6b..3061fc1628a2c53e2f86b0b9528306e3a590e845 100644 --- a/tasks/0001_674_1674081_qa_1/task.toml +++ b/tasks/0001_674_1674081_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_683_1683631_qa_1/environment/bootstrap.sh b/tasks/0001_683_1683631_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_683_1683631_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_683_1683631_qa_1/environment/pull_bucket.py b/tasks/0001_683_1683631_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_683_1683631_qa_1/environment/pull_bucket.py +++ b/tasks/0001_683_1683631_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_683_1683631_qa_1/task.toml b/tasks/0001_683_1683631_qa_1/task.toml index 1c45227c690436271fce9f449a0cefcfd988415d..4db33571c25a540910b82a9a2364c55da0c06fdd 100644 --- a/tasks/0001_683_1683631_qa_1/task.toml +++ b/tasks/0001_683_1683631_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_683_1683832_qa_2/environment/bootstrap.sh b/tasks/0001_683_1683832_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_683_1683832_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_683_1683832_qa_2/environment/pull_bucket.py b/tasks/0001_683_1683832_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_683_1683832_qa_2/environment/pull_bucket.py +++ b/tasks/0001_683_1683832_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_683_1683832_qa_2/task.toml b/tasks/0001_683_1683832_qa_2/task.toml index 645b7527af7fa3e4eba5586a460632a9ac233ffa..6532fd13a32c89a0565752e7ab7ea4e4ddcaab3b 100644 --- a/tasks/0001_683_1683832_qa_2/task.toml +++ b/tasks/0001_683_1683832_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_690_1690621_qa_2/environment/bootstrap.sh b/tasks/0001_690_1690621_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_690_1690621_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_690_1690621_qa_2/environment/pull_bucket.py b/tasks/0001_690_1690621_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_690_1690621_qa_2/environment/pull_bucket.py +++ b/tasks/0001_690_1690621_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_690_1690621_qa_2/task.toml b/tasks/0001_690_1690621_qa_2/task.toml index f85df6021d9cc261ee7de214a07d0b94e02077e1..66170a606d6204a30399462f6800b8284ca82799 100644 --- a/tasks/0001_690_1690621_qa_2/task.toml +++ b/tasks/0001_690_1690621_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_690_1690622_qa_2/environment/bootstrap.sh b/tasks/0001_690_1690622_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_690_1690622_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_690_1690622_qa_2/environment/pull_bucket.py b/tasks/0001_690_1690622_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_690_1690622_qa_2/environment/pull_bucket.py +++ b/tasks/0001_690_1690622_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_690_1690622_qa_2/task.toml b/tasks/0001_690_1690622_qa_2/task.toml index 2f520a6b8cc9bd1a9631a316a83c491c91675327..aea3c8833a2d7614403ec6f1056ae470522dca31 100644 --- a/tasks/0001_690_1690622_qa_2/task.toml +++ b/tasks/0001_690_1690622_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_690_1690622_qa_4/environment/bootstrap.sh b/tasks/0001_690_1690622_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_690_1690622_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_690_1690622_qa_4/environment/pull_bucket.py b/tasks/0001_690_1690622_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_690_1690622_qa_4/environment/pull_bucket.py +++ b/tasks/0001_690_1690622_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_690_1690622_qa_4/task.toml b/tasks/0001_690_1690622_qa_4/task.toml index d8172ef026d9b5da1dca52b34f7b957857fdb78c..ad79cc741be383965806340d37c63ca963fcabd1 100644 --- a/tasks/0001_690_1690622_qa_4/task.toml +++ b/tasks/0001_690_1690622_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_690_1690622_qa_5/environment/bootstrap.sh b/tasks/0001_690_1690622_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_690_1690622_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_690_1690622_qa_5/environment/pull_bucket.py b/tasks/0001_690_1690622_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_690_1690622_qa_5/environment/pull_bucket.py +++ b/tasks/0001_690_1690622_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_690_1690622_qa_5/task.toml b/tasks/0001_690_1690622_qa_5/task.toml index 6e5c2754716962ad89f7377178a09988a23119f9..fec1fce7f0a19cb5c604d38bf2f81b32257a25dc 100644 --- a/tasks/0001_690_1690622_qa_5/task.toml +++ b/tasks/0001_690_1690622_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_690_1690859_qa_5/environment/bootstrap.sh b/tasks/0001_690_1690859_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_690_1690859_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_690_1690859_qa_5/environment/pull_bucket.py b/tasks/0001_690_1690859_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_690_1690859_qa_5/environment/pull_bucket.py +++ b/tasks/0001_690_1690859_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_690_1690859_qa_5/task.toml b/tasks/0001_690_1690859_qa_5/task.toml index 965dfca43f15dae3f9c9df89abce19b609f9fe3a..4a0304d15699743970bf5d0dd3ed630776e09788 100644 --- a/tasks/0001_690_1690859_qa_5/task.toml +++ b/tasks/0001_690_1690859_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_692_1692435_qa_3/environment/bootstrap.sh b/tasks/0001_692_1692435_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_692_1692435_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_692_1692435_qa_3/environment/pull_bucket.py b/tasks/0001_692_1692435_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_692_1692435_qa_3/environment/pull_bucket.py +++ b/tasks/0001_692_1692435_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_692_1692435_qa_3/task.toml b/tasks/0001_692_1692435_qa_3/task.toml index 461a158d25c85b0d83ba194af64e48d322d67658..10f5a2dea061984c4c3ab58e351faaa8f46c85c3 100644 --- a/tasks/0001_692_1692435_qa_3/task.toml +++ b/tasks/0001_692_1692435_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_692_1692435_qa_4/environment/bootstrap.sh b/tasks/0001_692_1692435_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_692_1692435_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_692_1692435_qa_4/environment/pull_bucket.py b/tasks/0001_692_1692435_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_692_1692435_qa_4/environment/pull_bucket.py +++ b/tasks/0001_692_1692435_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_692_1692435_qa_4/task.toml b/tasks/0001_692_1692435_qa_4/task.toml index 5bb885b368c76e31e5e2158e0e6a89e12307b1eb..28d2522d2f37a5cc58eb8bf80b5854418d117786 100644 --- a/tasks/0001_692_1692435_qa_4/task.toml +++ b/tasks/0001_692_1692435_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_692_1692435_qa_5/environment/bootstrap.sh b/tasks/0001_692_1692435_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_692_1692435_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_692_1692435_qa_5/environment/pull_bucket.py b/tasks/0001_692_1692435_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_692_1692435_qa_5/environment/pull_bucket.py +++ b/tasks/0001_692_1692435_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_692_1692435_qa_5/task.toml b/tasks/0001_692_1692435_qa_5/task.toml index bf3cfc7f96d003217033ce1d4ae7a9628cc7f59d..786201f92bc3d81e931110a29f02a01a75f30f9a 100644 --- a/tasks/0001_692_1692435_qa_5/task.toml +++ b/tasks/0001_692_1692435_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_699_1699079_qa_1/environment/bootstrap.sh b/tasks/0001_699_1699079_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_699_1699079_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_699_1699079_qa_1/environment/pull_bucket.py b/tasks/0001_699_1699079_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_699_1699079_qa_1/environment/pull_bucket.py +++ b/tasks/0001_699_1699079_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_699_1699079_qa_1/task.toml b/tasks/0001_699_1699079_qa_1/task.toml index 5540d15a89f43635651005cae059a87b81230c39..c51f72da11c3787d1085fed5eac260c8377ceab8 100644 --- a/tasks/0001_699_1699079_qa_1/task.toml +++ b/tasks/0001_699_1699079_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_725_1725548_qa_1/environment/bootstrap.sh b/tasks/0001_725_1725548_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_725_1725548_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_725_1725548_qa_1/environment/pull_bucket.py b/tasks/0001_725_1725548_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_725_1725548_qa_1/environment/pull_bucket.py +++ b/tasks/0001_725_1725548_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_725_1725548_qa_1/task.toml b/tasks/0001_725_1725548_qa_1/task.toml index 6f88913e72b2218dbd4386ac85c9f2533a7feebb..64b105fa7d95ff1b490aa9f3d12ad73cbb50495d 100644 --- a/tasks/0001_725_1725548_qa_1/task.toml +++ b/tasks/0001_725_1725548_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_725_1725695_qa_5/environment/bootstrap.sh b/tasks/0001_725_1725695_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_725_1725695_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_725_1725695_qa_5/environment/pull_bucket.py b/tasks/0001_725_1725695_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_725_1725695_qa_5/environment/pull_bucket.py +++ b/tasks/0001_725_1725695_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_725_1725695_qa_5/task.toml b/tasks/0001_725_1725695_qa_5/task.toml index d73e7972f1a67c6d7e070e2c5d2ae49c981f7411..09f039bf37d43f8f475872e3fbbf844dcdd7edcb 100644 --- a/tasks/0001_725_1725695_qa_5/task.toml +++ b/tasks/0001_725_1725695_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_733_1733851_qa_3/environment/bootstrap.sh b/tasks/0001_733_1733851_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_733_1733851_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_733_1733851_qa_3/environment/pull_bucket.py b/tasks/0001_733_1733851_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_733_1733851_qa_3/environment/pull_bucket.py +++ b/tasks/0001_733_1733851_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_733_1733851_qa_3/task.toml b/tasks/0001_733_1733851_qa_3/task.toml index 1f33cfe0246e15451bd09fe6238069b60695fe8b..ee2ac23bfe7f0b4a571a11ee7b5fb324f9e4e9dd 100644 --- a/tasks/0001_733_1733851_qa_3/task.toml +++ b/tasks/0001_733_1733851_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_733_1733851_qa_5/environment/bootstrap.sh b/tasks/0001_733_1733851_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_733_1733851_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_733_1733851_qa_5/environment/pull_bucket.py b/tasks/0001_733_1733851_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_733_1733851_qa_5/environment/pull_bucket.py +++ b/tasks/0001_733_1733851_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_733_1733851_qa_5/task.toml b/tasks/0001_733_1733851_qa_5/task.toml index 16bf0c5f584d950327eba43f7717753692db2397..1830aa9f68b18bb46c23eb160fba6bfe65afb531 100644 --- a/tasks/0001_733_1733851_qa_5/task.toml +++ b/tasks/0001_733_1733851_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_735_1735855_qa_1/environment/bootstrap.sh b/tasks/0001_735_1735855_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_735_1735855_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_735_1735855_qa_1/environment/pull_bucket.py b/tasks/0001_735_1735855_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_735_1735855_qa_1/environment/pull_bucket.py +++ b/tasks/0001_735_1735855_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_735_1735855_qa_1/task.toml b/tasks/0001_735_1735855_qa_1/task.toml index e55c11cf54c9e447ee51d3efd9c12f4a3d52445e..ae68464e22359f8f4af6330e73ea498b191b1912 100644 --- a/tasks/0001_735_1735855_qa_1/task.toml +++ b/tasks/0001_735_1735855_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_735_1735855_qa_3/environment/bootstrap.sh b/tasks/0001_735_1735855_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_735_1735855_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_735_1735855_qa_3/environment/pull_bucket.py b/tasks/0001_735_1735855_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_735_1735855_qa_3/environment/pull_bucket.py +++ b/tasks/0001_735_1735855_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_735_1735855_qa_3/task.toml b/tasks/0001_735_1735855_qa_3/task.toml index bafb46f36a7fb1b6239dee2c2309660c4b3158b3..0e1e411e3cb4209ba4b538c4d93c4f9e8d30ec8d 100644 --- a/tasks/0001_735_1735855_qa_3/task.toml +++ b/tasks/0001_735_1735855_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_735_1735855_qa_5/environment/bootstrap.sh b/tasks/0001_735_1735855_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_735_1735855_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_735_1735855_qa_5/environment/pull_bucket.py b/tasks/0001_735_1735855_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_735_1735855_qa_5/environment/pull_bucket.py +++ b/tasks/0001_735_1735855_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_735_1735855_qa_5/task.toml b/tasks/0001_735_1735855_qa_5/task.toml index 504493d2d9045d7e2da48fe3f073a50d47f0bbff..8cf408724d186644bc54ae39534855e7a819727e 100644 --- a/tasks/0001_735_1735855_qa_5/task.toml +++ b/tasks/0001_735_1735855_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_736_1736876_qa_4/environment/bootstrap.sh b/tasks/0001_736_1736876_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_736_1736876_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_736_1736876_qa_4/environment/pull_bucket.py b/tasks/0001_736_1736876_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_736_1736876_qa_4/environment/pull_bucket.py +++ b/tasks/0001_736_1736876_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_736_1736876_qa_4/task.toml b/tasks/0001_736_1736876_qa_4/task.toml index f0acc6ba2c13253653c214023631bb8310b8cc0c..8b7158d5d2d58d8aedb39b392508c9391d8da0d1 100644 --- a/tasks/0001_736_1736876_qa_4/task.toml +++ b/tasks/0001_736_1736876_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_737_1737901_qa_1/environment/bootstrap.sh b/tasks/0001_737_1737901_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_737_1737901_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_737_1737901_qa_1/environment/pull_bucket.py b/tasks/0001_737_1737901_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_737_1737901_qa_1/environment/pull_bucket.py +++ b/tasks/0001_737_1737901_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_737_1737901_qa_1/task.toml b/tasks/0001_737_1737901_qa_1/task.toml index 40d22a1a588f450623485afc14157c0f6c355520..649eb6f1b12054d4a0bd79e400118022d91729cb 100644 --- a/tasks/0001_737_1737901_qa_1/task.toml +++ b/tasks/0001_737_1737901_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_737_1737901_qa_2/environment/bootstrap.sh b/tasks/0001_737_1737901_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_737_1737901_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_737_1737901_qa_2/environment/pull_bucket.py b/tasks/0001_737_1737901_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_737_1737901_qa_2/environment/pull_bucket.py +++ b/tasks/0001_737_1737901_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_737_1737901_qa_2/task.toml b/tasks/0001_737_1737901_qa_2/task.toml index 757cf89f714c83061c5b43264f253409ee1eafa8..1e6c5ceec4adcd8cf9afaa5950763d9416760a81 100644 --- a/tasks/0001_737_1737901_qa_2/task.toml +++ b/tasks/0001_737_1737901_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_739_1739101_qa_3/environment/bootstrap.sh b/tasks/0001_739_1739101_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_739_1739101_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_739_1739101_qa_3/environment/pull_bucket.py b/tasks/0001_739_1739101_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_739_1739101_qa_3/environment/pull_bucket.py +++ b/tasks/0001_739_1739101_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_739_1739101_qa_3/task.toml b/tasks/0001_739_1739101_qa_3/task.toml index a842992f7c779b55dd5cbb42f1881c21cbf315aa..37bf04194000026af701f7d03ef0b416b9ead019 100644 --- a/tasks/0001_739_1739101_qa_3/task.toml +++ b/tasks/0001_739_1739101_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_739_1739101_qa_5/environment/bootstrap.sh b/tasks/0001_739_1739101_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_739_1739101_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_739_1739101_qa_5/environment/pull_bucket.py b/tasks/0001_739_1739101_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_739_1739101_qa_5/environment/pull_bucket.py +++ b/tasks/0001_739_1739101_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_739_1739101_qa_5/task.toml b/tasks/0001_739_1739101_qa_5/task.toml index 535a378c4f1dc79ed3284705de808dc6debcc0cd..e4d624d05da07dbc0938a34b710b3ad649c1ebe7 100644 --- a/tasks/0001_739_1739101_qa_5/task.toml +++ b/tasks/0001_739_1739101_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_741_1741634_qa_2/environment/bootstrap.sh b/tasks/0001_741_1741634_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_741_1741634_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_741_1741634_qa_2/environment/pull_bucket.py b/tasks/0001_741_1741634_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_741_1741634_qa_2/environment/pull_bucket.py +++ b/tasks/0001_741_1741634_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_741_1741634_qa_2/task.toml b/tasks/0001_741_1741634_qa_2/task.toml index 7f9a1ebb9b97b0002574913a4cf48b285bfc4b8d..fec6aad3e5aaf7bb3f82282ba912a7c3f6ac91c5 100644 --- a/tasks/0001_741_1741634_qa_2/task.toml +++ b/tasks/0001_741_1741634_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_741_1741873_qa_4/environment/bootstrap.sh b/tasks/0001_741_1741873_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_741_1741873_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_741_1741873_qa_4/environment/pull_bucket.py b/tasks/0001_741_1741873_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_741_1741873_qa_4/environment/pull_bucket.py +++ b/tasks/0001_741_1741873_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_741_1741873_qa_4/task.toml b/tasks/0001_741_1741873_qa_4/task.toml index a17cfc95b81383c6d1afad1f2c104d4d3f3a5131..bbc9cb53d02c33d7dcbb5923004a0537d98dbc1c 100644 --- a/tasks/0001_741_1741873_qa_4/task.toml +++ b/tasks/0001_741_1741873_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_746_1746593_qa_2/environment/bootstrap.sh b/tasks/0001_746_1746593_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_746_1746593_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_746_1746593_qa_2/environment/pull_bucket.py b/tasks/0001_746_1746593_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_746_1746593_qa_2/environment/pull_bucket.py +++ b/tasks/0001_746_1746593_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_746_1746593_qa_2/task.toml b/tasks/0001_746_1746593_qa_2/task.toml index 34afcbecae2205f6c711de35d003726aacd519db..fb37e091af4b89655e5b77163bd5a5a8195b739e 100644 --- a/tasks/0001_746_1746593_qa_2/task.toml +++ b/tasks/0001_746_1746593_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_750_1750005_qa_1/environment/bootstrap.sh b/tasks/0001_750_1750005_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_750_1750005_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_750_1750005_qa_1/environment/pull_bucket.py b/tasks/0001_750_1750005_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_750_1750005_qa_1/environment/pull_bucket.py +++ b/tasks/0001_750_1750005_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_750_1750005_qa_1/task.toml b/tasks/0001_750_1750005_qa_1/task.toml index 0ae87f7a5fbe5c39dd3e26933c52219e0c8a5b89..771f16c74a5afd5c95f9c9e04edab0e51763d077 100644 --- a/tasks/0001_750_1750005_qa_1/task.toml +++ b/tasks/0001_750_1750005_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_754_1754320_qa_2/environment/bootstrap.sh b/tasks/0001_754_1754320_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_754_1754320_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_754_1754320_qa_2/environment/pull_bucket.py b/tasks/0001_754_1754320_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_754_1754320_qa_2/environment/pull_bucket.py +++ b/tasks/0001_754_1754320_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_754_1754320_qa_2/task.toml b/tasks/0001_754_1754320_qa_2/task.toml index bfa62c14b53742687301ae41a443bf1877227fad..ebd46be946fe60d7b052ff5aeadba0614aa4d5a3 100644 --- a/tasks/0001_754_1754320_qa_2/task.toml +++ b/tasks/0001_754_1754320_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_755_1755036_qa_1/environment/bootstrap.sh b/tasks/0001_755_1755036_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_755_1755036_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_755_1755036_qa_1/environment/pull_bucket.py b/tasks/0001_755_1755036_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_755_1755036_qa_1/environment/pull_bucket.py +++ b/tasks/0001_755_1755036_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_755_1755036_qa_1/task.toml b/tasks/0001_755_1755036_qa_1/task.toml index 0084913f04ec3b900f76fd85ae2c7f69c55c9bc0..8fea6c45f6665002cb23448d608609270e4c3382 100644 --- a/tasks/0001_755_1755036_qa_1/task.toml +++ b/tasks/0001_755_1755036_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_755_1755036_qa_2/environment/bootstrap.sh b/tasks/0001_755_1755036_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_755_1755036_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_755_1755036_qa_2/environment/pull_bucket.py b/tasks/0001_755_1755036_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_755_1755036_qa_2/environment/pull_bucket.py +++ b/tasks/0001_755_1755036_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_755_1755036_qa_2/task.toml b/tasks/0001_755_1755036_qa_2/task.toml index cbffc841a308b9f1d76565b96d7f7bb333799955..48e9ca15ef544997c739d629fa6b00fba953599a 100644 --- a/tasks/0001_755_1755036_qa_2/task.toml +++ b/tasks/0001_755_1755036_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_761_1761668_qa_2/environment/bootstrap.sh b/tasks/0001_761_1761668_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_761_1761668_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_761_1761668_qa_2/environment/pull_bucket.py b/tasks/0001_761_1761668_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_761_1761668_qa_2/environment/pull_bucket.py +++ b/tasks/0001_761_1761668_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_761_1761668_qa_2/task.toml b/tasks/0001_761_1761668_qa_2/task.toml index b80711b24e5b3ddbefd92af3a18817cd281a3dc4..23aed9fa54d2b1a745a0428df85c0d7d2dbbf949 100644 --- a/tasks/0001_761_1761668_qa_2/task.toml +++ b/tasks/0001_761_1761668_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_761_1761668_qa_3/environment/bootstrap.sh b/tasks/0001_761_1761668_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_761_1761668_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_761_1761668_qa_3/environment/pull_bucket.py b/tasks/0001_761_1761668_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_761_1761668_qa_3/environment/pull_bucket.py +++ b/tasks/0001_761_1761668_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_761_1761668_qa_3/task.toml b/tasks/0001_761_1761668_qa_3/task.toml index ec46a2788b3001dbe833c1efaa8a1ef9b6034f7e..d008911d2da161df1be60339c79d9578961e2e16 100644 --- a/tasks/0001_761_1761668_qa_3/task.toml +++ b/tasks/0001_761_1761668_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_781_1781985_qa_1/environment/bootstrap.sh b/tasks/0001_781_1781985_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_781_1781985_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_781_1781985_qa_1/environment/pull_bucket.py b/tasks/0001_781_1781985_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_781_1781985_qa_1/environment/pull_bucket.py +++ b/tasks/0001_781_1781985_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_781_1781985_qa_1/task.toml b/tasks/0001_781_1781985_qa_1/task.toml index 5e086a6b7d9f66e3b33b57e140f363e05b0fe914..d8c133d175dcc8eedcc39364b09000cbcef38205 100644 --- a/tasks/0001_781_1781985_qa_1/task.toml +++ b/tasks/0001_781_1781985_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_784_1784765_qa_5/environment/bootstrap.sh b/tasks/0001_784_1784765_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_784_1784765_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_784_1784765_qa_5/environment/pull_bucket.py b/tasks/0001_784_1784765_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_784_1784765_qa_5/environment/pull_bucket.py +++ b/tasks/0001_784_1784765_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_784_1784765_qa_5/task.toml b/tasks/0001_784_1784765_qa_5/task.toml index 4254b9c5996b4d547cd4e8ae0564b38044735ce3..ac499a2f13e1563c586a2316df7e65581e2e3e2d 100644 --- a/tasks/0001_784_1784765_qa_5/task.toml +++ b/tasks/0001_784_1784765_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_789_1789575_qa_1/environment/bootstrap.sh b/tasks/0001_789_1789575_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_789_1789575_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_789_1789575_qa_1/environment/pull_bucket.py b/tasks/0001_789_1789575_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_789_1789575_qa_1/environment/pull_bucket.py +++ b/tasks/0001_789_1789575_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_789_1789575_qa_1/task.toml b/tasks/0001_789_1789575_qa_1/task.toml index c9a400a7d7c5792282899eb15c0cfe2270c6eaa9..d51f27df47de9c0723af700eec0261c53b06d3be 100644 --- a/tasks/0001_789_1789575_qa_1/task.toml +++ b/tasks/0001_789_1789575_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_789_1789575_qa_2/environment/bootstrap.sh b/tasks/0001_789_1789575_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_789_1789575_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_789_1789575_qa_2/environment/pull_bucket.py b/tasks/0001_789_1789575_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_789_1789575_qa_2/environment/pull_bucket.py +++ b/tasks/0001_789_1789575_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_789_1789575_qa_2/task.toml b/tasks/0001_789_1789575_qa_2/task.toml index 1083f7e93d1358d53709e0f385eeee49473053bd..973b89d68dc7713355bd4cb589fb7ee6f8b55a5c 100644 --- a/tasks/0001_789_1789575_qa_2/task.toml +++ b/tasks/0001_789_1789575_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_825_1825877_qa_3/environment/bootstrap.sh b/tasks/0001_825_1825877_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_825_1825877_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_825_1825877_qa_3/environment/pull_bucket.py b/tasks/0001_825_1825877_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_825_1825877_qa_3/environment/pull_bucket.py +++ b/tasks/0001_825_1825877_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_825_1825877_qa_3/task.toml b/tasks/0001_825_1825877_qa_3/task.toml index d22f0dc54291cf6e17677437fc26e23cb1396a8a..4b8b69aa625645c45bcc43003f20381802cb1ac3 100644 --- a/tasks/0001_825_1825877_qa_3/task.toml +++ b/tasks/0001_825_1825877_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_825_1825877_qa_5/environment/bootstrap.sh b/tasks/0001_825_1825877_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_825_1825877_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_825_1825877_qa_5/environment/pull_bucket.py b/tasks/0001_825_1825877_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_825_1825877_qa_5/environment/pull_bucket.py +++ b/tasks/0001_825_1825877_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_825_1825877_qa_5/task.toml b/tasks/0001_825_1825877_qa_5/task.toml index 61372647279d27d9256d6d466a79bcfb61db2dff..774f7694cf43b6c565c749bdbccab2abec96f7c1 100644 --- a/tasks/0001_825_1825877_qa_5/task.toml +++ b/tasks/0001_825_1825877_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_840_1840182_qa_2/environment/bootstrap.sh b/tasks/0001_840_1840182_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_840_1840182_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_840_1840182_qa_2/environment/pull_bucket.py b/tasks/0001_840_1840182_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_840_1840182_qa_2/environment/pull_bucket.py +++ b/tasks/0001_840_1840182_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_840_1840182_qa_2/task.toml b/tasks/0001_840_1840182_qa_2/task.toml index fa6f36b9cb7097edc905046511888b9409c91097..951189c45c37ecd5657e2d9f6216560737076f88 100644 --- a/tasks/0001_840_1840182_qa_2/task.toml +++ b/tasks/0001_840_1840182_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_840_1840182_qa_3/environment/bootstrap.sh b/tasks/0001_840_1840182_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_840_1840182_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_840_1840182_qa_3/environment/pull_bucket.py b/tasks/0001_840_1840182_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_840_1840182_qa_3/environment/pull_bucket.py +++ b/tasks/0001_840_1840182_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_840_1840182_qa_3/task.toml b/tasks/0001_840_1840182_qa_3/task.toml index 855b7377fc5baa0f810a627d2dfef5e759b8484e..2602654f5e3e88ab0174a1f734a593c6f90c8e5a 100644 --- a/tasks/0001_840_1840182_qa_3/task.toml +++ b/tasks/0001_840_1840182_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_840_1840182_qa_4/environment/bootstrap.sh b/tasks/0001_840_1840182_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_840_1840182_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_840_1840182_qa_4/environment/pull_bucket.py b/tasks/0001_840_1840182_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_840_1840182_qa_4/environment/pull_bucket.py +++ b/tasks/0001_840_1840182_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_840_1840182_qa_4/task.toml b/tasks/0001_840_1840182_qa_4/task.toml index e8df8d60fe179e6a27095f56c36038c3b5a23b17..e85197ec17dc68f6ca9dd753df303a5f428de24e 100644 --- a/tasks/0001_840_1840182_qa_4/task.toml +++ b/tasks/0001_840_1840182_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_850_1850034_qa_2/environment/bootstrap.sh b/tasks/0001_850_1850034_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_850_1850034_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_850_1850034_qa_2/environment/pull_bucket.py b/tasks/0001_850_1850034_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_850_1850034_qa_2/environment/pull_bucket.py +++ b/tasks/0001_850_1850034_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_850_1850034_qa_2/task.toml b/tasks/0001_850_1850034_qa_2/task.toml index bdc2a950cc6853ccb10b5c7c62570ca49a87e338..68d5da485dbb34eac4345da2c4e91238b998b0ef 100644 --- a/tasks/0001_850_1850034_qa_2/task.toml +++ b/tasks/0001_850_1850034_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_850_1850034_qa_5/environment/bootstrap.sh b/tasks/0001_850_1850034_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_850_1850034_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_850_1850034_qa_5/environment/pull_bucket.py b/tasks/0001_850_1850034_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_850_1850034_qa_5/environment/pull_bucket.py +++ b/tasks/0001_850_1850034_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_850_1850034_qa_5/task.toml b/tasks/0001_850_1850034_qa_5/task.toml index 2e36446652a9c8d0ba90affccbb66722c91d8e68..31689e1051caf5c5fd3452e01faa44e29c53414c 100644 --- a/tasks/0001_850_1850034_qa_5/task.toml +++ b/tasks/0001_850_1850034_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_860_1860651_qa_4/environment/bootstrap.sh b/tasks/0001_860_1860651_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_860_1860651_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_860_1860651_qa_4/environment/pull_bucket.py b/tasks/0001_860_1860651_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_860_1860651_qa_4/environment/pull_bucket.py +++ b/tasks/0001_860_1860651_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_860_1860651_qa_4/task.toml b/tasks/0001_860_1860651_qa_4/task.toml index f8bcd84c09f62558cb381b78182661baeffbe393..fb81ff4a9f28f61ad8ccaa1e986f6912ac491b6a 100644 --- a/tasks/0001_860_1860651_qa_4/task.toml +++ b/tasks/0001_860_1860651_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_864_1864781_qa_3/environment/bootstrap.sh b/tasks/0001_864_1864781_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_864_1864781_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_864_1864781_qa_3/environment/pull_bucket.py b/tasks/0001_864_1864781_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_864_1864781_qa_3/environment/pull_bucket.py +++ b/tasks/0001_864_1864781_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_864_1864781_qa_3/task.toml b/tasks/0001_864_1864781_qa_3/task.toml index d85e529cc76b00a7141cb3884da1124eba77b8c1..25487f250884fabd06b95b278258be8a4156c394 100644 --- a/tasks/0001_864_1864781_qa_3/task.toml +++ b/tasks/0001_864_1864781_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_864_1864781_qa_4/environment/bootstrap.sh b/tasks/0001_864_1864781_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_864_1864781_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_864_1864781_qa_4/environment/pull_bucket.py b/tasks/0001_864_1864781_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_864_1864781_qa_4/environment/pull_bucket.py +++ b/tasks/0001_864_1864781_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_864_1864781_qa_4/task.toml b/tasks/0001_864_1864781_qa_4/task.toml index 08c80ef1a945773244b3cb96576cccfab2dc4b80..c2c6252fdd835b4cd3fd998af483a1cfe504758f 100644 --- a/tasks/0001_864_1864781_qa_4/task.toml +++ b/tasks/0001_864_1864781_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_866_1866353_qa_1/environment/bootstrap.sh b/tasks/0001_866_1866353_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_866_1866353_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_866_1866353_qa_1/environment/pull_bucket.py b/tasks/0001_866_1866353_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_866_1866353_qa_1/environment/pull_bucket.py +++ b/tasks/0001_866_1866353_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_866_1866353_qa_1/task.toml b/tasks/0001_866_1866353_qa_1/task.toml index d3f8b1c1e6e101f6d385b8da389379e46709113c..eff58b54559d2c4eed57bdd9d8858846cf070e34 100644 --- a/tasks/0001_866_1866353_qa_1/task.toml +++ b/tasks/0001_866_1866353_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_866_1866353_qa_2/environment/bootstrap.sh b/tasks/0001_866_1866353_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_866_1866353_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_866_1866353_qa_2/environment/pull_bucket.py b/tasks/0001_866_1866353_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_866_1866353_qa_2/environment/pull_bucket.py +++ b/tasks/0001_866_1866353_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_866_1866353_qa_2/task.toml b/tasks/0001_866_1866353_qa_2/task.toml index 246382387ff20b5e36ae55155d37d4c3ba5eb60e..40622da1699fe2cccd19583961624ddf52321a92 100644 --- a/tasks/0001_866_1866353_qa_2/task.toml +++ b/tasks/0001_866_1866353_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_869_1869308_qa_4/environment/bootstrap.sh b/tasks/0001_869_1869308_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_869_1869308_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_869_1869308_qa_4/environment/pull_bucket.py b/tasks/0001_869_1869308_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_869_1869308_qa_4/environment/pull_bucket.py +++ b/tasks/0001_869_1869308_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_869_1869308_qa_4/task.toml b/tasks/0001_869_1869308_qa_4/task.toml index 9e6bf6ce6ff35ef079eea8bdb2be7528d587d10b..cd28bb618db7b45df96396b3a7c35697d9e8ac15 100644 --- a/tasks/0001_869_1869308_qa_4/task.toml +++ b/tasks/0001_869_1869308_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_869_1869526_qa_5/environment/bootstrap.sh b/tasks/0001_869_1869526_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_869_1869526_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_869_1869526_qa_5/environment/pull_bucket.py b/tasks/0001_869_1869526_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_869_1869526_qa_5/environment/pull_bucket.py +++ b/tasks/0001_869_1869526_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_869_1869526_qa_5/task.toml b/tasks/0001_869_1869526_qa_5/task.toml index 27abd738903056d18f71a3abe62456c5ebfd4d08..528d35506121c4892411438199525a7b052a0bb5 100644 --- a/tasks/0001_869_1869526_qa_5/task.toml +++ b/tasks/0001_869_1869526_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_869_1869604_qa_2/environment/bootstrap.sh b/tasks/0001_869_1869604_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_869_1869604_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_869_1869604_qa_2/environment/pull_bucket.py b/tasks/0001_869_1869604_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_869_1869604_qa_2/environment/pull_bucket.py +++ b/tasks/0001_869_1869604_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_869_1869604_qa_2/task.toml b/tasks/0001_869_1869604_qa_2/task.toml index 06fc9d82dff2a6e3649c6a0f64db35ab833bb65d..1df67adb9fed9fe30a7cab8cc2fcffd2f7e39ae9 100644 --- a/tasks/0001_869_1869604_qa_2/task.toml +++ b/tasks/0001_869_1869604_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_871_1871102_qa_2/environment/bootstrap.sh b/tasks/0001_871_1871102_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_871_1871102_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_871_1871102_qa_2/environment/pull_bucket.py b/tasks/0001_871_1871102_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_871_1871102_qa_2/environment/pull_bucket.py +++ b/tasks/0001_871_1871102_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_871_1871102_qa_2/task.toml b/tasks/0001_871_1871102_qa_2/task.toml index 26393ae317ce72be45a7419640ee35ea25172f79..a426b3f6bbe9cb49d65846ca51c3c6ef626e28d3 100644 --- a/tasks/0001_871_1871102_qa_2/task.toml +++ b/tasks/0001_871_1871102_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_875_1875604_qa_1/environment/bootstrap.sh b/tasks/0001_875_1875604_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_875_1875604_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_875_1875604_qa_1/environment/pull_bucket.py b/tasks/0001_875_1875604_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_875_1875604_qa_1/environment/pull_bucket.py +++ b/tasks/0001_875_1875604_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_875_1875604_qa_1/task.toml b/tasks/0001_875_1875604_qa_1/task.toml index 0e745f43aa9b4ef480ffe59745ce786404a683e4..76d158d7f71fb16e4d1b3352c4f1233fed3fe599 100644 --- a/tasks/0001_875_1875604_qa_1/task.toml +++ b/tasks/0001_875_1875604_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_876_1876377_qa_2/environment/bootstrap.sh b/tasks/0001_876_1876377_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_876_1876377_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_876_1876377_qa_2/environment/pull_bucket.py b/tasks/0001_876_1876377_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_876_1876377_qa_2/environment/pull_bucket.py +++ b/tasks/0001_876_1876377_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_876_1876377_qa_2/task.toml b/tasks/0001_876_1876377_qa_2/task.toml index 594d31e54f38534569370ed9df4762a38489d64a..c892c9110c4e234785b2044bb71feccd13ef74d7 100644 --- a/tasks/0001_876_1876377_qa_2/task.toml +++ b/tasks/0001_876_1876377_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_878_1878667_qa_2/environment/bootstrap.sh b/tasks/0001_878_1878667_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_878_1878667_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_878_1878667_qa_2/environment/pull_bucket.py b/tasks/0001_878_1878667_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_878_1878667_qa_2/environment/pull_bucket.py +++ b/tasks/0001_878_1878667_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_878_1878667_qa_2/task.toml b/tasks/0001_878_1878667_qa_2/task.toml index 8fb95000c395be2cff4667e4f017cd3b0079b474..703228442c9bed2255573cf3ae81faf50c07beff 100644 --- a/tasks/0001_878_1878667_qa_2/task.toml +++ b/tasks/0001_878_1878667_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_878_1878667_qa_5/environment/bootstrap.sh b/tasks/0001_878_1878667_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_878_1878667_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_878_1878667_qa_5/environment/pull_bucket.py b/tasks/0001_878_1878667_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_878_1878667_qa_5/environment/pull_bucket.py +++ b/tasks/0001_878_1878667_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_878_1878667_qa_5/task.toml b/tasks/0001_878_1878667_qa_5/task.toml index 77dc9a2260d47ab4d78a8908447ffd6bdc58b2a9..1bc653884b947d862a4df1cba615a29f322283df 100644 --- a/tasks/0001_878_1878667_qa_5/task.toml +++ b/tasks/0001_878_1878667_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_878_1878746_qa_1/environment/bootstrap.sh b/tasks/0001_878_1878746_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_878_1878746_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_878_1878746_qa_1/environment/pull_bucket.py b/tasks/0001_878_1878746_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_878_1878746_qa_1/environment/pull_bucket.py +++ b/tasks/0001_878_1878746_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_878_1878746_qa_1/task.toml b/tasks/0001_878_1878746_qa_1/task.toml index a39a5ea44be1ad0ebc6cddfd734b62ce138dd164..1b4084f620b7b289b7c22a4cd90539a7caa58946 100644 --- a/tasks/0001_878_1878746_qa_1/task.toml +++ b/tasks/0001_878_1878746_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_878_1878746_qa_2/environment/bootstrap.sh b/tasks/0001_878_1878746_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_878_1878746_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_878_1878746_qa_2/environment/pull_bucket.py b/tasks/0001_878_1878746_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_878_1878746_qa_2/environment/pull_bucket.py +++ b/tasks/0001_878_1878746_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_878_1878746_qa_2/task.toml b/tasks/0001_878_1878746_qa_2/task.toml index 23d172fad6bcb0fff6af09c62996ac0bab3c4efd..d42059191c07f3b7b1310322eb31a558d5bdd25d 100644 --- a/tasks/0001_878_1878746_qa_2/task.toml +++ b/tasks/0001_878_1878746_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_878_1878746_qa_4/environment/bootstrap.sh b/tasks/0001_878_1878746_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_878_1878746_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_878_1878746_qa_4/environment/pull_bucket.py b/tasks/0001_878_1878746_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_878_1878746_qa_4/environment/pull_bucket.py +++ b/tasks/0001_878_1878746_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_878_1878746_qa_4/task.toml b/tasks/0001_878_1878746_qa_4/task.toml index 0f5e4c0340290bf267f8d0ab24ece8c4f41dbaa2..951b6e255533162a015ffd2316192b6c0f332623 100644 --- a/tasks/0001_878_1878746_qa_4/task.toml +++ b/tasks/0001_878_1878746_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_882_1882893_qa_3/environment/bootstrap.sh b/tasks/0001_882_1882893_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_882_1882893_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_882_1882893_qa_3/environment/pull_bucket.py b/tasks/0001_882_1882893_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_882_1882893_qa_3/environment/pull_bucket.py +++ b/tasks/0001_882_1882893_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_882_1882893_qa_3/task.toml b/tasks/0001_882_1882893_qa_3/task.toml index ed1deb9cbc72079d5d517c47be129421f6b8af9d..8405634bc3cfce8f21dedabac249e126b4df78e6 100644 --- a/tasks/0001_882_1882893_qa_3/task.toml +++ b/tasks/0001_882_1882893_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_885_1885477_qa_5/environment/bootstrap.sh b/tasks/0001_885_1885477_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_885_1885477_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_885_1885477_qa_5/environment/pull_bucket.py b/tasks/0001_885_1885477_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_885_1885477_qa_5/environment/pull_bucket.py +++ b/tasks/0001_885_1885477_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_885_1885477_qa_5/task.toml b/tasks/0001_885_1885477_qa_5/task.toml index 2dc1f87fe229971a9ecf46c94ccd6c0c6bb5eb92..2a1273deae0259003d8e03501f3b98ee7b0fd1cd 100644 --- a/tasks/0001_885_1885477_qa_5/task.toml +++ b/tasks/0001_885_1885477_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_888_1888068_qa_2/environment/bootstrap.sh b/tasks/0001_888_1888068_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_888_1888068_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_888_1888068_qa_2/environment/pull_bucket.py b/tasks/0001_888_1888068_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_888_1888068_qa_2/environment/pull_bucket.py +++ b/tasks/0001_888_1888068_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_888_1888068_qa_2/task.toml b/tasks/0001_888_1888068_qa_2/task.toml index ad7867b5e021f61f818cbd36bf252de11c73b87a..1b50e5710038ddb9c2ad9688d9e95ee7950e389f 100644 --- a/tasks/0001_888_1888068_qa_2/task.toml +++ b/tasks/0001_888_1888068_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_892_1892691_qa_2/environment/bootstrap.sh b/tasks/0001_892_1892691_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_892_1892691_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_892_1892691_qa_2/environment/pull_bucket.py b/tasks/0001_892_1892691_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_892_1892691_qa_2/environment/pull_bucket.py +++ b/tasks/0001_892_1892691_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_892_1892691_qa_2/task.toml b/tasks/0001_892_1892691_qa_2/task.toml index ff94f523eac0b0a9b5ee4e5a3fb93cfd91e3f5fe..7234585bc3230276b20e535d1c3c83206642e183 100644 --- a/tasks/0001_892_1892691_qa_2/task.toml +++ b/tasks/0001_892_1892691_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_892_1892691_qa_3/environment/bootstrap.sh b/tasks/0001_892_1892691_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_892_1892691_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_892_1892691_qa_3/environment/pull_bucket.py b/tasks/0001_892_1892691_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_892_1892691_qa_3/environment/pull_bucket.py +++ b/tasks/0001_892_1892691_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_892_1892691_qa_3/task.toml b/tasks/0001_892_1892691_qa_3/task.toml index 9bb26b3501185e45501cea51567a8c6a7f6d4aef..af3abe666ae7c06abf63b541576e34869ccfadb9 100644 --- a/tasks/0001_892_1892691_qa_3/task.toml +++ b/tasks/0001_892_1892691_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_892_1892776_qa_1/environment/bootstrap.sh b/tasks/0001_892_1892776_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_892_1892776_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_892_1892776_qa_1/environment/pull_bucket.py b/tasks/0001_892_1892776_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_892_1892776_qa_1/environment/pull_bucket.py +++ b/tasks/0001_892_1892776_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_892_1892776_qa_1/task.toml b/tasks/0001_892_1892776_qa_1/task.toml index 19ef19ebee7ac2dcd564ab8b92c132b8f4822e72..d5d03122d8983b0b1d1bfa88949c76d627caaee9 100644 --- a/tasks/0001_892_1892776_qa_1/task.toml +++ b/tasks/0001_892_1892776_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_892_1892776_qa_2/environment/bootstrap.sh b/tasks/0001_892_1892776_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_892_1892776_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_892_1892776_qa_2/environment/pull_bucket.py b/tasks/0001_892_1892776_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_892_1892776_qa_2/environment/pull_bucket.py +++ b/tasks/0001_892_1892776_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_892_1892776_qa_2/task.toml b/tasks/0001_892_1892776_qa_2/task.toml index 187729f08febfd56513b3cd578d93818a086caa4..993c67c9fc327ffdd573e7af72f41fd56d68d222 100644 --- a/tasks/0001_892_1892776_qa_2/task.toml +++ b/tasks/0001_892_1892776_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_892_1892776_qa_4/environment/bootstrap.sh b/tasks/0001_892_1892776_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_892_1892776_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_892_1892776_qa_4/environment/pull_bucket.py b/tasks/0001_892_1892776_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_892_1892776_qa_4/environment/pull_bucket.py +++ b/tasks/0001_892_1892776_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_892_1892776_qa_4/task.toml b/tasks/0001_892_1892776_qa_4/task.toml index 1be54c13c4037d71234e6ce1801548f9bb3eed54..2c4b6685760e8b8587c4c459ebe80c2b82629baa 100644 --- a/tasks/0001_892_1892776_qa_4/task.toml +++ b/tasks/0001_892_1892776_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_893_1893246_qa_3/environment/bootstrap.sh b/tasks/0001_893_1893246_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_893_1893246_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_893_1893246_qa_3/environment/pull_bucket.py b/tasks/0001_893_1893246_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_893_1893246_qa_3/environment/pull_bucket.py +++ b/tasks/0001_893_1893246_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_893_1893246_qa_3/task.toml b/tasks/0001_893_1893246_qa_3/task.toml index 291e93b0c56d2d854008aea3a336e0b18b6349d8..110833a293e7d7dd03652d094308ea9ffdae394b 100644 --- a/tasks/0001_893_1893246_qa_3/task.toml +++ b/tasks/0001_893_1893246_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_894_1894014_qa_2/environment/bootstrap.sh b/tasks/0001_894_1894014_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_894_1894014_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_894_1894014_qa_2/environment/pull_bucket.py b/tasks/0001_894_1894014_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_894_1894014_qa_2/environment/pull_bucket.py +++ b/tasks/0001_894_1894014_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_894_1894014_qa_2/task.toml b/tasks/0001_894_1894014_qa_2/task.toml index e7ebcf89b2bf088de95d2cc03f2ee83a377b6cd7..68731ff723cc01354fd9464fc537c601b924d35e 100644 --- a/tasks/0001_894_1894014_qa_2/task.toml +++ b/tasks/0001_894_1894014_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_897_1897174_qa_5/environment/bootstrap.sh b/tasks/0001_897_1897174_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_897_1897174_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_897_1897174_qa_5/environment/pull_bucket.py b/tasks/0001_897_1897174_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_897_1897174_qa_5/environment/pull_bucket.py +++ b/tasks/0001_897_1897174_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_897_1897174_qa_5/task.toml b/tasks/0001_897_1897174_qa_5/task.toml index ad1ddb85f951cc32f15a7ddb66c62ae5ed0c53e9..2c3d06ec39aa39d143f4318fd91a1829a0681f2a 100644 --- a/tasks/0001_897_1897174_qa_5/task.toml +++ b/tasks/0001_897_1897174_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_898_1898542_qa_4/environment/bootstrap.sh b/tasks/0001_898_1898542_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_898_1898542_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_898_1898542_qa_4/environment/pull_bucket.py b/tasks/0001_898_1898542_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_898_1898542_qa_4/environment/pull_bucket.py +++ b/tasks/0001_898_1898542_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_898_1898542_qa_4/task.toml b/tasks/0001_898_1898542_qa_4/task.toml index 1055fa9058346e597504339f7b2251ce51fc438a..3a54a882b7cc907b94486c64f8a092355bd55033 100644 --- a/tasks/0001_898_1898542_qa_4/task.toml +++ b/tasks/0001_898_1898542_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_902_1902242_qa_4/environment/bootstrap.sh b/tasks/0001_902_1902242_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_902_1902242_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_902_1902242_qa_4/environment/pull_bucket.py b/tasks/0001_902_1902242_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_902_1902242_qa_4/environment/pull_bucket.py +++ b/tasks/0001_902_1902242_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_902_1902242_qa_4/task.toml b/tasks/0001_902_1902242_qa_4/task.toml index 2f8d3c24ed8f439f66949a4a1a22c877d7376e22..ca295148d54762dcd8cf9e0fe2cfe4935b382442 100644 --- a/tasks/0001_902_1902242_qa_4/task.toml +++ b/tasks/0001_902_1902242_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_902_1902890_qa_5/environment/bootstrap.sh b/tasks/0001_902_1902890_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_902_1902890_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_902_1902890_qa_5/environment/pull_bucket.py b/tasks/0001_902_1902890_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_902_1902890_qa_5/environment/pull_bucket.py +++ b/tasks/0001_902_1902890_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_902_1902890_qa_5/task.toml b/tasks/0001_902_1902890_qa_5/task.toml index eb516c55b717f635da94c34e97cd09f0d3d82089..f74e7768edbc51e9220cb7933150cc066e3861dd 100644 --- a/tasks/0001_902_1902890_qa_5/task.toml +++ b/tasks/0001_902_1902890_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_903_1903160_qa_2/environment/bootstrap.sh b/tasks/0001_903_1903160_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_903_1903160_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_903_1903160_qa_2/environment/pull_bucket.py b/tasks/0001_903_1903160_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_903_1903160_qa_2/environment/pull_bucket.py +++ b/tasks/0001_903_1903160_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_903_1903160_qa_2/task.toml b/tasks/0001_903_1903160_qa_2/task.toml index 1d42188f18e654e684f048d75d6ca1841f40a5ed..b628e4eb61f046916b34716ea27dcde045e62df2 100644 --- a/tasks/0001_903_1903160_qa_2/task.toml +++ b/tasks/0001_903_1903160_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_903_1903160_qa_3/environment/bootstrap.sh b/tasks/0001_903_1903160_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_903_1903160_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_903_1903160_qa_3/environment/pull_bucket.py b/tasks/0001_903_1903160_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_903_1903160_qa_3/environment/pull_bucket.py +++ b/tasks/0001_903_1903160_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_903_1903160_qa_3/task.toml b/tasks/0001_903_1903160_qa_3/task.toml index fef0392d6436283df4238b8b0e18636b1a8e1a98..ffe4af0e956cf5f0ba4954d376925b93c308341a 100644 --- a/tasks/0001_903_1903160_qa_3/task.toml +++ b/tasks/0001_903_1903160_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_904_1904660_qa_4/environment/bootstrap.sh b/tasks/0001_904_1904660_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_904_1904660_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_904_1904660_qa_4/environment/pull_bucket.py b/tasks/0001_904_1904660_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_904_1904660_qa_4/environment/pull_bucket.py +++ b/tasks/0001_904_1904660_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_904_1904660_qa_4/task.toml b/tasks/0001_904_1904660_qa_4/task.toml index b8ce06443d2f31dd0cca7d1dde5d5f2745a57c8e..5d3197149e81ef1c030a42c12bd8cd6c183ba8ec 100644 --- a/tasks/0001_904_1904660_qa_4/task.toml +++ b/tasks/0001_904_1904660_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_906_1906064_qa_4/environment/bootstrap.sh b/tasks/0001_906_1906064_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_906_1906064_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_906_1906064_qa_4/environment/pull_bucket.py b/tasks/0001_906_1906064_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_906_1906064_qa_4/environment/pull_bucket.py +++ b/tasks/0001_906_1906064_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_906_1906064_qa_4/task.toml b/tasks/0001_906_1906064_qa_4/task.toml index ef2ddc8830db067ae0ed1bbd5b3f9b5e13be4ed4..df1b5346fca53462745fbe975c00edfe13ab4b4b 100644 --- a/tasks/0001_906_1906064_qa_4/task.toml +++ b/tasks/0001_906_1906064_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_908_1908198_qa_1/environment/bootstrap.sh b/tasks/0001_908_1908198_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_908_1908198_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_908_1908198_qa_1/environment/pull_bucket.py b/tasks/0001_908_1908198_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_908_1908198_qa_1/environment/pull_bucket.py +++ b/tasks/0001_908_1908198_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_908_1908198_qa_1/task.toml b/tasks/0001_908_1908198_qa_1/task.toml index ef01bb742ae20de97590f42d71f62c6c2390338d..257baf3ae1bc4790a31f8a659c9818083c0c6016 100644 --- a/tasks/0001_908_1908198_qa_1/task.toml +++ b/tasks/0001_908_1908198_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_909_1909933_qa_4/environment/bootstrap.sh b/tasks/0001_909_1909933_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_909_1909933_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_909_1909933_qa_4/environment/pull_bucket.py b/tasks/0001_909_1909933_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_909_1909933_qa_4/environment/pull_bucket.py +++ b/tasks/0001_909_1909933_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_909_1909933_qa_4/task.toml b/tasks/0001_909_1909933_qa_4/task.toml index c8743c2e2a1c3b0630d1d1579e8b15b60f494799..c1dab5ec88e97d4b3b739328accf7e1552d546b0 100644 --- a/tasks/0001_909_1909933_qa_4/task.toml +++ b/tasks/0001_909_1909933_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_916_1916491_qa_4/environment/bootstrap.sh b/tasks/0001_916_1916491_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_916_1916491_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_916_1916491_qa_4/environment/pull_bucket.py b/tasks/0001_916_1916491_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_916_1916491_qa_4/environment/pull_bucket.py +++ b/tasks/0001_916_1916491_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_916_1916491_qa_4/task.toml b/tasks/0001_916_1916491_qa_4/task.toml index 055406a32e69049d0dd58dfc69a4a66229cf4e69..510a5077316b5880e0fa1f445d270475c146ceac 100644 --- a/tasks/0001_916_1916491_qa_4/task.toml +++ b/tasks/0001_916_1916491_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_918_1918012_qa_2/environment/bootstrap.sh b/tasks/0001_918_1918012_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_918_1918012_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_918_1918012_qa_2/environment/pull_bucket.py b/tasks/0001_918_1918012_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_918_1918012_qa_2/environment/pull_bucket.py +++ b/tasks/0001_918_1918012_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_918_1918012_qa_2/task.toml b/tasks/0001_918_1918012_qa_2/task.toml index 8fbb7f02548672630510ff50e0c9a52592b3a47a..0891f64d32a43030731ca8a9c44acf5b38b12750 100644 --- a/tasks/0001_918_1918012_qa_2/task.toml +++ b/tasks/0001_918_1918012_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_918_1918012_qa_3/environment/bootstrap.sh b/tasks/0001_918_1918012_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_918_1918012_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_918_1918012_qa_3/environment/pull_bucket.py b/tasks/0001_918_1918012_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_918_1918012_qa_3/environment/pull_bucket.py +++ b/tasks/0001_918_1918012_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_918_1918012_qa_3/task.toml b/tasks/0001_918_1918012_qa_3/task.toml index 1792a01297ef0cb2148793e1bd218df8c571d6f3..5712f7c9c44066486ae266b10ce3f8c65ec417d7 100644 --- a/tasks/0001_918_1918012_qa_3/task.toml +++ b/tasks/0001_918_1918012_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_918_1918012_qa_5/environment/bootstrap.sh b/tasks/0001_918_1918012_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_918_1918012_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_918_1918012_qa_5/environment/pull_bucket.py b/tasks/0001_918_1918012_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_918_1918012_qa_5/environment/pull_bucket.py +++ b/tasks/0001_918_1918012_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_918_1918012_qa_5/task.toml b/tasks/0001_918_1918012_qa_5/task.toml index de3a52f2202f805a7c515479b31fa3c2a72238fc..6d8de6504d3a6f18d752d6fd5f136cc1a177e1fe 100644 --- a/tasks/0001_918_1918012_qa_5/task.toml +++ b/tasks/0001_918_1918012_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_918_1918045_qa_2/environment/bootstrap.sh b/tasks/0001_918_1918045_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_918_1918045_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_918_1918045_qa_2/environment/pull_bucket.py b/tasks/0001_918_1918045_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_918_1918045_qa_2/environment/pull_bucket.py +++ b/tasks/0001_918_1918045_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_918_1918045_qa_2/task.toml b/tasks/0001_918_1918045_qa_2/task.toml index 92d0f6f297396fac0d37630e44426ccfb53397d4..fcb0f18bf7b2875ac43bc2ea6db994c4d7ed9b54 100644 --- a/tasks/0001_918_1918045_qa_2/task.toml +++ b/tasks/0001_918_1918045_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_918_1918045_qa_4/environment/bootstrap.sh b/tasks/0001_918_1918045_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_918_1918045_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_918_1918045_qa_4/environment/pull_bucket.py b/tasks/0001_918_1918045_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_918_1918045_qa_4/environment/pull_bucket.py +++ b/tasks/0001_918_1918045_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_918_1918045_qa_4/task.toml b/tasks/0001_918_1918045_qa_4/task.toml index 89ca4b0d0e3578a6c7524483ee5edc23655f80ed..7cf96bb8a9ed88d1c0939f71942dfbf70a51a09d 100644 --- a/tasks/0001_918_1918045_qa_4/task.toml +++ b/tasks/0001_918_1918045_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_930_1930122_qa_2/environment/bootstrap.sh b/tasks/0001_930_1930122_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_930_1930122_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_930_1930122_qa_2/environment/pull_bucket.py b/tasks/0001_930_1930122_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_930_1930122_qa_2/environment/pull_bucket.py +++ b/tasks/0001_930_1930122_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_930_1930122_qa_2/task.toml b/tasks/0001_930_1930122_qa_2/task.toml index 34d0ef86ffbe8d4787df02248eaa1d6fb76a1476..f3e546c1afc496ce1e17d66066451b600eafd79e 100644 --- a/tasks/0001_930_1930122_qa_2/task.toml +++ b/tasks/0001_930_1930122_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_930_1930899_qa_1/environment/bootstrap.sh b/tasks/0001_930_1930899_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_930_1930899_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_930_1930899_qa_1/environment/pull_bucket.py b/tasks/0001_930_1930899_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_930_1930899_qa_1/environment/pull_bucket.py +++ b/tasks/0001_930_1930899_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_930_1930899_qa_1/task.toml b/tasks/0001_930_1930899_qa_1/task.toml index 50598d4594960deb2ca3f91cea96fbff01bf0a6d..427c3388f73a4b6563f3131456f83638a3838029 100644 --- a/tasks/0001_930_1930899_qa_1/task.toml +++ b/tasks/0001_930_1930899_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_930_1930899_qa_5/environment/bootstrap.sh b/tasks/0001_930_1930899_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_930_1930899_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_930_1930899_qa_5/environment/pull_bucket.py b/tasks/0001_930_1930899_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_930_1930899_qa_5/environment/pull_bucket.py +++ b/tasks/0001_930_1930899_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_930_1930899_qa_5/task.toml b/tasks/0001_930_1930899_qa_5/task.toml index d54d3a2335273c2bfc70080bda44231fc684fa06..976f7cc849d2ae8f913f66ea41e5d49f4a561cd6 100644 --- a/tasks/0001_930_1930899_qa_5/task.toml +++ b/tasks/0001_930_1930899_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_935_1935106_qa_2/environment/bootstrap.sh b/tasks/0001_935_1935106_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_935_1935106_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_935_1935106_qa_2/environment/pull_bucket.py b/tasks/0001_935_1935106_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_935_1935106_qa_2/environment/pull_bucket.py +++ b/tasks/0001_935_1935106_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_935_1935106_qa_2/task.toml b/tasks/0001_935_1935106_qa_2/task.toml index c853f5c6c4a5126b9d52ab0d29d3a117bdd41396..8ac3facb168c839ca0caea81f134d2724e4c0e73 100644 --- a/tasks/0001_935_1935106_qa_2/task.toml +++ b/tasks/0001_935_1935106_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_937_1937476_qa_1/environment/bootstrap.sh b/tasks/0001_937_1937476_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_937_1937476_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_937_1937476_qa_1/environment/pull_bucket.py b/tasks/0001_937_1937476_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_937_1937476_qa_1/environment/pull_bucket.py +++ b/tasks/0001_937_1937476_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_937_1937476_qa_1/task.toml b/tasks/0001_937_1937476_qa_1/task.toml index ba3377367a4c9dccf9a75e789ff043c746fb74ed..a68b4d90db51e019f7276ab112a1895b8ac1d154 100644 --- a/tasks/0001_937_1937476_qa_1/task.toml +++ b/tasks/0001_937_1937476_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_937_1937476_qa_2/environment/bootstrap.sh b/tasks/0001_937_1937476_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_937_1937476_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_937_1937476_qa_2/environment/pull_bucket.py b/tasks/0001_937_1937476_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_937_1937476_qa_2/environment/pull_bucket.py +++ b/tasks/0001_937_1937476_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_937_1937476_qa_2/task.toml b/tasks/0001_937_1937476_qa_2/task.toml index 6df39f2c6452f0213c7dae7a44001e8f086caec1..170a62419bd81464be416a69c1a574cf707ab71d 100644 --- a/tasks/0001_937_1937476_qa_2/task.toml +++ b/tasks/0001_937_1937476_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_938_1938182_qa_3/environment/bootstrap.sh b/tasks/0001_938_1938182_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_938_1938182_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_938_1938182_qa_3/environment/pull_bucket.py b/tasks/0001_938_1938182_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_938_1938182_qa_3/environment/pull_bucket.py +++ b/tasks/0001_938_1938182_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_938_1938182_qa_3/task.toml b/tasks/0001_938_1938182_qa_3/task.toml index 2691d9225d9014f97dc3df86698e5d5aeef6d1d4..4cd091b2bd11f29fceb61afdb13e5581c526029f 100644 --- a/tasks/0001_938_1938182_qa_3/task.toml +++ b/tasks/0001_938_1938182_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_938_1938182_qa_5/environment/bootstrap.sh b/tasks/0001_938_1938182_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_938_1938182_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_938_1938182_qa_5/environment/pull_bucket.py b/tasks/0001_938_1938182_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_938_1938182_qa_5/environment/pull_bucket.py +++ b/tasks/0001_938_1938182_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_938_1938182_qa_5/task.toml b/tasks/0001_938_1938182_qa_5/task.toml index ed120d6aedb69cf22b4a13c6eedb56415788fa3f..4ca102ecad61f3d1305018c8f10345a88bccb6dd 100644 --- a/tasks/0001_938_1938182_qa_5/task.toml +++ b/tasks/0001_938_1938182_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_955_1955907_qa_3/environment/bootstrap.sh b/tasks/0001_955_1955907_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_955_1955907_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_955_1955907_qa_3/environment/pull_bucket.py b/tasks/0001_955_1955907_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_955_1955907_qa_3/environment/pull_bucket.py +++ b/tasks/0001_955_1955907_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_955_1955907_qa_3/task.toml b/tasks/0001_955_1955907_qa_3/task.toml index f36190a4447e2ad65398161b1d5de95cb04b589f..b8b9b23b6845aeb6eac2d6d9843a7bc31e230dab 100644 --- a/tasks/0001_955_1955907_qa_3/task.toml +++ b/tasks/0001_955_1955907_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_955_1955907_qa_5/environment/bootstrap.sh b/tasks/0001_955_1955907_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_955_1955907_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_955_1955907_qa_5/environment/pull_bucket.py b/tasks/0001_955_1955907_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_955_1955907_qa_5/environment/pull_bucket.py +++ b/tasks/0001_955_1955907_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_955_1955907_qa_5/task.toml b/tasks/0001_955_1955907_qa_5/task.toml index 79f7303fc01047537a3c451ffcae997ee524c575..d869d3debadc79a964c462656bc39de9c52b4b17 100644 --- a/tasks/0001_955_1955907_qa_5/task.toml +++ b/tasks/0001_955_1955907_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_956_1956536_qa_4/environment/bootstrap.sh b/tasks/0001_956_1956536_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_956_1956536_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_956_1956536_qa_4/environment/pull_bucket.py b/tasks/0001_956_1956536_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_956_1956536_qa_4/environment/pull_bucket.py +++ b/tasks/0001_956_1956536_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_956_1956536_qa_4/task.toml b/tasks/0001_956_1956536_qa_4/task.toml index 20b99c5666b1332d251de71f2fa86941b55f8610..80beabb0474a7056e4ff4c0cde6eec3f7e59c625 100644 --- a/tasks/0001_956_1956536_qa_4/task.toml +++ b/tasks/0001_956_1956536_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_959_1959663_qa_3/environment/bootstrap.sh b/tasks/0001_959_1959663_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_959_1959663_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_959_1959663_qa_3/environment/pull_bucket.py b/tasks/0001_959_1959663_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_959_1959663_qa_3/environment/pull_bucket.py +++ b/tasks/0001_959_1959663_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_959_1959663_qa_3/task.toml b/tasks/0001_959_1959663_qa_3/task.toml index d64bab75d904566f893ad725341e34f4039caae4..a7eab1bd4620cd3bc8732688b24c4e2c1c944f77 100644 --- a/tasks/0001_959_1959663_qa_3/task.toml +++ b/tasks/0001_959_1959663_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_969_1969476_qa_2/environment/bootstrap.sh b/tasks/0001_969_1969476_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_969_1969476_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_969_1969476_qa_2/environment/pull_bucket.py b/tasks/0001_969_1969476_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_969_1969476_qa_2/environment/pull_bucket.py +++ b/tasks/0001_969_1969476_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_969_1969476_qa_2/task.toml b/tasks/0001_969_1969476_qa_2/task.toml index 0661b8b1cd55021ae92ffde2a7e7c2aec8e113da..d5378b2d02af297a6f317d35158a398ce5311a3b 100644 --- a/tasks/0001_969_1969476_qa_2/task.toml +++ b/tasks/0001_969_1969476_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_969_1969476_qa_3/environment/bootstrap.sh b/tasks/0001_969_1969476_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_969_1969476_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_969_1969476_qa_3/environment/pull_bucket.py b/tasks/0001_969_1969476_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_969_1969476_qa_3/environment/pull_bucket.py +++ b/tasks/0001_969_1969476_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_969_1969476_qa_3/task.toml b/tasks/0001_969_1969476_qa_3/task.toml index 666b2b5d7b189a481d442cbd8931d17fe6f927fd..6da5931198f98fe54e47482039205a3f9e87a9d4 100644 --- a/tasks/0001_969_1969476_qa_3/task.toml +++ b/tasks/0001_969_1969476_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_973_1973830_qa_4/environment/bootstrap.sh b/tasks/0001_973_1973830_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_973_1973830_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_973_1973830_qa_4/environment/pull_bucket.py b/tasks/0001_973_1973830_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_973_1973830_qa_4/environment/pull_bucket.py +++ b/tasks/0001_973_1973830_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_973_1973830_qa_4/task.toml b/tasks/0001_973_1973830_qa_4/task.toml index ba3b104d88d77840906d461690344f07ff12f11a..0e9fafe5858ca45aded57fb605252f09cf38739d 100644 --- a/tasks/0001_973_1973830_qa_4/task.toml +++ b/tasks/0001_973_1973830_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_975_1975169_qa_3/environment/bootstrap.sh b/tasks/0001_975_1975169_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_975_1975169_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_975_1975169_qa_3/environment/pull_bucket.py b/tasks/0001_975_1975169_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_975_1975169_qa_3/environment/pull_bucket.py +++ b/tasks/0001_975_1975169_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_975_1975169_qa_3/task.toml b/tasks/0001_975_1975169_qa_3/task.toml index 0303a5df40e88c5357cb10bc6b49c07f26ca4cc5..71ef1abe9997576ba80bbaccd7253813f721315b 100644 --- a/tasks/0001_975_1975169_qa_3/task.toml +++ b/tasks/0001_975_1975169_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_975_1975497_qa_3/environment/bootstrap.sh b/tasks/0001_975_1975497_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_975_1975497_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_975_1975497_qa_3/environment/pull_bucket.py b/tasks/0001_975_1975497_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_975_1975497_qa_3/environment/pull_bucket.py +++ b/tasks/0001_975_1975497_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_975_1975497_qa_3/task.toml b/tasks/0001_975_1975497_qa_3/task.toml index 941e14abf0af19ccb1d3ff361f9aadf7f2c2c2dc..4dcee22a2c7f5929ecda3cc655196c772bd0400e 100644 --- a/tasks/0001_975_1975497_qa_3/task.toml +++ b/tasks/0001_975_1975497_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_975_1975497_qa_4/environment/bootstrap.sh b/tasks/0001_975_1975497_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_975_1975497_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_975_1975497_qa_4/environment/pull_bucket.py b/tasks/0001_975_1975497_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_975_1975497_qa_4/environment/pull_bucket.py +++ b/tasks/0001_975_1975497_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_975_1975497_qa_4/task.toml b/tasks/0001_975_1975497_qa_4/task.toml index 3592bde064d2a12df9846c0226eeef48d29a7758..0c6f7d09f27a2cd18f37735bef048b6fe51b967b 100644 --- a/tasks/0001_975_1975497_qa_4/task.toml +++ b/tasks/0001_975_1975497_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_989_1989309_qa_2/environment/bootstrap.sh b/tasks/0001_989_1989309_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_989_1989309_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_989_1989309_qa_2/environment/pull_bucket.py b/tasks/0001_989_1989309_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_989_1989309_qa_2/environment/pull_bucket.py +++ b/tasks/0001_989_1989309_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_989_1989309_qa_2/task.toml b/tasks/0001_989_1989309_qa_2/task.toml index 7e55f560370d0f0c2c32cabacdae22fe9b643705..06362f46c176cb42f71afc283b4f657551611f36 100644 --- a/tasks/0001_989_1989309_qa_2/task.toml +++ b/tasks/0001_989_1989309_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_990_1990392_qa_4/environment/bootstrap.sh b/tasks/0001_990_1990392_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_990_1990392_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_990_1990392_qa_4/environment/pull_bucket.py b/tasks/0001_990_1990392_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_990_1990392_qa_4/environment/pull_bucket.py +++ b/tasks/0001_990_1990392_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_990_1990392_qa_4/task.toml b/tasks/0001_990_1990392_qa_4/task.toml index 8d3ec9bbdab29687e4c67bf06e399ac9194e0ee7..b9d9b15f1f4334f586101043b6696ca39c28d2f1 100644 --- a/tasks/0001_990_1990392_qa_4/task.toml +++ b/tasks/0001_990_1990392_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_990_1990794_qa_2/environment/bootstrap.sh b/tasks/0001_990_1990794_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_990_1990794_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_990_1990794_qa_2/environment/pull_bucket.py b/tasks/0001_990_1990794_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_990_1990794_qa_2/environment/pull_bucket.py +++ b/tasks/0001_990_1990794_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_990_1990794_qa_2/task.toml b/tasks/0001_990_1990794_qa_2/task.toml index 39d1271ad7e017ece50462f37a044ca7df4dc660..4de9d1503f241e038d7e12ece66bf8111b5bc8a8 100644 --- a/tasks/0001_990_1990794_qa_2/task.toml +++ b/tasks/0001_990_1990794_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_990_1990794_qa_3/environment/bootstrap.sh b/tasks/0001_990_1990794_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_990_1990794_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_990_1990794_qa_3/environment/pull_bucket.py b/tasks/0001_990_1990794_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_990_1990794_qa_3/environment/pull_bucket.py +++ b/tasks/0001_990_1990794_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_990_1990794_qa_3/task.toml b/tasks/0001_990_1990794_qa_3/task.toml index dd866d4f8c3fc7b38c6f85e71712a5c8faa3d3d0..c4ee8a0e6f055314cf9f2ee491f59fea4039e050 100644 --- a/tasks/0001_990_1990794_qa_3/task.toml +++ b/tasks/0001_990_1990794_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_990_1990794_qa_5/environment/bootstrap.sh b/tasks/0001_990_1990794_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_990_1990794_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_990_1990794_qa_5/environment/pull_bucket.py b/tasks/0001_990_1990794_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_990_1990794_qa_5/environment/pull_bucket.py +++ b/tasks/0001_990_1990794_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_990_1990794_qa_5/task.toml b/tasks/0001_990_1990794_qa_5/task.toml index 997d777087e4c993032693329327f8b28b364ecd..265826645a39494edee53f44f578361b9f8a058a 100644 --- a/tasks/0001_990_1990794_qa_5/task.toml +++ b/tasks/0001_990_1990794_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_991_1991376_qa_4/environment/bootstrap.sh b/tasks/0001_991_1991376_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_991_1991376_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_991_1991376_qa_4/environment/pull_bucket.py b/tasks/0001_991_1991376_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_991_1991376_qa_4/environment/pull_bucket.py +++ b/tasks/0001_991_1991376_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_991_1991376_qa_4/task.toml b/tasks/0001_991_1991376_qa_4/task.toml index b17f57fc08198ae1f23c7c4fb68d4cb70193708f..92c484ca9fd29e9c6205a9fd4f4288c01bfac896 100644 --- a/tasks/0001_991_1991376_qa_4/task.toml +++ b/tasks/0001_991_1991376_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0001_998_1998202_qa_2/environment/bootstrap.sh b/tasks/0001_998_1998202_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0001_998_1998202_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0001_998_1998202_qa_2/environment/pull_bucket.py b/tasks/0001_998_1998202_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0001_998_1998202_qa_2/environment/pull_bucket.py +++ b/tasks/0001_998_1998202_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0001_998_1998202_qa_2/task.toml b/tasks/0001_998_1998202_qa_2/task.toml index 9599cae8e381a78e256ae8b8a3773721f5689590..591555b64491ddeca70c420744e2853cbbbb5e60 100644 --- a/tasks/0001_998_1998202_qa_2/task.toml +++ b/tasks/0001_998_1998202_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_081_2081941_qa_2/environment/bootstrap.sh b/tasks/0002_081_2081941_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_081_2081941_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_081_2081941_qa_2/environment/pull_bucket.py b/tasks/0002_081_2081941_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_081_2081941_qa_2/environment/pull_bucket.py +++ b/tasks/0002_081_2081941_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_081_2081941_qa_2/task.toml b/tasks/0002_081_2081941_qa_2/task.toml index b7b55cc01f070468d435a10187ab763c15562236..1ede75e7a5eda64b8ae25d9ac5966f1cce58697a 100644 --- a/tasks/0002_081_2081941_qa_2/task.toml +++ b/tasks/0002_081_2081941_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_081_2081941_qa_4/environment/bootstrap.sh b/tasks/0002_081_2081941_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_081_2081941_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_081_2081941_qa_4/environment/pull_bucket.py b/tasks/0002_081_2081941_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_081_2081941_qa_4/environment/pull_bucket.py +++ b/tasks/0002_081_2081941_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_081_2081941_qa_4/task.toml b/tasks/0002_081_2081941_qa_4/task.toml index 4e6cb46249a887d147548dba5b0233da002b9a93..a1ee6f3003ae37a6a509162663c95f3371526028 100644 --- a/tasks/0002_081_2081941_qa_4/task.toml +++ b/tasks/0002_081_2081941_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_084_2084371_qa_5/environment/bootstrap.sh b/tasks/0002_084_2084371_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_084_2084371_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_084_2084371_qa_5/environment/pull_bucket.py b/tasks/0002_084_2084371_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_084_2084371_qa_5/environment/pull_bucket.py +++ b/tasks/0002_084_2084371_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_084_2084371_qa_5/task.toml b/tasks/0002_084_2084371_qa_5/task.toml index 5f12b5cf677a4a7dc772b8b7673040660f3c0943..1432c4e01048576e086a795375f6afc1d24b83fe 100644 --- a/tasks/0002_084_2084371_qa_5/task.toml +++ b/tasks/0002_084_2084371_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_092_2092240_qa_1/environment/bootstrap.sh b/tasks/0002_092_2092240_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_092_2092240_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_092_2092240_qa_1/environment/pull_bucket.py b/tasks/0002_092_2092240_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_092_2092240_qa_1/environment/pull_bucket.py +++ b/tasks/0002_092_2092240_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_092_2092240_qa_1/task.toml b/tasks/0002_092_2092240_qa_1/task.toml index d513d901ce4c58b57ea6bfd729e05af8e3a9a641..916afda9672050c67457b5922c35dd4a79cd99ee 100644 --- a/tasks/0002_092_2092240_qa_1/task.toml +++ b/tasks/0002_092_2092240_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_092_2092240_qa_4/environment/bootstrap.sh b/tasks/0002_092_2092240_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_092_2092240_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_092_2092240_qa_4/environment/pull_bucket.py b/tasks/0002_092_2092240_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_092_2092240_qa_4/environment/pull_bucket.py +++ b/tasks/0002_092_2092240_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_092_2092240_qa_4/task.toml b/tasks/0002_092_2092240_qa_4/task.toml index c410652ed751be521422b25c72998da0c6c969e2..d5b10d9ef4bd5a21d2a86be98135eeca98e10f59 100644 --- a/tasks/0002_092_2092240_qa_4/task.toml +++ b/tasks/0002_092_2092240_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_092_2092240_qa_5/environment/bootstrap.sh b/tasks/0002_092_2092240_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_092_2092240_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_092_2092240_qa_5/environment/pull_bucket.py b/tasks/0002_092_2092240_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_092_2092240_qa_5/environment/pull_bucket.py +++ b/tasks/0002_092_2092240_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_092_2092240_qa_5/task.toml b/tasks/0002_092_2092240_qa_5/task.toml index da6034ea11e280a7eb4e93e28a04eab18963a4e4..7876fcf7034c1b2cdc2dc0c057293355a0110d6f 100644 --- a/tasks/0002_092_2092240_qa_5/task.toml +++ b/tasks/0002_092_2092240_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_093_2093580_qa_1/environment/bootstrap.sh b/tasks/0002_093_2093580_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_093_2093580_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_093_2093580_qa_1/environment/pull_bucket.py b/tasks/0002_093_2093580_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_093_2093580_qa_1/environment/pull_bucket.py +++ b/tasks/0002_093_2093580_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_093_2093580_qa_1/task.toml b/tasks/0002_093_2093580_qa_1/task.toml index 0deb641d2c014800cd9695f40a418471c4c8cd93..3d050c9203eb8a0311175309ee9df8cb6fc77db2 100644 --- a/tasks/0002_093_2093580_qa_1/task.toml +++ b/tasks/0002_093_2093580_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_094_2094789_qa_1/environment/bootstrap.sh b/tasks/0002_094_2094789_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_094_2094789_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_094_2094789_qa_1/environment/pull_bucket.py b/tasks/0002_094_2094789_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_094_2094789_qa_1/environment/pull_bucket.py +++ b/tasks/0002_094_2094789_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_094_2094789_qa_1/task.toml b/tasks/0002_094_2094789_qa_1/task.toml index 0979cdfef2ba3ca37decef708290f07f5b0921ea..d341f1b69bc39f5978cc48b9a04544ec2f7947a4 100644 --- a/tasks/0002_094_2094789_qa_1/task.toml +++ b/tasks/0002_094_2094789_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_094_2094789_qa_3/environment/bootstrap.sh b/tasks/0002_094_2094789_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_094_2094789_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_094_2094789_qa_3/environment/pull_bucket.py b/tasks/0002_094_2094789_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_094_2094789_qa_3/environment/pull_bucket.py +++ b/tasks/0002_094_2094789_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_094_2094789_qa_3/task.toml b/tasks/0002_094_2094789_qa_3/task.toml index 812967670a4fb9b4d6ee211f0371ba8ecf71b451..f8f42c242d79e52dec0c919654543d1978431a92 100644 --- a/tasks/0002_094_2094789_qa_3/task.toml +++ b/tasks/0002_094_2094789_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_094_2094844_qa_1/environment/bootstrap.sh b/tasks/0002_094_2094844_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_094_2094844_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_094_2094844_qa_1/environment/pull_bucket.py b/tasks/0002_094_2094844_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_094_2094844_qa_1/environment/pull_bucket.py +++ b/tasks/0002_094_2094844_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_094_2094844_qa_1/task.toml b/tasks/0002_094_2094844_qa_1/task.toml index 4835acc4d3571d6b7d5a014ead58d99bc2dcfcec..cc669aac0714993256ca84e04a0630d6cd5b2017 100644 --- a/tasks/0002_094_2094844_qa_1/task.toml +++ b/tasks/0002_094_2094844_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_094_2094844_qa_3/environment/bootstrap.sh b/tasks/0002_094_2094844_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_094_2094844_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_094_2094844_qa_3/environment/pull_bucket.py b/tasks/0002_094_2094844_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_094_2094844_qa_3/environment/pull_bucket.py +++ b/tasks/0002_094_2094844_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_094_2094844_qa_3/task.toml b/tasks/0002_094_2094844_qa_3/task.toml index 8058ed51178a176347b77f8fab03894721d80150..99d8e5d2f984f6e2838eba99a363e3883954ff27 100644 --- a/tasks/0002_094_2094844_qa_3/task.toml +++ b/tasks/0002_094_2094844_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_105_2105396_qa_1/environment/bootstrap.sh b/tasks/0002_105_2105396_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_105_2105396_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_105_2105396_qa_1/environment/pull_bucket.py b/tasks/0002_105_2105396_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_105_2105396_qa_1/environment/pull_bucket.py +++ b/tasks/0002_105_2105396_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_105_2105396_qa_1/task.toml b/tasks/0002_105_2105396_qa_1/task.toml index db9431e0c277d4559af1bfa53bd40c6130be9a15..3e36c4920f918cb286a9107c757c9b777ad5d8d8 100644 --- a/tasks/0002_105_2105396_qa_1/task.toml +++ b/tasks/0002_105_2105396_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_105_2105769_qa_3/environment/bootstrap.sh b/tasks/0002_105_2105769_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_105_2105769_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_105_2105769_qa_3/environment/pull_bucket.py b/tasks/0002_105_2105769_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_105_2105769_qa_3/environment/pull_bucket.py +++ b/tasks/0002_105_2105769_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_105_2105769_qa_3/task.toml b/tasks/0002_105_2105769_qa_3/task.toml index 544a4638bacd3281175af39883e67923ea564c96..5e170b986b0caf6156ffb678e27e17cab8e6ca52 100644 --- a/tasks/0002_105_2105769_qa_3/task.toml +++ b/tasks/0002_105_2105769_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_109_2109152_qa_1/environment/bootstrap.sh b/tasks/0002_109_2109152_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_109_2109152_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_109_2109152_qa_1/environment/pull_bucket.py b/tasks/0002_109_2109152_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_109_2109152_qa_1/environment/pull_bucket.py +++ b/tasks/0002_109_2109152_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_109_2109152_qa_1/task.toml b/tasks/0002_109_2109152_qa_1/task.toml index 60f4e17a71211666265485c3a9bb0fff7736fda9..e47f65a98132c66a6f0de41fcf954e9c82af95c9 100644 --- a/tasks/0002_109_2109152_qa_1/task.toml +++ b/tasks/0002_109_2109152_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_128_2128926_qa_4/environment/bootstrap.sh b/tasks/0002_128_2128926_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_128_2128926_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_128_2128926_qa_4/environment/pull_bucket.py b/tasks/0002_128_2128926_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_128_2128926_qa_4/environment/pull_bucket.py +++ b/tasks/0002_128_2128926_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_128_2128926_qa_4/task.toml b/tasks/0002_128_2128926_qa_4/task.toml index 2ab0538268cfbb581669c0530d90a8e5e2cda8bb..836417e2342af7a0db64a4b9b4c3ae1f73a2af2e 100644 --- a/tasks/0002_128_2128926_qa_4/task.toml +++ b/tasks/0002_128_2128926_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_133_2133400_qa_2/environment/bootstrap.sh b/tasks/0002_133_2133400_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_133_2133400_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_133_2133400_qa_2/environment/pull_bucket.py b/tasks/0002_133_2133400_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_133_2133400_qa_2/environment/pull_bucket.py +++ b/tasks/0002_133_2133400_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_133_2133400_qa_2/task.toml b/tasks/0002_133_2133400_qa_2/task.toml index f7df3e1afe079912ff3dae075793d1eb7d5702c8..7eb01c1851e25319698189ebc42d9f20636d72e3 100644 --- a/tasks/0002_133_2133400_qa_2/task.toml +++ b/tasks/0002_133_2133400_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_144_2144947_qa_1/environment/bootstrap.sh b/tasks/0002_144_2144947_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_144_2144947_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_144_2144947_qa_1/environment/pull_bucket.py b/tasks/0002_144_2144947_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_144_2144947_qa_1/environment/pull_bucket.py +++ b/tasks/0002_144_2144947_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_144_2144947_qa_1/task.toml b/tasks/0002_144_2144947_qa_1/task.toml index efe0214eb93f4fb29c0124abbe514cd7e8c44354..76b9d57e41caa5096d9229c4bf16e0492f0a46e7 100644 --- a/tasks/0002_144_2144947_qa_1/task.toml +++ b/tasks/0002_144_2144947_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_152_2152103_qa_1/environment/bootstrap.sh b/tasks/0002_152_2152103_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_152_2152103_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_152_2152103_qa_1/environment/pull_bucket.py b/tasks/0002_152_2152103_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_152_2152103_qa_1/environment/pull_bucket.py +++ b/tasks/0002_152_2152103_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_152_2152103_qa_1/task.toml b/tasks/0002_152_2152103_qa_1/task.toml index 3d4071940c5bf43c2020ea1f0e366d40b2eda8ab..c27f19943e61df1ee010d06d3bba79ddf21025c3 100644 --- a/tasks/0002_152_2152103_qa_1/task.toml +++ b/tasks/0002_152_2152103_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_156_2156667_qa_2/environment/bootstrap.sh b/tasks/0002_156_2156667_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_156_2156667_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_156_2156667_qa_2/environment/pull_bucket.py b/tasks/0002_156_2156667_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_156_2156667_qa_2/environment/pull_bucket.py +++ b/tasks/0002_156_2156667_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_156_2156667_qa_2/task.toml b/tasks/0002_156_2156667_qa_2/task.toml index 7f0e313832404e6ab282a0699c567edf47a0ee1c..c3016c3e38d1b957f3250b09d2e0e8409e3ac887 100644 --- a/tasks/0002_156_2156667_qa_2/task.toml +++ b/tasks/0002_156_2156667_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_157_2157761_qa_1/environment/bootstrap.sh b/tasks/0002_157_2157761_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_157_2157761_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_157_2157761_qa_1/environment/pull_bucket.py b/tasks/0002_157_2157761_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_157_2157761_qa_1/environment/pull_bucket.py +++ b/tasks/0002_157_2157761_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_157_2157761_qa_1/task.toml b/tasks/0002_157_2157761_qa_1/task.toml index c3c113b83394976b00cbed803a77ad26e91afa12..e3bb940c0c727d17b4adcaf67d47ae42b582d72a 100644 --- a/tasks/0002_157_2157761_qa_1/task.toml +++ b/tasks/0002_157_2157761_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_158_2158528_qa_4/environment/bootstrap.sh b/tasks/0002_158_2158528_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_158_2158528_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_158_2158528_qa_4/environment/pull_bucket.py b/tasks/0002_158_2158528_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_158_2158528_qa_4/environment/pull_bucket.py +++ b/tasks/0002_158_2158528_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_158_2158528_qa_4/task.toml b/tasks/0002_158_2158528_qa_4/task.toml index 3c02bfac8d8d8581c93419ec1fe44da244f18fc4..ee3d8a0767e07db7ca2df8b576f9ac623b92ebab 100644 --- a/tasks/0002_158_2158528_qa_4/task.toml +++ b/tasks/0002_158_2158528_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_163_2163197_qa_3/environment/bootstrap.sh b/tasks/0002_163_2163197_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_163_2163197_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_163_2163197_qa_3/environment/pull_bucket.py b/tasks/0002_163_2163197_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_163_2163197_qa_3/environment/pull_bucket.py +++ b/tasks/0002_163_2163197_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_163_2163197_qa_3/task.toml b/tasks/0002_163_2163197_qa_3/task.toml index 9ce88bcec12c9e6bffa13cc34523508fde8a4d07..ddbd0331565353b85646b9bf7b874a0d23951a91 100644 --- a/tasks/0002_163_2163197_qa_3/task.toml +++ b/tasks/0002_163_2163197_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_163_2163197_qa_5/environment/bootstrap.sh b/tasks/0002_163_2163197_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_163_2163197_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_163_2163197_qa_5/environment/pull_bucket.py b/tasks/0002_163_2163197_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_163_2163197_qa_5/environment/pull_bucket.py +++ b/tasks/0002_163_2163197_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_163_2163197_qa_5/task.toml b/tasks/0002_163_2163197_qa_5/task.toml index b60436ca873b72c6ba08017c7e31391f74f6931f..1e9ef86a49176877d22cb326301ffa20c6e0d86d 100644 --- a/tasks/0002_163_2163197_qa_5/task.toml +++ b/tasks/0002_163_2163197_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_170_2170781_qa_1/environment/bootstrap.sh b/tasks/0002_170_2170781_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_170_2170781_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_170_2170781_qa_1/environment/pull_bucket.py b/tasks/0002_170_2170781_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_170_2170781_qa_1/environment/pull_bucket.py +++ b/tasks/0002_170_2170781_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_170_2170781_qa_1/task.toml b/tasks/0002_170_2170781_qa_1/task.toml index 18033acc59d0cc1536e10f5f9c3daee2fda5e527..382a28f79819fd23e15aae4886192e0a39bc90c3 100644 --- a/tasks/0002_170_2170781_qa_1/task.toml +++ b/tasks/0002_170_2170781_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_182_2182549_qa_3/environment/bootstrap.sh b/tasks/0002_182_2182549_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_182_2182549_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_182_2182549_qa_3/environment/pull_bucket.py b/tasks/0002_182_2182549_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_182_2182549_qa_3/environment/pull_bucket.py +++ b/tasks/0002_182_2182549_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_182_2182549_qa_3/task.toml b/tasks/0002_182_2182549_qa_3/task.toml index 28af0e0cb9ed39d7e9ada860d92a3935e8b8bd4b..a07b62834dc64c9bdf0360c949b2d44b1fddaee9 100644 --- a/tasks/0002_182_2182549_qa_3/task.toml +++ b/tasks/0002_182_2182549_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_203_2203836_qa_3/environment/bootstrap.sh b/tasks/0002_203_2203836_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_203_2203836_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_203_2203836_qa_3/environment/pull_bucket.py b/tasks/0002_203_2203836_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_203_2203836_qa_3/environment/pull_bucket.py +++ b/tasks/0002_203_2203836_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_203_2203836_qa_3/task.toml b/tasks/0002_203_2203836_qa_3/task.toml index 4b5653034600c8bbbb0a1c6c15247e50195dfc32..3a5f1a94d1f5010a6d64067ca8c48d5ea7625b7f 100644 --- a/tasks/0002_203_2203836_qa_3/task.toml +++ b/tasks/0002_203_2203836_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_203_2203836_qa_4/environment/bootstrap.sh b/tasks/0002_203_2203836_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_203_2203836_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_203_2203836_qa_4/environment/pull_bucket.py b/tasks/0002_203_2203836_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_203_2203836_qa_4/environment/pull_bucket.py +++ b/tasks/0002_203_2203836_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_203_2203836_qa_4/task.toml b/tasks/0002_203_2203836_qa_4/task.toml index b1c6c54c773692eb0a1422bce2af544d7f7ece6a..981ac1d11351965d2f2bf58cb899eb8f350e5a1c 100644 --- a/tasks/0002_203_2203836_qa_4/task.toml +++ b/tasks/0002_203_2203836_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_203_2203836_qa_5/environment/bootstrap.sh b/tasks/0002_203_2203836_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_203_2203836_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_203_2203836_qa_5/environment/pull_bucket.py b/tasks/0002_203_2203836_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_203_2203836_qa_5/environment/pull_bucket.py +++ b/tasks/0002_203_2203836_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_203_2203836_qa_5/task.toml b/tasks/0002_203_2203836_qa_5/task.toml index 2740befdbb9183aa40afcc8701a8ad3340ee7ca3..661a81dee568eb2b6a26f91cb2ce55ce23ddb442 100644 --- a/tasks/0002_203_2203836_qa_5/task.toml +++ b/tasks/0002_203_2203836_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_203_2203940_qa_1/environment/bootstrap.sh b/tasks/0002_203_2203940_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_203_2203940_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_203_2203940_qa_1/environment/pull_bucket.py b/tasks/0002_203_2203940_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_203_2203940_qa_1/environment/pull_bucket.py +++ b/tasks/0002_203_2203940_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_203_2203940_qa_1/task.toml b/tasks/0002_203_2203940_qa_1/task.toml index 87386223132a1352132e2717eec65bb145d72fb3..1c297a9ef4cbe48997ae0eaf726ba1d3eae3d21a 100644 --- a/tasks/0002_203_2203940_qa_1/task.toml +++ b/tasks/0002_203_2203940_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_203_2203940_qa_5/environment/bootstrap.sh b/tasks/0002_203_2203940_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_203_2203940_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_203_2203940_qa_5/environment/pull_bucket.py b/tasks/0002_203_2203940_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_203_2203940_qa_5/environment/pull_bucket.py +++ b/tasks/0002_203_2203940_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_203_2203940_qa_5/task.toml b/tasks/0002_203_2203940_qa_5/task.toml index bc83c63bdba3b4463ede8866be5f9b7a43164524..d7bde1329db501be187b020882ab6d8bccf2a604 100644 --- a/tasks/0002_203_2203940_qa_5/task.toml +++ b/tasks/0002_203_2203940_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_211_2211506_qa_1/environment/bootstrap.sh b/tasks/0002_211_2211506_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_211_2211506_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_211_2211506_qa_1/environment/pull_bucket.py b/tasks/0002_211_2211506_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_211_2211506_qa_1/environment/pull_bucket.py +++ b/tasks/0002_211_2211506_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_211_2211506_qa_1/task.toml b/tasks/0002_211_2211506_qa_1/task.toml index 5ff9318b9684e3110a73680be3a40788ed2d829a..13c92cedaf346ad3bd3e59fa8b2f60a7556a8b74 100644 --- a/tasks/0002_211_2211506_qa_1/task.toml +++ b/tasks/0002_211_2211506_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_217_2217508_qa_3/environment/bootstrap.sh b/tasks/0002_217_2217508_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_217_2217508_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_217_2217508_qa_3/environment/pull_bucket.py b/tasks/0002_217_2217508_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_217_2217508_qa_3/environment/pull_bucket.py +++ b/tasks/0002_217_2217508_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_217_2217508_qa_3/task.toml b/tasks/0002_217_2217508_qa_3/task.toml index bb0c8dcd893befce95e6f5543a6e58dee705495b..28a4dc2bc29445820b5837d8ab1241144709aea4 100644 --- a/tasks/0002_217_2217508_qa_3/task.toml +++ b/tasks/0002_217_2217508_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_217_2217977_qa_1/environment/bootstrap.sh b/tasks/0002_217_2217977_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_217_2217977_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_217_2217977_qa_1/environment/pull_bucket.py b/tasks/0002_217_2217977_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_217_2217977_qa_1/environment/pull_bucket.py +++ b/tasks/0002_217_2217977_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_217_2217977_qa_1/task.toml b/tasks/0002_217_2217977_qa_1/task.toml index 1aa932ab7a41f9fd384b0f11af9061679c747cdc..ace7b3e5deba0df9f1603bbd5bcf347189941c38 100644 --- a/tasks/0002_217_2217977_qa_1/task.toml +++ b/tasks/0002_217_2217977_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_219_2219893_qa_3/environment/bootstrap.sh b/tasks/0002_219_2219893_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_219_2219893_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_219_2219893_qa_3/environment/pull_bucket.py b/tasks/0002_219_2219893_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_219_2219893_qa_3/environment/pull_bucket.py +++ b/tasks/0002_219_2219893_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_219_2219893_qa_3/task.toml b/tasks/0002_219_2219893_qa_3/task.toml index eca8f3c821bcd895de4c97c471fb86b46fbea511..1529dd5492fa732fd57a496869a80e0737dff630 100644 --- a/tasks/0002_219_2219893_qa_3/task.toml +++ b/tasks/0002_219_2219893_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_234_2234436_qa_1/environment/bootstrap.sh b/tasks/0002_234_2234436_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_234_2234436_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_234_2234436_qa_1/environment/pull_bucket.py b/tasks/0002_234_2234436_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_234_2234436_qa_1/environment/pull_bucket.py +++ b/tasks/0002_234_2234436_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_234_2234436_qa_1/task.toml b/tasks/0002_234_2234436_qa_1/task.toml index 6f674a0a8c64d11bcc01fb108532269ad1f51058..f936be766f654583e229efc954299c9131e72070 100644 --- a/tasks/0002_234_2234436_qa_1/task.toml +++ b/tasks/0002_234_2234436_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_240_2240465_qa_4/environment/bootstrap.sh b/tasks/0002_240_2240465_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_240_2240465_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_240_2240465_qa_4/environment/pull_bucket.py b/tasks/0002_240_2240465_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_240_2240465_qa_4/environment/pull_bucket.py +++ b/tasks/0002_240_2240465_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_240_2240465_qa_4/task.toml b/tasks/0002_240_2240465_qa_4/task.toml index 1cb7ac7694b361c754f24b204f49c293d9d89739..67bf76f67cc8c16a7e3dfe67e08978df979022ff 100644 --- a/tasks/0002_240_2240465_qa_4/task.toml +++ b/tasks/0002_240_2240465_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_246_2246634_qa_4/environment/bootstrap.sh b/tasks/0002_246_2246634_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_246_2246634_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_246_2246634_qa_4/environment/pull_bucket.py b/tasks/0002_246_2246634_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_246_2246634_qa_4/environment/pull_bucket.py +++ b/tasks/0002_246_2246634_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_246_2246634_qa_4/task.toml b/tasks/0002_246_2246634_qa_4/task.toml index ac567b89ee171ed449741e4a94e6ee0f09149adb..0b9fcd173a8002f4e28bb5b6149057893c2a02ce 100644 --- a/tasks/0002_246_2246634_qa_4/task.toml +++ b/tasks/0002_246_2246634_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_253_2253632_qa_1/environment/bootstrap.sh b/tasks/0002_253_2253632_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_253_2253632_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_253_2253632_qa_1/environment/pull_bucket.py b/tasks/0002_253_2253632_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_253_2253632_qa_1/environment/pull_bucket.py +++ b/tasks/0002_253_2253632_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_253_2253632_qa_1/task.toml b/tasks/0002_253_2253632_qa_1/task.toml index 095dff3e23e6ff533245dd751d27d88048f18f09..55c7feafefdbe08c806850a55467758e4c9b6338 100644 --- a/tasks/0002_253_2253632_qa_1/task.toml +++ b/tasks/0002_253_2253632_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_253_2253838_qa_5/environment/bootstrap.sh b/tasks/0002_253_2253838_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_253_2253838_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_253_2253838_qa_5/environment/pull_bucket.py b/tasks/0002_253_2253838_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_253_2253838_qa_5/environment/pull_bucket.py +++ b/tasks/0002_253_2253838_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_253_2253838_qa_5/task.toml b/tasks/0002_253_2253838_qa_5/task.toml index 6c194d50701a1888814e8dac7284bb1d75729d80..9fbbb81249ea848c8932f45e168722d2d045fe5b 100644 --- a/tasks/0002_253_2253838_qa_5/task.toml +++ b/tasks/0002_253_2253838_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_264_2264461_qa_1/environment/bootstrap.sh b/tasks/0002_264_2264461_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_264_2264461_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_264_2264461_qa_1/environment/pull_bucket.py b/tasks/0002_264_2264461_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_264_2264461_qa_1/environment/pull_bucket.py +++ b/tasks/0002_264_2264461_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_264_2264461_qa_1/task.toml b/tasks/0002_264_2264461_qa_1/task.toml index 744233c33a5d572af89fa8713ed18123ca482403..97fd8d6079921c2564738f9abe84d12406304744 100644 --- a/tasks/0002_264_2264461_qa_1/task.toml +++ b/tasks/0002_264_2264461_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_276_2276545_qa_2/environment/bootstrap.sh b/tasks/0002_276_2276545_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_276_2276545_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_276_2276545_qa_2/environment/pull_bucket.py b/tasks/0002_276_2276545_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_276_2276545_qa_2/environment/pull_bucket.py +++ b/tasks/0002_276_2276545_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_276_2276545_qa_2/task.toml b/tasks/0002_276_2276545_qa_2/task.toml index e025b2cd82bfe7bf6af35726145d0c3e7fb66b67..897150aa06727f29c6daeacab056244600c0f21b 100644 --- a/tasks/0002_276_2276545_qa_2/task.toml +++ b/tasks/0002_276_2276545_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_325_2325668_qa_5/environment/bootstrap.sh b/tasks/0002_325_2325668_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_325_2325668_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_325_2325668_qa_5/environment/pull_bucket.py b/tasks/0002_325_2325668_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_325_2325668_qa_5/environment/pull_bucket.py +++ b/tasks/0002_325_2325668_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_325_2325668_qa_5/task.toml b/tasks/0002_325_2325668_qa_5/task.toml index eda08e6909c7c28b356811e9cf930ab8f42ad42f..d2c3536833d6519f567b514e5c782360c8c1e161 100644 --- a/tasks/0002_325_2325668_qa_5/task.toml +++ b/tasks/0002_325_2325668_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_349_2349296_qa_2/environment/bootstrap.sh b/tasks/0002_349_2349296_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_349_2349296_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_349_2349296_qa_2/environment/pull_bucket.py b/tasks/0002_349_2349296_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_349_2349296_qa_2/environment/pull_bucket.py +++ b/tasks/0002_349_2349296_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_349_2349296_qa_2/task.toml b/tasks/0002_349_2349296_qa_2/task.toml index a4e8ed0f0d9a02e4ba1028ae107d851b73608456..fac37aa72d0b76425fb681330f4025e26609f6bc 100644 --- a/tasks/0002_349_2349296_qa_2/task.toml +++ b/tasks/0002_349_2349296_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_349_2349296_qa_3/environment/bootstrap.sh b/tasks/0002_349_2349296_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_349_2349296_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_349_2349296_qa_3/environment/pull_bucket.py b/tasks/0002_349_2349296_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_349_2349296_qa_3/environment/pull_bucket.py +++ b/tasks/0002_349_2349296_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_349_2349296_qa_3/task.toml b/tasks/0002_349_2349296_qa_3/task.toml index 397e43b2f9eced26914f8ad8a063ed88bd12c42d..bc399b17e8b9e3b298d9ccf73d212a843c01f8e2 100644 --- a/tasks/0002_349_2349296_qa_3/task.toml +++ b/tasks/0002_349_2349296_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_350_2350400_qa_3/environment/bootstrap.sh b/tasks/0002_350_2350400_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_350_2350400_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_350_2350400_qa_3/environment/pull_bucket.py b/tasks/0002_350_2350400_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_350_2350400_qa_3/environment/pull_bucket.py +++ b/tasks/0002_350_2350400_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_350_2350400_qa_3/task.toml b/tasks/0002_350_2350400_qa_3/task.toml index 3e0b44103e1a736b43fb8723588134cad56a35a9..1dc12f2a6c0e6312891c2b6f9acca7989e98676d 100644 --- a/tasks/0002_350_2350400_qa_3/task.toml +++ b/tasks/0002_350_2350400_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_351_2351047_qa_1/environment/bootstrap.sh b/tasks/0002_351_2351047_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_351_2351047_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_351_2351047_qa_1/environment/pull_bucket.py b/tasks/0002_351_2351047_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_351_2351047_qa_1/environment/pull_bucket.py +++ b/tasks/0002_351_2351047_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_351_2351047_qa_1/task.toml b/tasks/0002_351_2351047_qa_1/task.toml index dec55dafda22565aa4bda4f44ecc24d9ea06d78f..57a12641bf584a5f9cca58c671ae0de831fec969 100644 --- a/tasks/0002_351_2351047_qa_1/task.toml +++ b/tasks/0002_351_2351047_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_375_2375931_qa_1/environment/bootstrap.sh b/tasks/0002_375_2375931_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_375_2375931_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_375_2375931_qa_1/environment/pull_bucket.py b/tasks/0002_375_2375931_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_375_2375931_qa_1/environment/pull_bucket.py +++ b/tasks/0002_375_2375931_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_375_2375931_qa_1/task.toml b/tasks/0002_375_2375931_qa_1/task.toml index f7502a97c625d1ea4db4ed928adf2b7fd8fc80ab..5e613547706b3b507c069728487c811657c6cf96 100644 --- a/tasks/0002_375_2375931_qa_1/task.toml +++ b/tasks/0002_375_2375931_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_375_2375931_qa_3/environment/bootstrap.sh b/tasks/0002_375_2375931_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_375_2375931_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_375_2375931_qa_3/environment/pull_bucket.py b/tasks/0002_375_2375931_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_375_2375931_qa_3/environment/pull_bucket.py +++ b/tasks/0002_375_2375931_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_375_2375931_qa_3/task.toml b/tasks/0002_375_2375931_qa_3/task.toml index b9dde90e3d6888e3877ca4c20bc472c125c38635..c688915212c0b3c35da8261ae01a65e17330bb59 100644 --- a/tasks/0002_375_2375931_qa_3/task.toml +++ b/tasks/0002_375_2375931_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0002_376_2376035_qa_1/environment/bootstrap.sh b/tasks/0002_376_2376035_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0002_376_2376035_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0002_376_2376035_qa_1/environment/pull_bucket.py b/tasks/0002_376_2376035_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0002_376_2376035_qa_1/environment/pull_bucket.py +++ b/tasks/0002_376_2376035_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0002_376_2376035_qa_1/task.toml b/tasks/0002_376_2376035_qa_1/task.toml index f07023d6f995a6f71ee8871cc10661357cbcd41f..b85038324fc352fae70bd3ed0a1b75b94f46335c 100644 --- a/tasks/0002_376_2376035_qa_1/task.toml +++ b/tasks/0002_376_2376035_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_098_10098449_qa_1/environment/bootstrap.sh b/tasks/0010_098_10098449_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_098_10098449_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_098_10098449_qa_1/environment/pull_bucket.py b/tasks/0010_098_10098449_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_098_10098449_qa_1/environment/pull_bucket.py +++ b/tasks/0010_098_10098449_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_098_10098449_qa_1/task.toml b/tasks/0010_098_10098449_qa_1/task.toml index f043afb5a2fc81b614e2437311d679b9486ae01f..2d5dcd3711002302dce7d997287ce43222e47c91 100644 --- a/tasks/0010_098_10098449_qa_1/task.toml +++ b/tasks/0010_098_10098449_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_191_10191909_qa_1/environment/bootstrap.sh b/tasks/0010_191_10191909_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_191_10191909_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_191_10191909_qa_1/environment/pull_bucket.py b/tasks/0010_191_10191909_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_191_10191909_qa_1/environment/pull_bucket.py +++ b/tasks/0010_191_10191909_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_191_10191909_qa_1/task.toml b/tasks/0010_191_10191909_qa_1/task.toml index 65fbd8e4b42f6a482cba3448ae49bab2fe0ea779..2443359ae028d8638fd66ff7792ca61d66d67de9 100644 --- a/tasks/0010_191_10191909_qa_1/task.toml +++ b/tasks/0010_191_10191909_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_191_10191909_qa_4/environment/bootstrap.sh b/tasks/0010_191_10191909_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_191_10191909_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_191_10191909_qa_4/environment/pull_bucket.py b/tasks/0010_191_10191909_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_191_10191909_qa_4/environment/pull_bucket.py +++ b/tasks/0010_191_10191909_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_191_10191909_qa_4/task.toml b/tasks/0010_191_10191909_qa_4/task.toml index 34e4357bbc27d41c2536668c7e400025c93db90e..7aed673636e82a64c1af092bf98cf85b690e545e 100644 --- a/tasks/0010_191_10191909_qa_4/task.toml +++ b/tasks/0010_191_10191909_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_361_10361003_qa_5/environment/bootstrap.sh b/tasks/0010_361_10361003_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_361_10361003_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_361_10361003_qa_5/environment/pull_bucket.py b/tasks/0010_361_10361003_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_361_10361003_qa_5/environment/pull_bucket.py +++ b/tasks/0010_361_10361003_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_361_10361003_qa_5/task.toml b/tasks/0010_361_10361003_qa_5/task.toml index 5faea7ac6438b6cf14a05d3409465616acbb774b..dd9e721d29fbce6c9cbae2439a31c4995d664db7 100644 --- a/tasks/0010_361_10361003_qa_5/task.toml +++ b/tasks/0010_361_10361003_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_376_10376491_qa_3/environment/bootstrap.sh b/tasks/0010_376_10376491_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_376_10376491_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_376_10376491_qa_3/environment/pull_bucket.py b/tasks/0010_376_10376491_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_376_10376491_qa_3/environment/pull_bucket.py +++ b/tasks/0010_376_10376491_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_376_10376491_qa_3/task.toml b/tasks/0010_376_10376491_qa_3/task.toml index 0faf12940787773f2281c6ea0bd6186c0ffe75c6..6e5ede9e3fdbd8bcdc27f4eaf295f91ff51ba6be 100644 --- a/tasks/0010_376_10376491_qa_3/task.toml +++ b/tasks/0010_376_10376491_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_391_10391673_qa_1/environment/bootstrap.sh b/tasks/0010_391_10391673_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_391_10391673_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_391_10391673_qa_1/environment/pull_bucket.py b/tasks/0010_391_10391673_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_391_10391673_qa_1/environment/pull_bucket.py +++ b/tasks/0010_391_10391673_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_391_10391673_qa_1/task.toml b/tasks/0010_391_10391673_qa_1/task.toml index 2a949ad0332ed2ba98eebb4c4146bbe0a95945d2..67745f227b7be1ee2864dc93d9c72aed34859fd2 100644 --- a/tasks/0010_391_10391673_qa_1/task.toml +++ b/tasks/0010_391_10391673_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_482_10482813_qa_1/environment/bootstrap.sh b/tasks/0010_482_10482813_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_482_10482813_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_482_10482813_qa_1/environment/pull_bucket.py b/tasks/0010_482_10482813_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_482_10482813_qa_1/environment/pull_bucket.py +++ b/tasks/0010_482_10482813_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_482_10482813_qa_1/task.toml b/tasks/0010_482_10482813_qa_1/task.toml index 067576d9e367ce3f90b822ec12e0af500335e5f4..563975b6661d340bd8e37175d0672352eba559db 100644 --- a/tasks/0010_482_10482813_qa_1/task.toml +++ b/tasks/0010_482_10482813_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_489_10489077_qa_1/environment/bootstrap.sh b/tasks/0010_489_10489077_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_489_10489077_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_489_10489077_qa_1/environment/pull_bucket.py b/tasks/0010_489_10489077_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_489_10489077_qa_1/environment/pull_bucket.py +++ b/tasks/0010_489_10489077_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_489_10489077_qa_1/task.toml b/tasks/0010_489_10489077_qa_1/task.toml index 2e81565a63b0b954dd43149fcd9f627f63bf343a..b6cfd899db7a678f2e7252317d9675bdd8e6eddb 100644 --- a/tasks/0010_489_10489077_qa_1/task.toml +++ b/tasks/0010_489_10489077_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_489_10489077_qa_4/environment/bootstrap.sh b/tasks/0010_489_10489077_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_489_10489077_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_489_10489077_qa_4/environment/pull_bucket.py b/tasks/0010_489_10489077_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_489_10489077_qa_4/environment/pull_bucket.py +++ b/tasks/0010_489_10489077_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_489_10489077_qa_4/task.toml b/tasks/0010_489_10489077_qa_4/task.toml index aabde53afe692beb8e2ca94e6691ee16c148924a..3f0a03b98f253e749cb64d6dac88688d814d8004 100644 --- a/tasks/0010_489_10489077_qa_4/task.toml +++ b/tasks/0010_489_10489077_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_506_10506952_qa_2/environment/bootstrap.sh b/tasks/0010_506_10506952_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_506_10506952_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_506_10506952_qa_2/environment/pull_bucket.py b/tasks/0010_506_10506952_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_506_10506952_qa_2/environment/pull_bucket.py +++ b/tasks/0010_506_10506952_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_506_10506952_qa_2/task.toml b/tasks/0010_506_10506952_qa_2/task.toml index 793062bc9f27634b8931065668708c4e1ce254b3..8fcd217f169684b32779aa6cf68a9ceb25d1c5cc 100644 --- a/tasks/0010_506_10506952_qa_2/task.toml +++ b/tasks/0010_506_10506952_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_506_10506952_qa_4/environment/bootstrap.sh b/tasks/0010_506_10506952_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_506_10506952_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_506_10506952_qa_4/environment/pull_bucket.py b/tasks/0010_506_10506952_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_506_10506952_qa_4/environment/pull_bucket.py +++ b/tasks/0010_506_10506952_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_506_10506952_qa_4/task.toml b/tasks/0010_506_10506952_qa_4/task.toml index 8bc687bb85622a7c7a8391f901b21ba0c1ab35bd..7eef421b670b2dcba6a59563f27977ad3645a969 100644 --- a/tasks/0010_506_10506952_qa_4/task.toml +++ b/tasks/0010_506_10506952_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_515_10515511_qa_1/environment/bootstrap.sh b/tasks/0010_515_10515511_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_515_10515511_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_515_10515511_qa_1/environment/pull_bucket.py b/tasks/0010_515_10515511_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_515_10515511_qa_1/environment/pull_bucket.py +++ b/tasks/0010_515_10515511_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_515_10515511_qa_1/task.toml b/tasks/0010_515_10515511_qa_1/task.toml index 883925eae8b115dfe8c4eec5f38921a7b0b7c444..789e2befed161552ee40c7367db00fb52c91f5d6 100644 --- a/tasks/0010_515_10515511_qa_1/task.toml +++ b/tasks/0010_515_10515511_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_614_10614011_qa_1/environment/bootstrap.sh b/tasks/0010_614_10614011_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_614_10614011_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_614_10614011_qa_1/environment/pull_bucket.py b/tasks/0010_614_10614011_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_614_10614011_qa_1/environment/pull_bucket.py +++ b/tasks/0010_614_10614011_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_614_10614011_qa_1/task.toml b/tasks/0010_614_10614011_qa_1/task.toml index 8a8781dd593d0f6a96f2c7a4f8c2c8230fc68a9b..c0a0a5c5738a34e05df4eb8809bd267ccc8563bb 100644 --- a/tasks/0010_614_10614011_qa_1/task.toml +++ b/tasks/0010_614_10614011_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_624_10624322_qa_3/environment/bootstrap.sh b/tasks/0010_624_10624322_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_624_10624322_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_624_10624322_qa_3/environment/pull_bucket.py b/tasks/0010_624_10624322_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_624_10624322_qa_3/environment/pull_bucket.py +++ b/tasks/0010_624_10624322_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_624_10624322_qa_3/task.toml b/tasks/0010_624_10624322_qa_3/task.toml index c60870262b0442527f1cc9fb1018484563411932..2b5c8874ae1a7d168d89544f45b03b7466dddb26 100644 --- a/tasks/0010_624_10624322_qa_3/task.toml +++ b/tasks/0010_624_10624322_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_624_10624322_qa_4/environment/bootstrap.sh b/tasks/0010_624_10624322_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_624_10624322_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_624_10624322_qa_4/environment/pull_bucket.py b/tasks/0010_624_10624322_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_624_10624322_qa_4/environment/pull_bucket.py +++ b/tasks/0010_624_10624322_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_624_10624322_qa_4/task.toml b/tasks/0010_624_10624322_qa_4/task.toml index 7230a94a4f164d46e8f07d5a6fdc570c177d652a..cc2e59b59d3f24789a7c84ae3a9f0181443444bb 100644 --- a/tasks/0010_624_10624322_qa_4/task.toml +++ b/tasks/0010_624_10624322_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_631_10631903_qa_1/environment/bootstrap.sh b/tasks/0010_631_10631903_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_631_10631903_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_631_10631903_qa_1/environment/pull_bucket.py b/tasks/0010_631_10631903_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_631_10631903_qa_1/environment/pull_bucket.py +++ b/tasks/0010_631_10631903_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_631_10631903_qa_1/task.toml b/tasks/0010_631_10631903_qa_1/task.toml index a1d0065bc56a22a62af89e101d98734fdbbe5a96..03e0cccdebff04a8fdf27b4cf9e53484846732f1 100644 --- a/tasks/0010_631_10631903_qa_1/task.toml +++ b/tasks/0010_631_10631903_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_637_10637554_qa_1/environment/bootstrap.sh b/tasks/0010_637_10637554_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_637_10637554_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_637_10637554_qa_1/environment/pull_bucket.py b/tasks/0010_637_10637554_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_637_10637554_qa_1/environment/pull_bucket.py +++ b/tasks/0010_637_10637554_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_637_10637554_qa_1/task.toml b/tasks/0010_637_10637554_qa_1/task.toml index 62487dd0b0ba8273ca94a30286a765e3d66cc2f8..cfd07cc4a3316b910998c7dfee0ae3eb1bed5c24 100644 --- a/tasks/0010_637_10637554_qa_1/task.toml +++ b/tasks/0010_637_10637554_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_708_10708335_qa_2/environment/bootstrap.sh b/tasks/0010_708_10708335_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_708_10708335_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_708_10708335_qa_2/environment/pull_bucket.py b/tasks/0010_708_10708335_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_708_10708335_qa_2/environment/pull_bucket.py +++ b/tasks/0010_708_10708335_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_708_10708335_qa_2/task.toml b/tasks/0010_708_10708335_qa_2/task.toml index f51afc828445b6620142fd800e6cb57a4cf60a80..320d30e308297f5bb41fc119c5c8ab7d6a9f4cb9 100644 --- a/tasks/0010_708_10708335_qa_2/task.toml +++ b/tasks/0010_708_10708335_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_821_10821945_qa_3/environment/bootstrap.sh b/tasks/0010_821_10821945_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_821_10821945_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_821_10821945_qa_3/environment/pull_bucket.py b/tasks/0010_821_10821945_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_821_10821945_qa_3/environment/pull_bucket.py +++ b/tasks/0010_821_10821945_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_821_10821945_qa_3/task.toml b/tasks/0010_821_10821945_qa_3/task.toml index a2b3a59f6cde040f80a8be010d090141cbbe43aa..1c25af469af123a60c398cd453597fdb23b898c5 100644 --- a/tasks/0010_821_10821945_qa_3/task.toml +++ b/tasks/0010_821_10821945_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_841_10841985_qa_3/environment/bootstrap.sh b/tasks/0010_841_10841985_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_841_10841985_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_841_10841985_qa_3/environment/pull_bucket.py b/tasks/0010_841_10841985_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_841_10841985_qa_3/environment/pull_bucket.py +++ b/tasks/0010_841_10841985_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_841_10841985_qa_3/task.toml b/tasks/0010_841_10841985_qa_3/task.toml index 3d6cff230083eb5631a70081abcc47095d8a42af..03fad923da76a401c33773a81f9930734a6e22f8 100644 --- a/tasks/0010_841_10841985_qa_3/task.toml +++ b/tasks/0010_841_10841985_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_842_10842977_qa_3/environment/bootstrap.sh b/tasks/0010_842_10842977_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_842_10842977_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_842_10842977_qa_3/environment/pull_bucket.py b/tasks/0010_842_10842977_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_842_10842977_qa_3/environment/pull_bucket.py +++ b/tasks/0010_842_10842977_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_842_10842977_qa_3/task.toml b/tasks/0010_842_10842977_qa_3/task.toml index 4822068e47dc7c8416166c716e55458aea25b5ba..a12c0bc9be19a69537e98616110b4a33fb91672b 100644 --- a/tasks/0010_842_10842977_qa_3/task.toml +++ b/tasks/0010_842_10842977_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_842_10842977_qa_4/environment/bootstrap.sh b/tasks/0010_842_10842977_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_842_10842977_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_842_10842977_qa_4/environment/pull_bucket.py b/tasks/0010_842_10842977_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_842_10842977_qa_4/environment/pull_bucket.py +++ b/tasks/0010_842_10842977_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_842_10842977_qa_4/task.toml b/tasks/0010_842_10842977_qa_4/task.toml index 91d7949e1eec6041b80a93bd61ff1737f33e162d..e3079e66503933e65af78223d6ec363cdab9ff7c 100644 --- a/tasks/0010_842_10842977_qa_4/task.toml +++ b/tasks/0010_842_10842977_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_843_10843239_qa_1/environment/bootstrap.sh b/tasks/0010_843_10843239_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_843_10843239_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_843_10843239_qa_1/environment/pull_bucket.py b/tasks/0010_843_10843239_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_843_10843239_qa_1/environment/pull_bucket.py +++ b/tasks/0010_843_10843239_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_843_10843239_qa_1/task.toml b/tasks/0010_843_10843239_qa_1/task.toml index 01d2961a8c64a047bc3d1342d724afe107a008d9..7bf2cb930d98ef6e0545132b110c5c2c43be96ad 100644 --- a/tasks/0010_843_10843239_qa_1/task.toml +++ b/tasks/0010_843_10843239_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_843_10843239_qa_2/environment/bootstrap.sh b/tasks/0010_843_10843239_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_843_10843239_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_843_10843239_qa_2/environment/pull_bucket.py b/tasks/0010_843_10843239_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_843_10843239_qa_2/environment/pull_bucket.py +++ b/tasks/0010_843_10843239_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_843_10843239_qa_2/task.toml b/tasks/0010_843_10843239_qa_2/task.toml index 03fdab9fc5d7754b94c080381bf618e8e19bb9bb..bd1dc5137b29a9bd5cf3f22887dae30f61192ec2 100644 --- a/tasks/0010_843_10843239_qa_2/task.toml +++ b/tasks/0010_843_10843239_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_860_10860955_qa_1/environment/bootstrap.sh b/tasks/0010_860_10860955_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_860_10860955_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_860_10860955_qa_1/environment/pull_bucket.py b/tasks/0010_860_10860955_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_860_10860955_qa_1/environment/pull_bucket.py +++ b/tasks/0010_860_10860955_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_860_10860955_qa_1/task.toml b/tasks/0010_860_10860955_qa_1/task.toml index 5a5c161eee55552b111df3111d31e487b8969b6f..8079d48f0062ce32ba2f4aa3e21785570544798e 100644 --- a/tasks/0010_860_10860955_qa_1/task.toml +++ b/tasks/0010_860_10860955_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0010_909_10909980_qa_3/environment/bootstrap.sh b/tasks/0010_909_10909980_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0010_909_10909980_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0010_909_10909980_qa_3/environment/pull_bucket.py b/tasks/0010_909_10909980_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0010_909_10909980_qa_3/environment/pull_bucket.py +++ b/tasks/0010_909_10909980_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0010_909_10909980_qa_3/task.toml b/tasks/0010_909_10909980_qa_3/task.toml index 980deaf5b9c7d57171b0d6176bfa69755432c9fa..4fbd02f52e52b03df4544138b751255ef1a2b058 100644 --- a/tasks/0010_909_10909980_qa_3/task.toml +++ b/tasks/0010_909_10909980_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_015_11015604_qa_2/environment/bootstrap.sh b/tasks/0011_015_11015604_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_015_11015604_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_015_11015604_qa_2/environment/pull_bucket.py b/tasks/0011_015_11015604_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_015_11015604_qa_2/environment/pull_bucket.py +++ b/tasks/0011_015_11015604_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_015_11015604_qa_2/task.toml b/tasks/0011_015_11015604_qa_2/task.toml index df49bf835eefd31e8d4ecb1c0a44ebd7db8a6fef..d37e95d924660ee1d9ee7060ac67df4c67b53034 100644 --- a/tasks/0011_015_11015604_qa_2/task.toml +++ b/tasks/0011_015_11015604_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_015_11015604_qa_4/environment/bootstrap.sh b/tasks/0011_015_11015604_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_015_11015604_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_015_11015604_qa_4/environment/pull_bucket.py b/tasks/0011_015_11015604_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_015_11015604_qa_4/environment/pull_bucket.py +++ b/tasks/0011_015_11015604_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_015_11015604_qa_4/task.toml b/tasks/0011_015_11015604_qa_4/task.toml index 8bedb75ace3f565d6bfbb05f8a54d7686d181d16..cc92717453c2ebbe5bbf2305a842ad54192abdb4 100644 --- a/tasks/0011_015_11015604_qa_4/task.toml +++ b/tasks/0011_015_11015604_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_015_11015604_qa_5/environment/bootstrap.sh b/tasks/0011_015_11015604_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_015_11015604_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_015_11015604_qa_5/environment/pull_bucket.py b/tasks/0011_015_11015604_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_015_11015604_qa_5/environment/pull_bucket.py +++ b/tasks/0011_015_11015604_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_015_11015604_qa_5/task.toml b/tasks/0011_015_11015604_qa_5/task.toml index 6e18d856cf2fc3453351001e077303cce188c496..8e5c37f28975321993466b5e1d0e0966ffab076c 100644 --- a/tasks/0011_015_11015604_qa_5/task.toml +++ b/tasks/0011_015_11015604_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_054_11054618_qa_1/environment/bootstrap.sh b/tasks/0011_054_11054618_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_054_11054618_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_054_11054618_qa_1/environment/pull_bucket.py b/tasks/0011_054_11054618_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_054_11054618_qa_1/environment/pull_bucket.py +++ b/tasks/0011_054_11054618_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_054_11054618_qa_1/task.toml b/tasks/0011_054_11054618_qa_1/task.toml index 16621d3c6d6869e5b1884ee572525e51cc6901e3..587ecef19b7a48d106e6170b4523ce176e1bc410 100644 --- a/tasks/0011_054_11054618_qa_1/task.toml +++ b/tasks/0011_054_11054618_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_054_11054618_qa_5/environment/bootstrap.sh b/tasks/0011_054_11054618_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_054_11054618_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_054_11054618_qa_5/environment/pull_bucket.py b/tasks/0011_054_11054618_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_054_11054618_qa_5/environment/pull_bucket.py +++ b/tasks/0011_054_11054618_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_054_11054618_qa_5/task.toml b/tasks/0011_054_11054618_qa_5/task.toml index 055a96885e097c67d65c8c0352774bb9c97b4fe8..81bba33d24577dbb17c47da0ca8192881d49fe71 100644 --- a/tasks/0011_054_11054618_qa_5/task.toml +++ b/tasks/0011_054_11054618_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_060_11060050_qa_4/environment/bootstrap.sh b/tasks/0011_060_11060050_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_060_11060050_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_060_11060050_qa_4/environment/pull_bucket.py b/tasks/0011_060_11060050_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_060_11060050_qa_4/environment/pull_bucket.py +++ b/tasks/0011_060_11060050_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_060_11060050_qa_4/task.toml b/tasks/0011_060_11060050_qa_4/task.toml index 2062e750dbbb1868b7f14096aa230da53892a457..8863726bf0d15372f6a3a8af14c30303c535e861 100644 --- a/tasks/0011_060_11060050_qa_4/task.toml +++ b/tasks/0011_060_11060050_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_088_11088784_qa_2/environment/bootstrap.sh b/tasks/0011_088_11088784_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_088_11088784_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_088_11088784_qa_2/environment/pull_bucket.py b/tasks/0011_088_11088784_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_088_11088784_qa_2/environment/pull_bucket.py +++ b/tasks/0011_088_11088784_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_088_11088784_qa_2/task.toml b/tasks/0011_088_11088784_qa_2/task.toml index 2a37660f80789362320fd9e6ff84ff800419127c..4601d1d5586fba291846ccb0802ed01ba1e77d24 100644 --- a/tasks/0011_088_11088784_qa_2/task.toml +++ b/tasks/0011_088_11088784_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_130_11130431_qa_2/environment/bootstrap.sh b/tasks/0011_130_11130431_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_130_11130431_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_130_11130431_qa_2/environment/pull_bucket.py b/tasks/0011_130_11130431_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_130_11130431_qa_2/environment/pull_bucket.py +++ b/tasks/0011_130_11130431_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_130_11130431_qa_2/task.toml b/tasks/0011_130_11130431_qa_2/task.toml index d55c2517a9dbc80505aadaf7f9e73a633cb59d8f..c305e25cdffb9c6168bd6ff9be8c8bafd45bd789 100644 --- a/tasks/0011_130_11130431_qa_2/task.toml +++ b/tasks/0011_130_11130431_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_130_11130431_qa_4/environment/bootstrap.sh b/tasks/0011_130_11130431_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_130_11130431_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_130_11130431_qa_4/environment/pull_bucket.py b/tasks/0011_130_11130431_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_130_11130431_qa_4/environment/pull_bucket.py +++ b/tasks/0011_130_11130431_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_130_11130431_qa_4/task.toml b/tasks/0011_130_11130431_qa_4/task.toml index 12a5f4acdc5c94a67d7c4eb31b4bbbaa92a6755c..4d24a47789593171607c290967331248cdd335f6 100644 --- a/tasks/0011_130_11130431_qa_4/task.toml +++ b/tasks/0011_130_11130431_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_224_11224334_qa_1/environment/bootstrap.sh b/tasks/0011_224_11224334_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_224_11224334_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_224_11224334_qa_1/environment/pull_bucket.py b/tasks/0011_224_11224334_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_224_11224334_qa_1/environment/pull_bucket.py +++ b/tasks/0011_224_11224334_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_224_11224334_qa_1/task.toml b/tasks/0011_224_11224334_qa_1/task.toml index 0d58b1f7196832b5c074b86c864ab03d50662bae..732bdcecbe513e31c5418b62fa0350cd95013dcb 100644 --- a/tasks/0011_224_11224334_qa_1/task.toml +++ b/tasks/0011_224_11224334_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_271_11271761_qa_2/environment/bootstrap.sh b/tasks/0011_271_11271761_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_271_11271761_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_271_11271761_qa_2/environment/pull_bucket.py b/tasks/0011_271_11271761_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_271_11271761_qa_2/environment/pull_bucket.py +++ b/tasks/0011_271_11271761_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_271_11271761_qa_2/task.toml b/tasks/0011_271_11271761_qa_2/task.toml index b67d39d29716c6b8ec73e920c764fa8804ffd1cf..c10c96f982397911a27e2af72dd5b7b3bd925050 100644 --- a/tasks/0011_271_11271761_qa_2/task.toml +++ b/tasks/0011_271_11271761_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_355_11355842_qa_3/environment/bootstrap.sh b/tasks/0011_355_11355842_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_355_11355842_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_355_11355842_qa_3/environment/pull_bucket.py b/tasks/0011_355_11355842_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_355_11355842_qa_3/environment/pull_bucket.py +++ b/tasks/0011_355_11355842_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_355_11355842_qa_3/task.toml b/tasks/0011_355_11355842_qa_3/task.toml index 38277c49e508625478816b46e9b164e32d0a497c..4521432b1a6360170ebb01b1ade969f0baba1e79 100644 --- a/tasks/0011_355_11355842_qa_3/task.toml +++ b/tasks/0011_355_11355842_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_355_11355842_qa_4/environment/bootstrap.sh b/tasks/0011_355_11355842_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_355_11355842_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_355_11355842_qa_4/environment/pull_bucket.py b/tasks/0011_355_11355842_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_355_11355842_qa_4/environment/pull_bucket.py +++ b/tasks/0011_355_11355842_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_355_11355842_qa_4/task.toml b/tasks/0011_355_11355842_qa_4/task.toml index 1414c2a57f1e922ae178e87ced1d4a96159fbee3..2b5089ad0f9ceeca6bf919522c03288d562960da 100644 --- a/tasks/0011_355_11355842_qa_4/task.toml +++ b/tasks/0011_355_11355842_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_450_11450569_qa_4/environment/bootstrap.sh b/tasks/0011_450_11450569_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_450_11450569_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_450_11450569_qa_4/environment/pull_bucket.py b/tasks/0011_450_11450569_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_450_11450569_qa_4/environment/pull_bucket.py +++ b/tasks/0011_450_11450569_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_450_11450569_qa_4/task.toml b/tasks/0011_450_11450569_qa_4/task.toml index 6825edaae73e748fd9b29e990e03fb363cc29f0c..40c02edeb031834800ccf43336f98a8cd6a33c98 100644 --- a/tasks/0011_450_11450569_qa_4/task.toml +++ b/tasks/0011_450_11450569_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_506_11506450_qa_4/environment/bootstrap.sh b/tasks/0011_506_11506450_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_506_11506450_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_506_11506450_qa_4/environment/pull_bucket.py b/tasks/0011_506_11506450_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_506_11506450_qa_4/environment/pull_bucket.py +++ b/tasks/0011_506_11506450_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_506_11506450_qa_4/task.toml b/tasks/0011_506_11506450_qa_4/task.toml index 824036c156f8067be0f41286c80f6f250f44f3e8..9ed23d8caff02e0515e3e77488eb6034f08eb22b 100644 --- a/tasks/0011_506_11506450_qa_4/task.toml +++ b/tasks/0011_506_11506450_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_508_11508075_qa_1/environment/bootstrap.sh b/tasks/0011_508_11508075_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_508_11508075_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_508_11508075_qa_1/environment/pull_bucket.py b/tasks/0011_508_11508075_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_508_11508075_qa_1/environment/pull_bucket.py +++ b/tasks/0011_508_11508075_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_508_11508075_qa_1/task.toml b/tasks/0011_508_11508075_qa_1/task.toml index 9911cefa37af9b24302207267195b95ce462ba7e..77b90818f1e624599f5adafadae686e3ccef30d7 100644 --- a/tasks/0011_508_11508075_qa_1/task.toml +++ b/tasks/0011_508_11508075_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_544_11544512_qa_4/environment/bootstrap.sh b/tasks/0011_544_11544512_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_544_11544512_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_544_11544512_qa_4/environment/pull_bucket.py b/tasks/0011_544_11544512_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_544_11544512_qa_4/environment/pull_bucket.py +++ b/tasks/0011_544_11544512_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_544_11544512_qa_4/task.toml b/tasks/0011_544_11544512_qa_4/task.toml index 7442894c19811c4aac87aa36af36b8e4e3f845ed..2270cc93b6b3ae531b6b9fb6c9057c58f630fd59 100644 --- a/tasks/0011_544_11544512_qa_4/task.toml +++ b/tasks/0011_544_11544512_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_548_11548867_qa_2/environment/bootstrap.sh b/tasks/0011_548_11548867_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_548_11548867_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_548_11548867_qa_2/environment/pull_bucket.py b/tasks/0011_548_11548867_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_548_11548867_qa_2/environment/pull_bucket.py +++ b/tasks/0011_548_11548867_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_548_11548867_qa_2/task.toml b/tasks/0011_548_11548867_qa_2/task.toml index 73260480eccd8fb454da2ef5822ac69e811f1315..82147a3c66cb179b58227fce02113113ae97d5f6 100644 --- a/tasks/0011_548_11548867_qa_2/task.toml +++ b/tasks/0011_548_11548867_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_587_11587305_qa_5/environment/bootstrap.sh b/tasks/0011_587_11587305_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_587_11587305_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_587_11587305_qa_5/environment/pull_bucket.py b/tasks/0011_587_11587305_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_587_11587305_qa_5/environment/pull_bucket.py +++ b/tasks/0011_587_11587305_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_587_11587305_qa_5/task.toml b/tasks/0011_587_11587305_qa_5/task.toml index 0eb8b0b5ede94c4b7802cff37b207fc593921304..1baf072e926f3a918f34c5b944580ab85fd75c11 100644 --- a/tasks/0011_587_11587305_qa_5/task.toml +++ b/tasks/0011_587_11587305_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_637_11637182_qa_3/environment/bootstrap.sh b/tasks/0011_637_11637182_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_637_11637182_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_637_11637182_qa_3/environment/pull_bucket.py b/tasks/0011_637_11637182_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_637_11637182_qa_3/environment/pull_bucket.py +++ b/tasks/0011_637_11637182_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_637_11637182_qa_3/task.toml b/tasks/0011_637_11637182_qa_3/task.toml index ef23fa9061d8c93554738f4c08dfd71b327dba2e..e5e992f23571f9b29b6cc9cf3ddd29ac0d43987e 100644 --- a/tasks/0011_637_11637182_qa_3/task.toml +++ b/tasks/0011_637_11637182_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_654_11654148_qa_3/environment/bootstrap.sh b/tasks/0011_654_11654148_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_654_11654148_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_654_11654148_qa_3/environment/pull_bucket.py b/tasks/0011_654_11654148_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_654_11654148_qa_3/environment/pull_bucket.py +++ b/tasks/0011_654_11654148_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_654_11654148_qa_3/task.toml b/tasks/0011_654_11654148_qa_3/task.toml index f61d12c0a1522570f9cfd285763a5dd4a7ec6494..aa135301097036f83eb95d92043240d4a386e262 100644 --- a/tasks/0011_654_11654148_qa_3/task.toml +++ b/tasks/0011_654_11654148_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_763_11763257_qa_1/environment/bootstrap.sh b/tasks/0011_763_11763257_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_763_11763257_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_763_11763257_qa_1/environment/pull_bucket.py b/tasks/0011_763_11763257_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_763_11763257_qa_1/environment/pull_bucket.py +++ b/tasks/0011_763_11763257_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_763_11763257_qa_1/task.toml b/tasks/0011_763_11763257_qa_1/task.toml index b778a2aba13f6361bedc717155f70e36e99762c6..b80b8b7897348178a38d91a9b2ca02a762632437 100644 --- a/tasks/0011_763_11763257_qa_1/task.toml +++ b/tasks/0011_763_11763257_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_763_11763257_qa_2/environment/bootstrap.sh b/tasks/0011_763_11763257_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_763_11763257_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_763_11763257_qa_2/environment/pull_bucket.py b/tasks/0011_763_11763257_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_763_11763257_qa_2/environment/pull_bucket.py +++ b/tasks/0011_763_11763257_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_763_11763257_qa_2/task.toml b/tasks/0011_763_11763257_qa_2/task.toml index 14db2c37649b39d9bb0b404e3c2e978bbea08015..7a812a911844419caf59e0f3c87f638da91a7978 100644 --- a/tasks/0011_763_11763257_qa_2/task.toml +++ b/tasks/0011_763_11763257_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_763_11763257_qa_4/environment/bootstrap.sh b/tasks/0011_763_11763257_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_763_11763257_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_763_11763257_qa_4/environment/pull_bucket.py b/tasks/0011_763_11763257_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_763_11763257_qa_4/environment/pull_bucket.py +++ b/tasks/0011_763_11763257_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_763_11763257_qa_4/task.toml b/tasks/0011_763_11763257_qa_4/task.toml index d7fba017e18523347f0ac9e1e84719866d9e413e..564883ac44c802b39df830601e0924ec64d9f85c 100644 --- a/tasks/0011_763_11763257_qa_4/task.toml +++ b/tasks/0011_763_11763257_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_821_11821121_qa_2/environment/bootstrap.sh b/tasks/0011_821_11821121_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_821_11821121_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_821_11821121_qa_2/environment/pull_bucket.py b/tasks/0011_821_11821121_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_821_11821121_qa_2/environment/pull_bucket.py +++ b/tasks/0011_821_11821121_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_821_11821121_qa_2/task.toml b/tasks/0011_821_11821121_qa_2/task.toml index 6741cbe01b40e59600f15f62240b39cdeeb9dfff..777fd6872dea0f961bdad3272e0c246e88e75466 100644 --- a/tasks/0011_821_11821121_qa_2/task.toml +++ b/tasks/0011_821_11821121_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_842_11842614_qa_1/environment/bootstrap.sh b/tasks/0011_842_11842614_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_842_11842614_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_842_11842614_qa_1/environment/pull_bucket.py b/tasks/0011_842_11842614_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_842_11842614_qa_1/environment/pull_bucket.py +++ b/tasks/0011_842_11842614_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_842_11842614_qa_1/task.toml b/tasks/0011_842_11842614_qa_1/task.toml index f817417ca8ccbfd3aca81bcf3fe904173f47344c..22267a64492b8084829263cfdf54cb58cccbabed 100644 --- a/tasks/0011_842_11842614_qa_1/task.toml +++ b/tasks/0011_842_11842614_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_842_11842614_qa_2/environment/bootstrap.sh b/tasks/0011_842_11842614_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_842_11842614_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_842_11842614_qa_2/environment/pull_bucket.py b/tasks/0011_842_11842614_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_842_11842614_qa_2/environment/pull_bucket.py +++ b/tasks/0011_842_11842614_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_842_11842614_qa_2/task.toml b/tasks/0011_842_11842614_qa_2/task.toml index 1404e4448773d93bb4779c5a306c78c98489f5cd..5a8f1ae533727a8b2b6adcf7143e5dbecd03933e 100644 --- a/tasks/0011_842_11842614_qa_2/task.toml +++ b/tasks/0011_842_11842614_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_954_11954276_qa_3/environment/bootstrap.sh b/tasks/0011_954_11954276_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_954_11954276_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_954_11954276_qa_3/environment/pull_bucket.py b/tasks/0011_954_11954276_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_954_11954276_qa_3/environment/pull_bucket.py +++ b/tasks/0011_954_11954276_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_954_11954276_qa_3/task.toml b/tasks/0011_954_11954276_qa_3/task.toml index f5789da233fae259b5af6f90b2d7589a51a0f95d..9686e749f2f851d4af1bbc547b56a27276e811aa 100644 --- a/tasks/0011_954_11954276_qa_3/task.toml +++ b/tasks/0011_954_11954276_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_970_11970593_qa_2/environment/bootstrap.sh b/tasks/0011_970_11970593_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_970_11970593_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_970_11970593_qa_2/environment/pull_bucket.py b/tasks/0011_970_11970593_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_970_11970593_qa_2/environment/pull_bucket.py +++ b/tasks/0011_970_11970593_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_970_11970593_qa_2/task.toml b/tasks/0011_970_11970593_qa_2/task.toml index f7f02af44ea7fad9e8c27e2f5490118ed5e934e8..2ad8dc6198cd0d482f611ffdd2b73c19ccaccb9d 100644 --- a/tasks/0011_970_11970593_qa_2/task.toml +++ b/tasks/0011_970_11970593_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_998_11998157_qa_3/environment/bootstrap.sh b/tasks/0011_998_11998157_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_998_11998157_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_998_11998157_qa_3/environment/pull_bucket.py b/tasks/0011_998_11998157_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_998_11998157_qa_3/environment/pull_bucket.py +++ b/tasks/0011_998_11998157_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_998_11998157_qa_3/task.toml b/tasks/0011_998_11998157_qa_3/task.toml index 1773e2c78a138b67f8d7a5d068d49be13bcecd7a..5d3701c626c67d585745e567cb11c8540d427008 100644 --- a/tasks/0011_998_11998157_qa_3/task.toml +++ b/tasks/0011_998_11998157_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_998_11998157_qa_4/environment/bootstrap.sh b/tasks/0011_998_11998157_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_998_11998157_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_998_11998157_qa_4/environment/pull_bucket.py b/tasks/0011_998_11998157_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_998_11998157_qa_4/environment/pull_bucket.py +++ b/tasks/0011_998_11998157_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_998_11998157_qa_4/task.toml b/tasks/0011_998_11998157_qa_4/task.toml index a6faecb524d9f982c4d4097c9b674deadcf83958..4991585efcd3dcb3d2834949f565b7a64caf54ee 100644 --- a/tasks/0011_998_11998157_qa_4/task.toml +++ b/tasks/0011_998_11998157_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0011_998_11998157_qa_5/environment/bootstrap.sh b/tasks/0011_998_11998157_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0011_998_11998157_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0011_998_11998157_qa_5/environment/pull_bucket.py b/tasks/0011_998_11998157_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0011_998_11998157_qa_5/environment/pull_bucket.py +++ b/tasks/0011_998_11998157_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0011_998_11998157_qa_5/task.toml b/tasks/0011_998_11998157_qa_5/task.toml index 66a8550b4506e6292e6ea5b850415549aed7dbaf..6035ee55e0cfe11ca6517990434143dd60b11233 100644 --- a/tasks/0011_998_11998157_qa_5/task.toml +++ b/tasks/0011_998_11998157_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_075_12075481_qa_1/environment/bootstrap.sh b/tasks/0012_075_12075481_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_075_12075481_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_075_12075481_qa_1/environment/pull_bucket.py b/tasks/0012_075_12075481_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_075_12075481_qa_1/environment/pull_bucket.py +++ b/tasks/0012_075_12075481_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_075_12075481_qa_1/task.toml b/tasks/0012_075_12075481_qa_1/task.toml index 882c2cad610e1db309f21552e5d781ef3e1f654a..f19b927b252f646c558e60d40fcd565bfd39e67d 100644 --- a/tasks/0012_075_12075481_qa_1/task.toml +++ b/tasks/0012_075_12075481_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_075_12075481_qa_2/environment/bootstrap.sh b/tasks/0012_075_12075481_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_075_12075481_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_075_12075481_qa_2/environment/pull_bucket.py b/tasks/0012_075_12075481_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_075_12075481_qa_2/environment/pull_bucket.py +++ b/tasks/0012_075_12075481_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_075_12075481_qa_2/task.toml b/tasks/0012_075_12075481_qa_2/task.toml index 543a7345f70055d7c6a7f16e73c2299260931db1..dc7d4ed517ed1b39def35b45d8a063e580719b6f 100644 --- a/tasks/0012_075_12075481_qa_2/task.toml +++ b/tasks/0012_075_12075481_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_075_12075481_qa_5/environment/bootstrap.sh b/tasks/0012_075_12075481_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_075_12075481_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_075_12075481_qa_5/environment/pull_bucket.py b/tasks/0012_075_12075481_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_075_12075481_qa_5/environment/pull_bucket.py +++ b/tasks/0012_075_12075481_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_075_12075481_qa_5/task.toml b/tasks/0012_075_12075481_qa_5/task.toml index 0f64dc016f4b6a1682264b3b363d2205308cffee..f7bf6531206bb520ef1ab51185e4bdbc5aa49e7b 100644 --- a/tasks/0012_075_12075481_qa_5/task.toml +++ b/tasks/0012_075_12075481_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_101_12101308_qa_2/environment/bootstrap.sh b/tasks/0012_101_12101308_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_101_12101308_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_101_12101308_qa_2/environment/pull_bucket.py b/tasks/0012_101_12101308_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_101_12101308_qa_2/environment/pull_bucket.py +++ b/tasks/0012_101_12101308_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_101_12101308_qa_2/task.toml b/tasks/0012_101_12101308_qa_2/task.toml index 818e8390ea334f5a0fcc3c5a01a068b9a55c83d4..95c71be7d4945021065ced9b6fd2c3783e324ca2 100644 --- a/tasks/0012_101_12101308_qa_2/task.toml +++ b/tasks/0012_101_12101308_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_101_12101336_qa_5/environment/bootstrap.sh b/tasks/0012_101_12101336_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_101_12101336_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_101_12101336_qa_5/environment/pull_bucket.py b/tasks/0012_101_12101336_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_101_12101336_qa_5/environment/pull_bucket.py +++ b/tasks/0012_101_12101336_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_101_12101336_qa_5/task.toml b/tasks/0012_101_12101336_qa_5/task.toml index 29e9a22e014dfb6698a8f2d152c5529161c59071..b47d518f277662bfecfe7f0a45836a75b178c723 100644 --- a/tasks/0012_101_12101336_qa_5/task.toml +++ b/tasks/0012_101_12101336_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_112_12112066_qa_4/environment/bootstrap.sh b/tasks/0012_112_12112066_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_112_12112066_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_112_12112066_qa_4/environment/pull_bucket.py b/tasks/0012_112_12112066_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_112_12112066_qa_4/environment/pull_bucket.py +++ b/tasks/0012_112_12112066_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_112_12112066_qa_4/task.toml b/tasks/0012_112_12112066_qa_4/task.toml index efd9eb92ce976f60d7eca26bd620919ad6f1a374..5b2f8442fa7eab4e47d6caecb474edfdf5cbe5e8 100644 --- a/tasks/0012_112_12112066_qa_4/task.toml +++ b/tasks/0012_112_12112066_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_112_12112975_qa_1/environment/bootstrap.sh b/tasks/0012_112_12112975_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_112_12112975_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_112_12112975_qa_1/environment/pull_bucket.py b/tasks/0012_112_12112975_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_112_12112975_qa_1/environment/pull_bucket.py +++ b/tasks/0012_112_12112975_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_112_12112975_qa_1/task.toml b/tasks/0012_112_12112975_qa_1/task.toml index a1dad8e2ac8fc5ab62266df1e8a0c9bbf451a81e..4e92ae51fc53ceaa70207521794b706da0596e15 100644 --- a/tasks/0012_112_12112975_qa_1/task.toml +++ b/tasks/0012_112_12112975_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_112_12112975_qa_3/environment/bootstrap.sh b/tasks/0012_112_12112975_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_112_12112975_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_112_12112975_qa_3/environment/pull_bucket.py b/tasks/0012_112_12112975_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_112_12112975_qa_3/environment/pull_bucket.py +++ b/tasks/0012_112_12112975_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_112_12112975_qa_3/task.toml b/tasks/0012_112_12112975_qa_3/task.toml index c47a78957f9a2baea98d12447e3cf644d85ca97f..8f894226f38febd5bc6a4a91bef5a492f879e50f 100644 --- a/tasks/0012_112_12112975_qa_3/task.toml +++ b/tasks/0012_112_12112975_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_161_12161282_qa_4/environment/bootstrap.sh b/tasks/0012_161_12161282_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_161_12161282_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_161_12161282_qa_4/environment/pull_bucket.py b/tasks/0012_161_12161282_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_161_12161282_qa_4/environment/pull_bucket.py +++ b/tasks/0012_161_12161282_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_161_12161282_qa_4/task.toml b/tasks/0012_161_12161282_qa_4/task.toml index 7e10251310592890f5ba7bc1b4a70c7c4144e4d9..419bfec22eac1f31f5f6fc096bfdaa1dd73420bd 100644 --- a/tasks/0012_161_12161282_qa_4/task.toml +++ b/tasks/0012_161_12161282_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_179_12179865_qa_4/environment/bootstrap.sh b/tasks/0012_179_12179865_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_179_12179865_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_179_12179865_qa_4/environment/pull_bucket.py b/tasks/0012_179_12179865_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_179_12179865_qa_4/environment/pull_bucket.py +++ b/tasks/0012_179_12179865_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_179_12179865_qa_4/task.toml b/tasks/0012_179_12179865_qa_4/task.toml index a442ec5c8220e4656f5319025f7c755d0c3b554e..90597f88b6b6a088a3ab76276f0f00208f47ac02 100644 --- a/tasks/0012_179_12179865_qa_4/task.toml +++ b/tasks/0012_179_12179865_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_222_12222108_qa_2/environment/bootstrap.sh b/tasks/0012_222_12222108_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_222_12222108_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_222_12222108_qa_2/environment/pull_bucket.py b/tasks/0012_222_12222108_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_222_12222108_qa_2/environment/pull_bucket.py +++ b/tasks/0012_222_12222108_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_222_12222108_qa_2/task.toml b/tasks/0012_222_12222108_qa_2/task.toml index ccb43de3f90cd3c7d36a3ff4c5df3251c1a778d4..d83efb69e4ca850f3a85341476f17f8cc88ba055 100644 --- a/tasks/0012_222_12222108_qa_2/task.toml +++ b/tasks/0012_222_12222108_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_330_12330544_qa_3/environment/bootstrap.sh b/tasks/0012_330_12330544_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_330_12330544_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_330_12330544_qa_3/environment/pull_bucket.py b/tasks/0012_330_12330544_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_330_12330544_qa_3/environment/pull_bucket.py +++ b/tasks/0012_330_12330544_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_330_12330544_qa_3/task.toml b/tasks/0012_330_12330544_qa_3/task.toml index 5e050d46cfe1e9f2cfd50d1b4db2b98233d62d39..9646151f1cfbf8c3507eb646512fabb5c281f561 100644 --- a/tasks/0012_330_12330544_qa_3/task.toml +++ b/tasks/0012_330_12330544_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_556_12556896_qa_1/environment/bootstrap.sh b/tasks/0012_556_12556896_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_556_12556896_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_556_12556896_qa_1/environment/pull_bucket.py b/tasks/0012_556_12556896_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_556_12556896_qa_1/environment/pull_bucket.py +++ b/tasks/0012_556_12556896_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_556_12556896_qa_1/task.toml b/tasks/0012_556_12556896_qa_1/task.toml index 394b5ed0a451b9a33d92fcc5eccc781b8fae6a57..fee2932a456dd27feb89aa4fc2a8a9510726bca4 100644 --- a/tasks/0012_556_12556896_qa_1/task.toml +++ b/tasks/0012_556_12556896_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_556_12556896_qa_5/environment/bootstrap.sh b/tasks/0012_556_12556896_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_556_12556896_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_556_12556896_qa_5/environment/pull_bucket.py b/tasks/0012_556_12556896_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_556_12556896_qa_5/environment/pull_bucket.py +++ b/tasks/0012_556_12556896_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_556_12556896_qa_5/task.toml b/tasks/0012_556_12556896_qa_5/task.toml index f8b8b0586a36e3d353ad6002beb06ae4a3c5459c..f4a090a96039398da37311c2c3080319953a76ce 100644 --- a/tasks/0012_556_12556896_qa_5/task.toml +++ b/tasks/0012_556_12556896_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_593_12593899_qa_2/environment/bootstrap.sh b/tasks/0012_593_12593899_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_593_12593899_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_593_12593899_qa_2/environment/pull_bucket.py b/tasks/0012_593_12593899_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_593_12593899_qa_2/environment/pull_bucket.py +++ b/tasks/0012_593_12593899_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_593_12593899_qa_2/task.toml b/tasks/0012_593_12593899_qa_2/task.toml index fca658790cc53ebf41ab4ef37b1789384f30d674..5d197e6b677d29df8ce781b69646dbf2fdb4149c 100644 --- a/tasks/0012_593_12593899_qa_2/task.toml +++ b/tasks/0012_593_12593899_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_689_12689524_qa_2/environment/bootstrap.sh b/tasks/0012_689_12689524_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_689_12689524_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_689_12689524_qa_2/environment/pull_bucket.py b/tasks/0012_689_12689524_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_689_12689524_qa_2/environment/pull_bucket.py +++ b/tasks/0012_689_12689524_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_689_12689524_qa_2/task.toml b/tasks/0012_689_12689524_qa_2/task.toml index 4c5afdfb129aa71e31680c616bbafc0d74c15f61..493ee0f6b911221d8becddfcae46c15903988381 100644 --- a/tasks/0012_689_12689524_qa_2/task.toml +++ b/tasks/0012_689_12689524_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_689_12689524_qa_4/environment/bootstrap.sh b/tasks/0012_689_12689524_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_689_12689524_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_689_12689524_qa_4/environment/pull_bucket.py b/tasks/0012_689_12689524_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_689_12689524_qa_4/environment/pull_bucket.py +++ b/tasks/0012_689_12689524_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_689_12689524_qa_4/task.toml b/tasks/0012_689_12689524_qa_4/task.toml index 22d5323c3dda2977eebe4f96d0cbd5a86fbe3e42..b2bdbfcc7f49e3f010514db47e2893a0b84ff9b8 100644 --- a/tasks/0012_689_12689524_qa_4/task.toml +++ b/tasks/0012_689_12689524_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_748_12748314_qa_1/environment/bootstrap.sh b/tasks/0012_748_12748314_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_748_12748314_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_748_12748314_qa_1/environment/pull_bucket.py b/tasks/0012_748_12748314_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_748_12748314_qa_1/environment/pull_bucket.py +++ b/tasks/0012_748_12748314_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_748_12748314_qa_1/task.toml b/tasks/0012_748_12748314_qa_1/task.toml index 224cc32a582f3d170c2625769d7b0733d6523386..47ac3a44878d76ad2e493cf0bb86dfc1c89b2a3a 100644 --- a/tasks/0012_748_12748314_qa_1/task.toml +++ b/tasks/0012_748_12748314_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_748_12748314_qa_3/environment/bootstrap.sh b/tasks/0012_748_12748314_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_748_12748314_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_748_12748314_qa_3/environment/pull_bucket.py b/tasks/0012_748_12748314_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_748_12748314_qa_3/environment/pull_bucket.py +++ b/tasks/0012_748_12748314_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_748_12748314_qa_3/task.toml b/tasks/0012_748_12748314_qa_3/task.toml index 780f8c161cd107e89b19135bb5fec3749f87645e..49c498eeb35d2168a9705871d8077651e499ed9e 100644 --- a/tasks/0012_748_12748314_qa_3/task.toml +++ b/tasks/0012_748_12748314_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_748_12748314_qa_4/environment/bootstrap.sh b/tasks/0012_748_12748314_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_748_12748314_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_748_12748314_qa_4/environment/pull_bucket.py b/tasks/0012_748_12748314_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_748_12748314_qa_4/environment/pull_bucket.py +++ b/tasks/0012_748_12748314_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_748_12748314_qa_4/task.toml b/tasks/0012_748_12748314_qa_4/task.toml index d58badf6a25b14f6b9649d8f8bab7844603811ee..c28bf32e14d499b07ba18fc72eaa0a04dbec2b97 100644 --- a/tasks/0012_748_12748314_qa_4/task.toml +++ b/tasks/0012_748_12748314_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_761_12761066_qa_2/environment/bootstrap.sh b/tasks/0012_761_12761066_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_761_12761066_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_761_12761066_qa_2/environment/pull_bucket.py b/tasks/0012_761_12761066_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_761_12761066_qa_2/environment/pull_bucket.py +++ b/tasks/0012_761_12761066_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_761_12761066_qa_2/task.toml b/tasks/0012_761_12761066_qa_2/task.toml index a9d7600d1bdc99c5d65276e2edc49b6ba2329f1b..9951bf8884d28cd588b0d323e1eeb430d4b0199e 100644 --- a/tasks/0012_761_12761066_qa_2/task.toml +++ b/tasks/0012_761_12761066_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_834_12834655_qa_4/environment/bootstrap.sh b/tasks/0012_834_12834655_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_834_12834655_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_834_12834655_qa_4/environment/pull_bucket.py b/tasks/0012_834_12834655_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_834_12834655_qa_4/environment/pull_bucket.py +++ b/tasks/0012_834_12834655_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_834_12834655_qa_4/task.toml b/tasks/0012_834_12834655_qa_4/task.toml index c411b308fd853ed9d6d23536aff2fd2790765aa7..6c999ce98aa419f1f3af207f21ed6b1993495eff 100644 --- a/tasks/0012_834_12834655_qa_4/task.toml +++ b/tasks/0012_834_12834655_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_840_12840531_qa_5/environment/bootstrap.sh b/tasks/0012_840_12840531_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_840_12840531_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_840_12840531_qa_5/environment/pull_bucket.py b/tasks/0012_840_12840531_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_840_12840531_qa_5/environment/pull_bucket.py +++ b/tasks/0012_840_12840531_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_840_12840531_qa_5/task.toml b/tasks/0012_840_12840531_qa_5/task.toml index 9afe5d663559773a9942f66d9830cee8fbdada80..b77078cd825658bf310a96c3074d312adb36a8f1 100644 --- a/tasks/0012_840_12840531_qa_5/task.toml +++ b/tasks/0012_840_12840531_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_856_12856368_qa_3/environment/bootstrap.sh b/tasks/0012_856_12856368_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_856_12856368_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_856_12856368_qa_3/environment/pull_bucket.py b/tasks/0012_856_12856368_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_856_12856368_qa_3/environment/pull_bucket.py +++ b/tasks/0012_856_12856368_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_856_12856368_qa_3/task.toml b/tasks/0012_856_12856368_qa_3/task.toml index 1c5235d79cefad2716251507e0bebe06a75fa382..f9b73fa82c215f59917b20dc8ad8e1487c8bd674 100644 --- a/tasks/0012_856_12856368_qa_3/task.toml +++ b/tasks/0012_856_12856368_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_920_12920904_qa_2/environment/bootstrap.sh b/tasks/0012_920_12920904_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_920_12920904_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_920_12920904_qa_2/environment/pull_bucket.py b/tasks/0012_920_12920904_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_920_12920904_qa_2/environment/pull_bucket.py +++ b/tasks/0012_920_12920904_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_920_12920904_qa_2/task.toml b/tasks/0012_920_12920904_qa_2/task.toml index 523495742dd7d9dc87a53b98738afaf05d34587b..cad55b950e33181fb613839534b0d4f346363009 100644 --- a/tasks/0012_920_12920904_qa_2/task.toml +++ b/tasks/0012_920_12920904_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_920_12920904_qa_4/environment/bootstrap.sh b/tasks/0012_920_12920904_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_920_12920904_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_920_12920904_qa_4/environment/pull_bucket.py b/tasks/0012_920_12920904_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_920_12920904_qa_4/environment/pull_bucket.py +++ b/tasks/0012_920_12920904_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_920_12920904_qa_4/task.toml b/tasks/0012_920_12920904_qa_4/task.toml index 77aa041d3c75d299e0c5e842ad457040c9e512e8..f9dff14af0465ce801e018714d4a63e83d972081 100644 --- a/tasks/0012_920_12920904_qa_4/task.toml +++ b/tasks/0012_920_12920904_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_920_12920904_qa_5/environment/bootstrap.sh b/tasks/0012_920_12920904_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_920_12920904_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_920_12920904_qa_5/environment/pull_bucket.py b/tasks/0012_920_12920904_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_920_12920904_qa_5/environment/pull_bucket.py +++ b/tasks/0012_920_12920904_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_920_12920904_qa_5/task.toml b/tasks/0012_920_12920904_qa_5/task.toml index 95e92f86ee80fddda4b57a7a846fe6a299ac37d1..e77ecf31c2cfcc84647fd0aeed3cd8cafe6ab35c 100644 --- a/tasks/0012_920_12920904_qa_5/task.toml +++ b/tasks/0012_920_12920904_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_941_12941575_qa_2/environment/bootstrap.sh b/tasks/0012_941_12941575_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_941_12941575_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_941_12941575_qa_2/environment/pull_bucket.py b/tasks/0012_941_12941575_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_941_12941575_qa_2/environment/pull_bucket.py +++ b/tasks/0012_941_12941575_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_941_12941575_qa_2/task.toml b/tasks/0012_941_12941575_qa_2/task.toml index 63d795762c761e3837dcdad62557493e3bbad8c8..9377c2041f97ec735f604673082de3b16ab54a63 100644 --- a/tasks/0012_941_12941575_qa_2/task.toml +++ b/tasks/0012_941_12941575_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_949_12949007_qa_3/environment/bootstrap.sh b/tasks/0012_949_12949007_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_949_12949007_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_949_12949007_qa_3/environment/pull_bucket.py b/tasks/0012_949_12949007_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_949_12949007_qa_3/environment/pull_bucket.py +++ b/tasks/0012_949_12949007_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_949_12949007_qa_3/task.toml b/tasks/0012_949_12949007_qa_3/task.toml index bd5fac182e93bae7c77a3bbf2b68355f55b4f318..22b1cdb8499f1ac63e8ef9948940345a5ac977c7 100644 --- a/tasks/0012_949_12949007_qa_3/task.toml +++ b/tasks/0012_949_12949007_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_949_12949007_qa_4/environment/bootstrap.sh b/tasks/0012_949_12949007_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_949_12949007_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_949_12949007_qa_4/environment/pull_bucket.py b/tasks/0012_949_12949007_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_949_12949007_qa_4/environment/pull_bucket.py +++ b/tasks/0012_949_12949007_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_949_12949007_qa_4/task.toml b/tasks/0012_949_12949007_qa_4/task.toml index f8e515f5937939fa869ea4f4be638372c3a4c9c8..266d56382957dd503855727546b12932363fe968 100644 --- a/tasks/0012_949_12949007_qa_4/task.toml +++ b/tasks/0012_949_12949007_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_972_12972339_qa_3/environment/bootstrap.sh b/tasks/0012_972_12972339_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_972_12972339_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_972_12972339_qa_3/environment/pull_bucket.py b/tasks/0012_972_12972339_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_972_12972339_qa_3/environment/pull_bucket.py +++ b/tasks/0012_972_12972339_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_972_12972339_qa_3/task.toml b/tasks/0012_972_12972339_qa_3/task.toml index 1e3e0879059f3dab5444954d8a7610d3a219fc58..47aca1a0156f35b2335f837c3bf993f201443f65 100644 --- a/tasks/0012_972_12972339_qa_3/task.toml +++ b/tasks/0012_972_12972339_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_992_12992267_qa_3/environment/bootstrap.sh b/tasks/0012_992_12992267_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_992_12992267_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_992_12992267_qa_3/environment/pull_bucket.py b/tasks/0012_992_12992267_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_992_12992267_qa_3/environment/pull_bucket.py +++ b/tasks/0012_992_12992267_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_992_12992267_qa_3/task.toml b/tasks/0012_992_12992267_qa_3/task.toml index b166768b37d63d3df1d1418f0843dedd556a730e..447e546d1713031f6f29f5f1a0d8907e8cf75964 100644 --- a/tasks/0012_992_12992267_qa_3/task.toml +++ b/tasks/0012_992_12992267_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0012_992_12992267_qa_5/environment/bootstrap.sh b/tasks/0012_992_12992267_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0012_992_12992267_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0012_992_12992267_qa_5/environment/pull_bucket.py b/tasks/0012_992_12992267_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0012_992_12992267_qa_5/environment/pull_bucket.py +++ b/tasks/0012_992_12992267_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0012_992_12992267_qa_5/task.toml b/tasks/0012_992_12992267_qa_5/task.toml index 372929817e9011a3ca6838eae10ad281c0ee820b..754e34be11727edf377256c4035eae7c984bc5ca 100644 --- a/tasks/0012_992_12992267_qa_5/task.toml +++ b/tasks/0012_992_12992267_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_067_13067540_qa_4/environment/bootstrap.sh b/tasks/0013_067_13067540_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_067_13067540_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_067_13067540_qa_4/environment/pull_bucket.py b/tasks/0013_067_13067540_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_067_13067540_qa_4/environment/pull_bucket.py +++ b/tasks/0013_067_13067540_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_067_13067540_qa_4/task.toml b/tasks/0013_067_13067540_qa_4/task.toml index 7d1a82b3d2b0c6c2c94af0e8271eb4168b957463..6c829b1cf7b332486e541e389444e70670725a7e 100644 --- a/tasks/0013_067_13067540_qa_4/task.toml +++ b/tasks/0013_067_13067540_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_072_13072460_qa_4/environment/bootstrap.sh b/tasks/0013_072_13072460_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_072_13072460_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_072_13072460_qa_4/environment/pull_bucket.py b/tasks/0013_072_13072460_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_072_13072460_qa_4/environment/pull_bucket.py +++ b/tasks/0013_072_13072460_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_072_13072460_qa_4/task.toml b/tasks/0013_072_13072460_qa_4/task.toml index 85687066a8b8f83f2c3e2b2197a37a9eacbed844..54d8c47aee686ac7efc63926b0dbd757de4bbead 100644 --- a/tasks/0013_072_13072460_qa_4/task.toml +++ b/tasks/0013_072_13072460_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_081_13081151_qa_1/environment/bootstrap.sh b/tasks/0013_081_13081151_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_081_13081151_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_081_13081151_qa_1/environment/pull_bucket.py b/tasks/0013_081_13081151_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_081_13081151_qa_1/environment/pull_bucket.py +++ b/tasks/0013_081_13081151_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_081_13081151_qa_1/task.toml b/tasks/0013_081_13081151_qa_1/task.toml index d86a4078397af02e6f47257e2bb78cc791d3a1f1..ba90d92ac6c160d25fccc8a997c284adb6015999 100644 --- a/tasks/0013_081_13081151_qa_1/task.toml +++ b/tasks/0013_081_13081151_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_081_13081725_qa_3/environment/bootstrap.sh b/tasks/0013_081_13081725_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_081_13081725_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_081_13081725_qa_3/environment/pull_bucket.py b/tasks/0013_081_13081725_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_081_13081725_qa_3/environment/pull_bucket.py +++ b/tasks/0013_081_13081725_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_081_13081725_qa_3/task.toml b/tasks/0013_081_13081725_qa_3/task.toml index 1cab915c85285f4bd10ad29f11dcdb9982f26268..dbf180c4b20ee1ea2b6f599f79d108e23c5a4e78 100644 --- a/tasks/0013_081_13081725_qa_3/task.toml +++ b/tasks/0013_081_13081725_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_126_13126909_qa_2/environment/bootstrap.sh b/tasks/0013_126_13126909_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_126_13126909_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_126_13126909_qa_2/environment/pull_bucket.py b/tasks/0013_126_13126909_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_126_13126909_qa_2/environment/pull_bucket.py +++ b/tasks/0013_126_13126909_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_126_13126909_qa_2/task.toml b/tasks/0013_126_13126909_qa_2/task.toml index 001d4b9da2457fc050c79f3ed8bc3c10ab969e8f..f07d3d48dc01a8494c334e8ba9081ebffe9ac203 100644 --- a/tasks/0013_126_13126909_qa_2/task.toml +++ b/tasks/0013_126_13126909_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_126_13126909_qa_3/environment/bootstrap.sh b/tasks/0013_126_13126909_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_126_13126909_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_126_13126909_qa_3/environment/pull_bucket.py b/tasks/0013_126_13126909_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_126_13126909_qa_3/environment/pull_bucket.py +++ b/tasks/0013_126_13126909_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_126_13126909_qa_3/task.toml b/tasks/0013_126_13126909_qa_3/task.toml index add8167cfa1b579ecaa9f65b6f12b592f62b0899..703b83c4823d4394e255406e486049437922a458 100644 --- a/tasks/0013_126_13126909_qa_3/task.toml +++ b/tasks/0013_126_13126909_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_126_13126909_qa_4/environment/bootstrap.sh b/tasks/0013_126_13126909_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_126_13126909_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_126_13126909_qa_4/environment/pull_bucket.py b/tasks/0013_126_13126909_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_126_13126909_qa_4/environment/pull_bucket.py +++ b/tasks/0013_126_13126909_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_126_13126909_qa_4/task.toml b/tasks/0013_126_13126909_qa_4/task.toml index ddaf4390fbca9ed5122a2d93af9ebb36b47a1413..e2d9edb3458af4e424799fe8d80a271381f0fef7 100644 --- a/tasks/0013_126_13126909_qa_4/task.toml +++ b/tasks/0013_126_13126909_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_169_13169934_qa_5/environment/bootstrap.sh b/tasks/0013_169_13169934_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_169_13169934_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_169_13169934_qa_5/environment/pull_bucket.py b/tasks/0013_169_13169934_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_169_13169934_qa_5/environment/pull_bucket.py +++ b/tasks/0013_169_13169934_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_169_13169934_qa_5/task.toml b/tasks/0013_169_13169934_qa_5/task.toml index 967ce25fbf37ce29dd5e2843bd96e0aeb9a806e4..0314fc1c613caaf1f12f6f7d439ac10e4d74c030 100644 --- a/tasks/0013_169_13169934_qa_5/task.toml +++ b/tasks/0013_169_13169934_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_170_13170004_qa_5/environment/bootstrap.sh b/tasks/0013_170_13170004_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_170_13170004_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_170_13170004_qa_5/environment/pull_bucket.py b/tasks/0013_170_13170004_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_170_13170004_qa_5/environment/pull_bucket.py +++ b/tasks/0013_170_13170004_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_170_13170004_qa_5/task.toml b/tasks/0013_170_13170004_qa_5/task.toml index 01388d14e058cd7b22c927a3ac981f1f67795fe9..69bb95f7f547c9e29020d56b95e1e8ce82fe4a7f 100644 --- a/tasks/0013_170_13170004_qa_5/task.toml +++ b/tasks/0013_170_13170004_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_225_13225334_qa_2/environment/bootstrap.sh b/tasks/0013_225_13225334_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_225_13225334_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_225_13225334_qa_2/environment/pull_bucket.py b/tasks/0013_225_13225334_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_225_13225334_qa_2/environment/pull_bucket.py +++ b/tasks/0013_225_13225334_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_225_13225334_qa_2/task.toml b/tasks/0013_225_13225334_qa_2/task.toml index 59371815f9f7aed6c9b2509052bf0957587d0fb9..b146113b9fcb32a49a565075afadbf72292c6819 100644 --- a/tasks/0013_225_13225334_qa_2/task.toml +++ b/tasks/0013_225_13225334_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_310_13310368_qa_1/environment/bootstrap.sh b/tasks/0013_310_13310368_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_310_13310368_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_310_13310368_qa_1/environment/pull_bucket.py b/tasks/0013_310_13310368_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_310_13310368_qa_1/environment/pull_bucket.py +++ b/tasks/0013_310_13310368_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_310_13310368_qa_1/task.toml b/tasks/0013_310_13310368_qa_1/task.toml index ca86c8f6088c1a7f94a041cfff699e74e1e2920e..8dba47613cd88b37afa2b88e5e2e26f91be80c05 100644 --- a/tasks/0013_310_13310368_qa_1/task.toml +++ b/tasks/0013_310_13310368_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_355_13355821_qa_2/environment/bootstrap.sh b/tasks/0013_355_13355821_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_355_13355821_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_355_13355821_qa_2/environment/pull_bucket.py b/tasks/0013_355_13355821_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_355_13355821_qa_2/environment/pull_bucket.py +++ b/tasks/0013_355_13355821_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_355_13355821_qa_2/task.toml b/tasks/0013_355_13355821_qa_2/task.toml index 191540b73748dae4a40ad30c116c67683126b47b..82a1eefdae0328fe7147c30b3d81cdc235bca95c 100644 --- a/tasks/0013_355_13355821_qa_2/task.toml +++ b/tasks/0013_355_13355821_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_408_13408860_qa_5/environment/bootstrap.sh b/tasks/0013_408_13408860_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_408_13408860_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_408_13408860_qa_5/environment/pull_bucket.py b/tasks/0013_408_13408860_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_408_13408860_qa_5/environment/pull_bucket.py +++ b/tasks/0013_408_13408860_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_408_13408860_qa_5/task.toml b/tasks/0013_408_13408860_qa_5/task.toml index 4142281a87b262d07ba3448822d3a36fbcd4495f..eba6a8891e5c4201046a2d228e33dae378b83403 100644 --- a/tasks/0013_408_13408860_qa_5/task.toml +++ b/tasks/0013_408_13408860_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_444_13444633_qa_2/environment/bootstrap.sh b/tasks/0013_444_13444633_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_444_13444633_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_444_13444633_qa_2/environment/pull_bucket.py b/tasks/0013_444_13444633_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_444_13444633_qa_2/environment/pull_bucket.py +++ b/tasks/0013_444_13444633_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_444_13444633_qa_2/task.toml b/tasks/0013_444_13444633_qa_2/task.toml index cb5743ae60bdfe378e312ef1098f36ba864a7e86..306edf07ef00d503e0c0edad8b2911bf4f5d7725 100644 --- a/tasks/0013_444_13444633_qa_2/task.toml +++ b/tasks/0013_444_13444633_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_444_13444633_qa_4/environment/bootstrap.sh b/tasks/0013_444_13444633_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_444_13444633_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_444_13444633_qa_4/environment/pull_bucket.py b/tasks/0013_444_13444633_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_444_13444633_qa_4/environment/pull_bucket.py +++ b/tasks/0013_444_13444633_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_444_13444633_qa_4/task.toml b/tasks/0013_444_13444633_qa_4/task.toml index 6cb7a1aac1212c57027304e11417fe54aea3ab7e..b80ff2463fa0e5e0df9a67a8109319fa178ea079 100644 --- a/tasks/0013_444_13444633_qa_4/task.toml +++ b/tasks/0013_444_13444633_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_457_13457318_qa_3/environment/bootstrap.sh b/tasks/0013_457_13457318_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_457_13457318_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_457_13457318_qa_3/environment/pull_bucket.py b/tasks/0013_457_13457318_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_457_13457318_qa_3/environment/pull_bucket.py +++ b/tasks/0013_457_13457318_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_457_13457318_qa_3/task.toml b/tasks/0013_457_13457318_qa_3/task.toml index 58564fe6dc5dde784aa4cfeadab58180fcba4f14..d3b73565b4e6a0e8a55edf4bd4a08c42fc7784f1 100644 --- a/tasks/0013_457_13457318_qa_3/task.toml +++ b/tasks/0013_457_13457318_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_462_13462877_qa_1/environment/bootstrap.sh b/tasks/0013_462_13462877_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_462_13462877_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_462_13462877_qa_1/environment/pull_bucket.py b/tasks/0013_462_13462877_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_462_13462877_qa_1/environment/pull_bucket.py +++ b/tasks/0013_462_13462877_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_462_13462877_qa_1/task.toml b/tasks/0013_462_13462877_qa_1/task.toml index 0a3f940e480024a9011ac54583864aa4952fee6a..446a9cf24e7eda4452d73d6454cffbd6f01096ce 100644 --- a/tasks/0013_462_13462877_qa_1/task.toml +++ b/tasks/0013_462_13462877_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_523_13523088_qa_4/environment/bootstrap.sh b/tasks/0013_523_13523088_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_523_13523088_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_523_13523088_qa_4/environment/pull_bucket.py b/tasks/0013_523_13523088_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_523_13523088_qa_4/environment/pull_bucket.py +++ b/tasks/0013_523_13523088_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_523_13523088_qa_4/task.toml b/tasks/0013_523_13523088_qa_4/task.toml index 0013af6ea70ee3192918c33936dbce55877a8b88..05a928b24f3b39b0e21029417cbdf882eb198116 100644 --- a/tasks/0013_523_13523088_qa_4/task.toml +++ b/tasks/0013_523_13523088_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_523_13523088_qa_5/environment/bootstrap.sh b/tasks/0013_523_13523088_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_523_13523088_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_523_13523088_qa_5/environment/pull_bucket.py b/tasks/0013_523_13523088_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_523_13523088_qa_5/environment/pull_bucket.py +++ b/tasks/0013_523_13523088_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_523_13523088_qa_5/task.toml b/tasks/0013_523_13523088_qa_5/task.toml index c5b558c70aec2d7c8ce544f88e68ff1c3efbb97b..8281985c485aa3f9ffd6f464f27f82ca3d83f246 100644 --- a/tasks/0013_523_13523088_qa_5/task.toml +++ b/tasks/0013_523_13523088_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_604_13604091_qa_2/environment/bootstrap.sh b/tasks/0013_604_13604091_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_604_13604091_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_604_13604091_qa_2/environment/pull_bucket.py b/tasks/0013_604_13604091_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_604_13604091_qa_2/environment/pull_bucket.py +++ b/tasks/0013_604_13604091_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_604_13604091_qa_2/task.toml b/tasks/0013_604_13604091_qa_2/task.toml index 9dcd362472d3be63e22033ec9f1a321947a30c8a..4392ab49162ba0c2979a60705c1297c529b2d80b 100644 --- a/tasks/0013_604_13604091_qa_2/task.toml +++ b/tasks/0013_604_13604091_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_613_13613426_qa_5/environment/bootstrap.sh b/tasks/0013_613_13613426_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_613_13613426_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_613_13613426_qa_5/environment/pull_bucket.py b/tasks/0013_613_13613426_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_613_13613426_qa_5/environment/pull_bucket.py +++ b/tasks/0013_613_13613426_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_613_13613426_qa_5/task.toml b/tasks/0013_613_13613426_qa_5/task.toml index 64f6e8508d8e071a4c74dcf55cad2d7ee8e54b78..75cefe73360dc0391c6adfe963144f33a958ae1a 100644 --- a/tasks/0013_613_13613426_qa_5/task.toml +++ b/tasks/0013_613_13613426_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_655_13655596_qa_1/environment/bootstrap.sh b/tasks/0013_655_13655596_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_655_13655596_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_655_13655596_qa_1/environment/pull_bucket.py b/tasks/0013_655_13655596_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_655_13655596_qa_1/environment/pull_bucket.py +++ b/tasks/0013_655_13655596_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_655_13655596_qa_1/task.toml b/tasks/0013_655_13655596_qa_1/task.toml index afd08f113f39444b19157f4198051a21a8add8db..5c8af0c4e13fd5a3eac8cff06e760902af70d1f0 100644 --- a/tasks/0013_655_13655596_qa_1/task.toml +++ b/tasks/0013_655_13655596_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_708_13708498_qa_4/environment/bootstrap.sh b/tasks/0013_708_13708498_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_708_13708498_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_708_13708498_qa_4/environment/pull_bucket.py b/tasks/0013_708_13708498_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_708_13708498_qa_4/environment/pull_bucket.py +++ b/tasks/0013_708_13708498_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_708_13708498_qa_4/task.toml b/tasks/0013_708_13708498_qa_4/task.toml index 39112c10c0b403cc4eb8e1716b7e1e50f13c29f8..03dcc4dedd806fbfd5882bd9442d32568383452a 100644 --- a/tasks/0013_708_13708498_qa_4/task.toml +++ b/tasks/0013_708_13708498_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_733_13733964_qa_1/environment/bootstrap.sh b/tasks/0013_733_13733964_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_733_13733964_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_733_13733964_qa_1/environment/pull_bucket.py b/tasks/0013_733_13733964_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_733_13733964_qa_1/environment/pull_bucket.py +++ b/tasks/0013_733_13733964_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_733_13733964_qa_1/task.toml b/tasks/0013_733_13733964_qa_1/task.toml index 299088a8095056ce4dbadae03b9215f62e976b1d..1732852ef9e603df6e6643f42cbb35d749bc932e 100644 --- a/tasks/0013_733_13733964_qa_1/task.toml +++ b/tasks/0013_733_13733964_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_733_13733964_qa_2/environment/bootstrap.sh b/tasks/0013_733_13733964_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_733_13733964_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_733_13733964_qa_2/environment/pull_bucket.py b/tasks/0013_733_13733964_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_733_13733964_qa_2/environment/pull_bucket.py +++ b/tasks/0013_733_13733964_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_733_13733964_qa_2/task.toml b/tasks/0013_733_13733964_qa_2/task.toml index 11a2986e717c466b77b4bb24f06968fdbbb6d7ba..47bf8a89cc2bac99fa21b950cf602573c2250600 100644 --- a/tasks/0013_733_13733964_qa_2/task.toml +++ b/tasks/0013_733_13733964_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_733_13733964_qa_3/environment/bootstrap.sh b/tasks/0013_733_13733964_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_733_13733964_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_733_13733964_qa_3/environment/pull_bucket.py b/tasks/0013_733_13733964_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_733_13733964_qa_3/environment/pull_bucket.py +++ b/tasks/0013_733_13733964_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_733_13733964_qa_3/task.toml b/tasks/0013_733_13733964_qa_3/task.toml index 691c10513eb443605b3135d40d131f34e5b1599d..0d2e240ad710354f8554fd6e33f0a176da66db59 100644 --- a/tasks/0013_733_13733964_qa_3/task.toml +++ b/tasks/0013_733_13733964_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_733_13733964_qa_4/environment/bootstrap.sh b/tasks/0013_733_13733964_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_733_13733964_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_733_13733964_qa_4/environment/pull_bucket.py b/tasks/0013_733_13733964_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_733_13733964_qa_4/environment/pull_bucket.py +++ b/tasks/0013_733_13733964_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_733_13733964_qa_4/task.toml b/tasks/0013_733_13733964_qa_4/task.toml index 69a399e96cff90a37e1fad91900835ee93cdb1b3..c12145674b314fedbdaf8805655c0609dbe6e2b5 100644 --- a/tasks/0013_733_13733964_qa_4/task.toml +++ b/tasks/0013_733_13733964_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_733_13733964_qa_5/environment/bootstrap.sh b/tasks/0013_733_13733964_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_733_13733964_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_733_13733964_qa_5/environment/pull_bucket.py b/tasks/0013_733_13733964_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_733_13733964_qa_5/environment/pull_bucket.py +++ b/tasks/0013_733_13733964_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_733_13733964_qa_5/task.toml b/tasks/0013_733_13733964_qa_5/task.toml index a3c2592308b0ac83a17394b7376dc6137c593fff..c342243b582c9cd9b7197e72968ff7cf8ba5566c 100644 --- a/tasks/0013_733_13733964_qa_5/task.toml +++ b/tasks/0013_733_13733964_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_748_13748223_qa_1/environment/bootstrap.sh b/tasks/0013_748_13748223_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_748_13748223_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_748_13748223_qa_1/environment/pull_bucket.py b/tasks/0013_748_13748223_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_748_13748223_qa_1/environment/pull_bucket.py +++ b/tasks/0013_748_13748223_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_748_13748223_qa_1/task.toml b/tasks/0013_748_13748223_qa_1/task.toml index 24dcca6081859998f0ae00bed8ad287f1de05e02..fcfb9ad1160a26285c03c637034f88ab9cffa616 100644 --- a/tasks/0013_748_13748223_qa_1/task.toml +++ b/tasks/0013_748_13748223_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_769_13769567_qa_2/environment/bootstrap.sh b/tasks/0013_769_13769567_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_769_13769567_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_769_13769567_qa_2/environment/pull_bucket.py b/tasks/0013_769_13769567_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_769_13769567_qa_2/environment/pull_bucket.py +++ b/tasks/0013_769_13769567_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_769_13769567_qa_2/task.toml b/tasks/0013_769_13769567_qa_2/task.toml index 42651c843650ee0341e98b18dd9d575a06fa428a..f9d7e3a482915ba7bba94b26d69d9d086c9b1cfb 100644 --- a/tasks/0013_769_13769567_qa_2/task.toml +++ b/tasks/0013_769_13769567_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_769_13769567_qa_5/environment/bootstrap.sh b/tasks/0013_769_13769567_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_769_13769567_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_769_13769567_qa_5/environment/pull_bucket.py b/tasks/0013_769_13769567_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_769_13769567_qa_5/environment/pull_bucket.py +++ b/tasks/0013_769_13769567_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_769_13769567_qa_5/task.toml b/tasks/0013_769_13769567_qa_5/task.toml index 492e72ea61079d610d367b4d63212c7df8085a72..a50f21d8453808ef3c4a57f3895f299a8f2b9139 100644 --- a/tasks/0013_769_13769567_qa_5/task.toml +++ b/tasks/0013_769_13769567_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_791_13791869_qa_3/environment/bootstrap.sh b/tasks/0013_791_13791869_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_791_13791869_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_791_13791869_qa_3/environment/pull_bucket.py b/tasks/0013_791_13791869_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_791_13791869_qa_3/environment/pull_bucket.py +++ b/tasks/0013_791_13791869_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_791_13791869_qa_3/task.toml b/tasks/0013_791_13791869_qa_3/task.toml index a7504ba9984481301d7f257d654954bfb3ecef2e..b7d672071a0b37bf98c4f82245dc4ca391b2e536 100644 --- a/tasks/0013_791_13791869_qa_3/task.toml +++ b/tasks/0013_791_13791869_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_811_13811868_qa_3/environment/bootstrap.sh b/tasks/0013_811_13811868_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_811_13811868_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_811_13811868_qa_3/environment/pull_bucket.py b/tasks/0013_811_13811868_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_811_13811868_qa_3/environment/pull_bucket.py +++ b/tasks/0013_811_13811868_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_811_13811868_qa_3/task.toml b/tasks/0013_811_13811868_qa_3/task.toml index 2a482c2f95ac434e876bad787b28b83f36b62712..fb04c25bf900117a03cf8f2960d5e84865b2671c 100644 --- a/tasks/0013_811_13811868_qa_3/task.toml +++ b/tasks/0013_811_13811868_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_811_13811868_qa_5/environment/bootstrap.sh b/tasks/0013_811_13811868_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_811_13811868_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_811_13811868_qa_5/environment/pull_bucket.py b/tasks/0013_811_13811868_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_811_13811868_qa_5/environment/pull_bucket.py +++ b/tasks/0013_811_13811868_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_811_13811868_qa_5/task.toml b/tasks/0013_811_13811868_qa_5/task.toml index e307c9666b81fc5d4f2c374136828bcfa804ed0f..35759292b48e51f9646e757fc7f1f12021e3bbdf 100644 --- a/tasks/0013_811_13811868_qa_5/task.toml +++ b/tasks/0013_811_13811868_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_821_13821679_qa_4/environment/bootstrap.sh b/tasks/0013_821_13821679_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_821_13821679_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_821_13821679_qa_4/environment/pull_bucket.py b/tasks/0013_821_13821679_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_821_13821679_qa_4/environment/pull_bucket.py +++ b/tasks/0013_821_13821679_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_821_13821679_qa_4/task.toml b/tasks/0013_821_13821679_qa_4/task.toml index 6a2ae12da403ce14c6757654cae132a4dd9eefd3..f48d589ef24fef954687730917c74e2337a2ab06 100644 --- a/tasks/0013_821_13821679_qa_4/task.toml +++ b/tasks/0013_821_13821679_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_826_13826694_qa_5/environment/bootstrap.sh b/tasks/0013_826_13826694_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_826_13826694_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_826_13826694_qa_5/environment/pull_bucket.py b/tasks/0013_826_13826694_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_826_13826694_qa_5/environment/pull_bucket.py +++ b/tasks/0013_826_13826694_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_826_13826694_qa_5/task.toml b/tasks/0013_826_13826694_qa_5/task.toml index 735c257746f152292a0c306f999f1ba698b97875..c7e85696420f9cbc9001678e84bcdc564614e065 100644 --- a/tasks/0013_826_13826694_qa_5/task.toml +++ b/tasks/0013_826_13826694_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_839_13839617_qa_5/environment/bootstrap.sh b/tasks/0013_839_13839617_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_839_13839617_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_839_13839617_qa_5/environment/pull_bucket.py b/tasks/0013_839_13839617_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_839_13839617_qa_5/environment/pull_bucket.py +++ b/tasks/0013_839_13839617_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_839_13839617_qa_5/task.toml b/tasks/0013_839_13839617_qa_5/task.toml index 924d7cb042d9363502f31ed5014c0a05b82bcab0..62a61d642466f58f01caed07da585f73fddd45fb 100644 --- a/tasks/0013_839_13839617_qa_5/task.toml +++ b/tasks/0013_839_13839617_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_884_13884693_qa_1/environment/bootstrap.sh b/tasks/0013_884_13884693_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_884_13884693_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_884_13884693_qa_1/environment/pull_bucket.py b/tasks/0013_884_13884693_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_884_13884693_qa_1/environment/pull_bucket.py +++ b/tasks/0013_884_13884693_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_884_13884693_qa_1/task.toml b/tasks/0013_884_13884693_qa_1/task.toml index 81f207271cfb3fa00576214d7d0300784d51b0a8..5ac3775952fb00653b16ddb36104a1407a765bc0 100644 --- a/tasks/0013_884_13884693_qa_1/task.toml +++ b/tasks/0013_884_13884693_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0013_911_13911248_qa_1/environment/bootstrap.sh b/tasks/0013_911_13911248_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0013_911_13911248_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0013_911_13911248_qa_1/environment/pull_bucket.py b/tasks/0013_911_13911248_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0013_911_13911248_qa_1/environment/pull_bucket.py +++ b/tasks/0013_911_13911248_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0013_911_13911248_qa_1/task.toml b/tasks/0013_911_13911248_qa_1/task.toml index d32c62a1c599199c6f9f7c48f22eafdf0f971d70..c86c724df7b4dfd91a6e40910d58ac77193edafe 100644 --- a/tasks/0013_911_13911248_qa_1/task.toml +++ b/tasks/0013_911_13911248_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_089_14089673_qa_5/environment/bootstrap.sh b/tasks/0014_089_14089673_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_089_14089673_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_089_14089673_qa_5/environment/pull_bucket.py b/tasks/0014_089_14089673_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_089_14089673_qa_5/environment/pull_bucket.py +++ b/tasks/0014_089_14089673_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_089_14089673_qa_5/task.toml b/tasks/0014_089_14089673_qa_5/task.toml index 3242d690ce63fbe23f76d955d9dbe2877f1d4dbd..e6bd2d539c1c6715e4d51cb24056c06b1dec91d8 100644 --- a/tasks/0014_089_14089673_qa_5/task.toml +++ b/tasks/0014_089_14089673_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_115_14115737_qa_1/environment/bootstrap.sh b/tasks/0014_115_14115737_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_115_14115737_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_115_14115737_qa_1/environment/pull_bucket.py b/tasks/0014_115_14115737_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_115_14115737_qa_1/environment/pull_bucket.py +++ b/tasks/0014_115_14115737_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_115_14115737_qa_1/task.toml b/tasks/0014_115_14115737_qa_1/task.toml index 5bf1ab32f3e1384ca7edc9697fa5e2c129c7b509..f0dd70e9b472b31865865393e11040379be8702e 100644 --- a/tasks/0014_115_14115737_qa_1/task.toml +++ b/tasks/0014_115_14115737_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_124_14124969_qa_5/environment/bootstrap.sh b/tasks/0014_124_14124969_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_124_14124969_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_124_14124969_qa_5/environment/pull_bucket.py b/tasks/0014_124_14124969_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_124_14124969_qa_5/environment/pull_bucket.py +++ b/tasks/0014_124_14124969_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_124_14124969_qa_5/task.toml b/tasks/0014_124_14124969_qa_5/task.toml index 578f2668d28116d7bc44fe15990c09ca0bf80739..0ba08726e3855980dfcb39ffb7b8defde90b5927 100644 --- a/tasks/0014_124_14124969_qa_5/task.toml +++ b/tasks/0014_124_14124969_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_126_14126772_qa_4/environment/bootstrap.sh b/tasks/0014_126_14126772_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_126_14126772_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_126_14126772_qa_4/environment/pull_bucket.py b/tasks/0014_126_14126772_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_126_14126772_qa_4/environment/pull_bucket.py +++ b/tasks/0014_126_14126772_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_126_14126772_qa_4/task.toml b/tasks/0014_126_14126772_qa_4/task.toml index 4a71ef91770ba8cc1c8f1caac778be09f7713f6b..b03ee26535e7b44ced4574b4984f28eca5711eaf 100644 --- a/tasks/0014_126_14126772_qa_4/task.toml +++ b/tasks/0014_126_14126772_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_153_14153015_qa_3/environment/bootstrap.sh b/tasks/0014_153_14153015_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_153_14153015_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_153_14153015_qa_3/environment/pull_bucket.py b/tasks/0014_153_14153015_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_153_14153015_qa_3/environment/pull_bucket.py +++ b/tasks/0014_153_14153015_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_153_14153015_qa_3/task.toml b/tasks/0014_153_14153015_qa_3/task.toml index 27de79938c49db3909c47159126acb8e9760dc42..aec9eba467b2cb11b8ba06c0252d64860eb2ea1f 100644 --- a/tasks/0014_153_14153015_qa_3/task.toml +++ b/tasks/0014_153_14153015_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_164_14164509_qa_1/environment/bootstrap.sh b/tasks/0014_164_14164509_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_164_14164509_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_164_14164509_qa_1/environment/pull_bucket.py b/tasks/0014_164_14164509_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_164_14164509_qa_1/environment/pull_bucket.py +++ b/tasks/0014_164_14164509_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_164_14164509_qa_1/task.toml b/tasks/0014_164_14164509_qa_1/task.toml index 691a7480f4aec827cc9e297faf89be6904ceeced..787a0d5133d898b84865d2337964f339e5c804b3 100644 --- a/tasks/0014_164_14164509_qa_1/task.toml +++ b/tasks/0014_164_14164509_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_211_14211731_qa_3/environment/bootstrap.sh b/tasks/0014_211_14211731_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_211_14211731_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_211_14211731_qa_3/environment/pull_bucket.py b/tasks/0014_211_14211731_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_211_14211731_qa_3/environment/pull_bucket.py +++ b/tasks/0014_211_14211731_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_211_14211731_qa_3/task.toml b/tasks/0014_211_14211731_qa_3/task.toml index 5b062a6e64da09a9dc075c50823447a9450fcde8..59bc4de65dd78e0a0c10cf1e0502f6453bb6db9f 100644 --- a/tasks/0014_211_14211731_qa_3/task.toml +++ b/tasks/0014_211_14211731_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_211_14211731_qa_5/environment/bootstrap.sh b/tasks/0014_211_14211731_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_211_14211731_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_211_14211731_qa_5/environment/pull_bucket.py b/tasks/0014_211_14211731_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_211_14211731_qa_5/environment/pull_bucket.py +++ b/tasks/0014_211_14211731_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_211_14211731_qa_5/task.toml b/tasks/0014_211_14211731_qa_5/task.toml index 281d2e2d0bd2915f55319662f3b3b2f7b47812e4..0111475d2cd06b059a7192e52f34e3d3230b7903 100644 --- a/tasks/0014_211_14211731_qa_5/task.toml +++ b/tasks/0014_211_14211731_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_221_14221675_qa_1/environment/bootstrap.sh b/tasks/0014_221_14221675_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_221_14221675_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_221_14221675_qa_1/environment/pull_bucket.py b/tasks/0014_221_14221675_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_221_14221675_qa_1/environment/pull_bucket.py +++ b/tasks/0014_221_14221675_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_221_14221675_qa_1/task.toml b/tasks/0014_221_14221675_qa_1/task.toml index 71a258285578395cccddc73f48052230bcb7890b..a0b153480efb8a13d853bf979b14c2971f497a97 100644 --- a/tasks/0014_221_14221675_qa_1/task.toml +++ b/tasks/0014_221_14221675_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_312_14312130_qa_4/environment/bootstrap.sh b/tasks/0014_312_14312130_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_312_14312130_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_312_14312130_qa_4/environment/pull_bucket.py b/tasks/0014_312_14312130_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_312_14312130_qa_4/environment/pull_bucket.py +++ b/tasks/0014_312_14312130_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_312_14312130_qa_4/task.toml b/tasks/0014_312_14312130_qa_4/task.toml index 25b18ca020f15495e56380b257c61a72ea4fe624..73705923903d5a912a386398e2e0dcc885b6c771 100644 --- a/tasks/0014_312_14312130_qa_4/task.toml +++ b/tasks/0014_312_14312130_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_312_14312432_qa_4/environment/bootstrap.sh b/tasks/0014_312_14312432_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_312_14312432_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_312_14312432_qa_4/environment/pull_bucket.py b/tasks/0014_312_14312432_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_312_14312432_qa_4/environment/pull_bucket.py +++ b/tasks/0014_312_14312432_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_312_14312432_qa_4/task.toml b/tasks/0014_312_14312432_qa_4/task.toml index 03aee359c7359b11c51c390bf7a74bb11644f26b..edbb212f22238e34b87af6e527eb3c7da25b2594 100644 --- a/tasks/0014_312_14312432_qa_4/task.toml +++ b/tasks/0014_312_14312432_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_341_14341598_qa_1/environment/bootstrap.sh b/tasks/0014_341_14341598_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_341_14341598_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_341_14341598_qa_1/environment/pull_bucket.py b/tasks/0014_341_14341598_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_341_14341598_qa_1/environment/pull_bucket.py +++ b/tasks/0014_341_14341598_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_341_14341598_qa_1/task.toml b/tasks/0014_341_14341598_qa_1/task.toml index 65487019401c61c7ad16028f0b16cf2b35578dcb..369e633fcb5391c3af7f0004c6d7b01e235bdcdb 100644 --- a/tasks/0014_341_14341598_qa_1/task.toml +++ b/tasks/0014_341_14341598_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_351_14351012_qa_2/environment/bootstrap.sh b/tasks/0014_351_14351012_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_351_14351012_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_351_14351012_qa_2/environment/pull_bucket.py b/tasks/0014_351_14351012_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_351_14351012_qa_2/environment/pull_bucket.py +++ b/tasks/0014_351_14351012_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_351_14351012_qa_2/task.toml b/tasks/0014_351_14351012_qa_2/task.toml index c80a9be80dda62cb29992b179f1f692877d60adc..1ad83eb45efbd63f1a8887c7534e62e70b522c8d 100644 --- a/tasks/0014_351_14351012_qa_2/task.toml +++ b/tasks/0014_351_14351012_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_351_14351012_qa_5/environment/bootstrap.sh b/tasks/0014_351_14351012_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_351_14351012_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_351_14351012_qa_5/environment/pull_bucket.py b/tasks/0014_351_14351012_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_351_14351012_qa_5/environment/pull_bucket.py +++ b/tasks/0014_351_14351012_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_351_14351012_qa_5/task.toml b/tasks/0014_351_14351012_qa_5/task.toml index d326fa09c24ea2eedfa7b5d04936142d4297900c..3709015190efa62f18e337afa7c7b1e55c2ba05c 100644 --- a/tasks/0014_351_14351012_qa_5/task.toml +++ b/tasks/0014_351_14351012_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_358_14358635_qa_1/environment/bootstrap.sh b/tasks/0014_358_14358635_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_358_14358635_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_358_14358635_qa_1/environment/pull_bucket.py b/tasks/0014_358_14358635_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_358_14358635_qa_1/environment/pull_bucket.py +++ b/tasks/0014_358_14358635_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_358_14358635_qa_1/task.toml b/tasks/0014_358_14358635_qa_1/task.toml index e6c350aff399444b9b8c72efae51ef7b59609694..605cadab8a3b8008ab0ebfd257ca67ea17f4c7f6 100644 --- a/tasks/0014_358_14358635_qa_1/task.toml +++ b/tasks/0014_358_14358635_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_358_14358635_qa_4/environment/bootstrap.sh b/tasks/0014_358_14358635_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_358_14358635_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_358_14358635_qa_4/environment/pull_bucket.py b/tasks/0014_358_14358635_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_358_14358635_qa_4/environment/pull_bucket.py +++ b/tasks/0014_358_14358635_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_358_14358635_qa_4/task.toml b/tasks/0014_358_14358635_qa_4/task.toml index 258f86941fc10279b1a332a74a80675ae7da1899..57920f9e93fbb76f115cd6c9bd3e52afc2e6eb74 100644 --- a/tasks/0014_358_14358635_qa_4/task.toml +++ b/tasks/0014_358_14358635_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_367_14367970_qa_1/environment/bootstrap.sh b/tasks/0014_367_14367970_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_367_14367970_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_367_14367970_qa_1/environment/pull_bucket.py b/tasks/0014_367_14367970_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_367_14367970_qa_1/environment/pull_bucket.py +++ b/tasks/0014_367_14367970_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_367_14367970_qa_1/task.toml b/tasks/0014_367_14367970_qa_1/task.toml index 696e17bfe1416b594e38a0e37a6ff85e934d844e..87287b2474743b5cebea6885584aa889bd73b965 100644 --- a/tasks/0014_367_14367970_qa_1/task.toml +++ b/tasks/0014_367_14367970_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_390_14390255_qa_4/environment/bootstrap.sh b/tasks/0014_390_14390255_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_390_14390255_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_390_14390255_qa_4/environment/pull_bucket.py b/tasks/0014_390_14390255_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_390_14390255_qa_4/environment/pull_bucket.py +++ b/tasks/0014_390_14390255_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_390_14390255_qa_4/task.toml b/tasks/0014_390_14390255_qa_4/task.toml index e6a89c099ce7d276e231b35e4e3f4bc708a71bf3..949e76a4d3f1175060d9232a0667e8ca6ef5efb2 100644 --- a/tasks/0014_390_14390255_qa_4/task.toml +++ b/tasks/0014_390_14390255_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_390_14390255_qa_5/environment/bootstrap.sh b/tasks/0014_390_14390255_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_390_14390255_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_390_14390255_qa_5/environment/pull_bucket.py b/tasks/0014_390_14390255_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_390_14390255_qa_5/environment/pull_bucket.py +++ b/tasks/0014_390_14390255_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_390_14390255_qa_5/task.toml b/tasks/0014_390_14390255_qa_5/task.toml index 81a300d01c8fdc3f36a065f2c2509802dd82ed5b..80ab325b46687fc70c9f641f9729700ea9b7cd4b 100644 --- a/tasks/0014_390_14390255_qa_5/task.toml +++ b/tasks/0014_390_14390255_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_394_14394486_qa_3/environment/bootstrap.sh b/tasks/0014_394_14394486_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_394_14394486_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_394_14394486_qa_3/environment/pull_bucket.py b/tasks/0014_394_14394486_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_394_14394486_qa_3/environment/pull_bucket.py +++ b/tasks/0014_394_14394486_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_394_14394486_qa_3/task.toml b/tasks/0014_394_14394486_qa_3/task.toml index 21dfdf58cd730455b5198f21d472594787806d24..ff268a66888b81de664e730181012403e8c8960d 100644 --- a/tasks/0014_394_14394486_qa_3/task.toml +++ b/tasks/0014_394_14394486_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_428_14428721_qa_1/environment/bootstrap.sh b/tasks/0014_428_14428721_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_428_14428721_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_428_14428721_qa_1/environment/pull_bucket.py b/tasks/0014_428_14428721_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_428_14428721_qa_1/environment/pull_bucket.py +++ b/tasks/0014_428_14428721_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_428_14428721_qa_1/task.toml b/tasks/0014_428_14428721_qa_1/task.toml index f4789f3e7c41ccf93f653a2393f5f0115be437d4..6576a5ce9aea81fbbd183068d9b179e716e1c5ce 100644 --- a/tasks/0014_428_14428721_qa_1/task.toml +++ b/tasks/0014_428_14428721_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_428_14428721_qa_5/environment/bootstrap.sh b/tasks/0014_428_14428721_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_428_14428721_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_428_14428721_qa_5/environment/pull_bucket.py b/tasks/0014_428_14428721_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_428_14428721_qa_5/environment/pull_bucket.py +++ b/tasks/0014_428_14428721_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_428_14428721_qa_5/task.toml b/tasks/0014_428_14428721_qa_5/task.toml index 0ffb7586507406874b2d6a38e2a6985bf9954bf0..41c5d366c6603e787d3c6142e6a17bb62ff94d98 100644 --- a/tasks/0014_428_14428721_qa_5/task.toml +++ b/tasks/0014_428_14428721_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_432_14432687_qa_3/environment/bootstrap.sh b/tasks/0014_432_14432687_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_432_14432687_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_432_14432687_qa_3/environment/pull_bucket.py b/tasks/0014_432_14432687_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_432_14432687_qa_3/environment/pull_bucket.py +++ b/tasks/0014_432_14432687_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_432_14432687_qa_3/task.toml b/tasks/0014_432_14432687_qa_3/task.toml index 55e0dfd5369e99db4d441eb475ef52eff19ebc2a..756ab586c2ddbe34120ef27c41fae76d24737a45 100644 --- a/tasks/0014_432_14432687_qa_3/task.toml +++ b/tasks/0014_432_14432687_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_469_14469283_qa_1/environment/bootstrap.sh b/tasks/0014_469_14469283_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_469_14469283_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_469_14469283_qa_1/environment/pull_bucket.py b/tasks/0014_469_14469283_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_469_14469283_qa_1/environment/pull_bucket.py +++ b/tasks/0014_469_14469283_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_469_14469283_qa_1/task.toml b/tasks/0014_469_14469283_qa_1/task.toml index 109452f7cb5e75f5d54b3c6efe025f38ed05839c..54bf51f831e86267b90d68dcd444ec93ae4ebcd3 100644 --- a/tasks/0014_469_14469283_qa_1/task.toml +++ b/tasks/0014_469_14469283_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_469_14469283_qa_3/environment/bootstrap.sh b/tasks/0014_469_14469283_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_469_14469283_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_469_14469283_qa_3/environment/pull_bucket.py b/tasks/0014_469_14469283_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_469_14469283_qa_3/environment/pull_bucket.py +++ b/tasks/0014_469_14469283_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_469_14469283_qa_3/task.toml b/tasks/0014_469_14469283_qa_3/task.toml index 2a8d4d5c36b2ca375321f06bf82dcff1f3296010..7224ecc60ccd5c09b927aaa7068da049327f5497 100644 --- a/tasks/0014_469_14469283_qa_3/task.toml +++ b/tasks/0014_469_14469283_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_469_14469283_qa_4/environment/bootstrap.sh b/tasks/0014_469_14469283_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_469_14469283_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_469_14469283_qa_4/environment/pull_bucket.py b/tasks/0014_469_14469283_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_469_14469283_qa_4/environment/pull_bucket.py +++ b/tasks/0014_469_14469283_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_469_14469283_qa_4/task.toml b/tasks/0014_469_14469283_qa_4/task.toml index 2110e87850ac97ed032ad23632a6fe02cf54e35f..84b352126def673a034ee5df86bca84f7191ef8b 100644 --- a/tasks/0014_469_14469283_qa_4/task.toml +++ b/tasks/0014_469_14469283_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_565_14565651_qa_5/environment/bootstrap.sh b/tasks/0014_565_14565651_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_565_14565651_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_565_14565651_qa_5/environment/pull_bucket.py b/tasks/0014_565_14565651_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_565_14565651_qa_5/environment/pull_bucket.py +++ b/tasks/0014_565_14565651_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_565_14565651_qa_5/task.toml b/tasks/0014_565_14565651_qa_5/task.toml index de60a62a722d52250e0b2977df90045c46679779..fc9344fcbd7010b77532a81fab94c180c5a9a307 100644 --- a/tasks/0014_565_14565651_qa_5/task.toml +++ b/tasks/0014_565_14565651_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_579_14579474_qa_3/environment/bootstrap.sh b/tasks/0014_579_14579474_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_579_14579474_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_579_14579474_qa_3/environment/pull_bucket.py b/tasks/0014_579_14579474_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_579_14579474_qa_3/environment/pull_bucket.py +++ b/tasks/0014_579_14579474_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_579_14579474_qa_3/task.toml b/tasks/0014_579_14579474_qa_3/task.toml index b6b402eb0a40f277c6e3bcc4cfd22905f953d48d..b998b1c5cd48156810ac795b8435b7a59eeb4e54 100644 --- a/tasks/0014_579_14579474_qa_3/task.toml +++ b/tasks/0014_579_14579474_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_590_14590396_qa_2/environment/bootstrap.sh b/tasks/0014_590_14590396_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_590_14590396_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_590_14590396_qa_2/environment/pull_bucket.py b/tasks/0014_590_14590396_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_590_14590396_qa_2/environment/pull_bucket.py +++ b/tasks/0014_590_14590396_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_590_14590396_qa_2/task.toml b/tasks/0014_590_14590396_qa_2/task.toml index ae1277f0e4589aacfd27991247620cbc33974062..3902fc4b969cb46b5d7f231a1958e222bfa31daf 100644 --- a/tasks/0014_590_14590396_qa_2/task.toml +++ b/tasks/0014_590_14590396_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_590_14590396_qa_5/environment/bootstrap.sh b/tasks/0014_590_14590396_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_590_14590396_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_590_14590396_qa_5/environment/pull_bucket.py b/tasks/0014_590_14590396_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_590_14590396_qa_5/environment/pull_bucket.py +++ b/tasks/0014_590_14590396_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_590_14590396_qa_5/task.toml b/tasks/0014_590_14590396_qa_5/task.toml index 46375ddd62f1d9055d4309f40bc3bf63401c6fda..dcbada643cfba38c64fcbb07a91242f19ae8cbac 100644 --- a/tasks/0014_590_14590396_qa_5/task.toml +++ b/tasks/0014_590_14590396_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_613_14613843_qa_3/environment/bootstrap.sh b/tasks/0014_613_14613843_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_613_14613843_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_613_14613843_qa_3/environment/pull_bucket.py b/tasks/0014_613_14613843_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_613_14613843_qa_3/environment/pull_bucket.py +++ b/tasks/0014_613_14613843_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_613_14613843_qa_3/task.toml b/tasks/0014_613_14613843_qa_3/task.toml index c3978d041f3dec9de0904a06fd1a2a59868d25c3..2e7c83e383320de7214eeb34cb7b438595234bf1 100644 --- a/tasks/0014_613_14613843_qa_3/task.toml +++ b/tasks/0014_613_14613843_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_613_14613843_qa_4/environment/bootstrap.sh b/tasks/0014_613_14613843_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_613_14613843_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_613_14613843_qa_4/environment/pull_bucket.py b/tasks/0014_613_14613843_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_613_14613843_qa_4/environment/pull_bucket.py +++ b/tasks/0014_613_14613843_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_613_14613843_qa_4/task.toml b/tasks/0014_613_14613843_qa_4/task.toml index 27e6425f6eaf443a0321e7047583823f06cb651f..a85f7acf2faed96bba7e17d6964826bec971296e 100644 --- a/tasks/0014_613_14613843_qa_4/task.toml +++ b/tasks/0014_613_14613843_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_667_14667230_qa_5/environment/bootstrap.sh b/tasks/0014_667_14667230_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_667_14667230_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_667_14667230_qa_5/environment/pull_bucket.py b/tasks/0014_667_14667230_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_667_14667230_qa_5/environment/pull_bucket.py +++ b/tasks/0014_667_14667230_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_667_14667230_qa_5/task.toml b/tasks/0014_667_14667230_qa_5/task.toml index dd62bd459efa940895eb513511949fc4f80c9f6d..f0396307a3ca54caaaf75d663d46bab21df3c4f9 100644 --- a/tasks/0014_667_14667230_qa_5/task.toml +++ b/tasks/0014_667_14667230_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_701_14701455_qa_3/environment/bootstrap.sh b/tasks/0014_701_14701455_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_701_14701455_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_701_14701455_qa_3/environment/pull_bucket.py b/tasks/0014_701_14701455_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_701_14701455_qa_3/environment/pull_bucket.py +++ b/tasks/0014_701_14701455_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_701_14701455_qa_3/task.toml b/tasks/0014_701_14701455_qa_3/task.toml index 132acb715e23042ae8a9bfda473eb7144ec53de9..c58fdbb3f47de2ef967a05d85cf9bf132710bf26 100644 --- a/tasks/0014_701_14701455_qa_3/task.toml +++ b/tasks/0014_701_14701455_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_933_14933483_qa_2/environment/bootstrap.sh b/tasks/0014_933_14933483_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_933_14933483_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_933_14933483_qa_2/environment/pull_bucket.py b/tasks/0014_933_14933483_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_933_14933483_qa_2/environment/pull_bucket.py +++ b/tasks/0014_933_14933483_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_933_14933483_qa_2/task.toml b/tasks/0014_933_14933483_qa_2/task.toml index d6ddee1e15235293a4e92d4f43f3f0f819fd94bd..5bd6e62b70263b0894c9db0be95cf9e5572957a9 100644 --- a/tasks/0014_933_14933483_qa_2/task.toml +++ b/tasks/0014_933_14933483_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_933_14933483_qa_3/environment/bootstrap.sh b/tasks/0014_933_14933483_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_933_14933483_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_933_14933483_qa_3/environment/pull_bucket.py b/tasks/0014_933_14933483_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_933_14933483_qa_3/environment/pull_bucket.py +++ b/tasks/0014_933_14933483_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_933_14933483_qa_3/task.toml b/tasks/0014_933_14933483_qa_3/task.toml index 8b8ce663fd46ddbbb3634402154f0a8055920a9c..b2cd9d3d50d8cf5f26743b3a67620b83fa73b9b0 100644 --- a/tasks/0014_933_14933483_qa_3/task.toml +++ b/tasks/0014_933_14933483_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_952_14952543_qa_1/environment/bootstrap.sh b/tasks/0014_952_14952543_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_952_14952543_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_952_14952543_qa_1/environment/pull_bucket.py b/tasks/0014_952_14952543_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_952_14952543_qa_1/environment/pull_bucket.py +++ b/tasks/0014_952_14952543_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_952_14952543_qa_1/task.toml b/tasks/0014_952_14952543_qa_1/task.toml index 6cf67bb84e256154995a75e9af0242ddff2a7643..28c0fb3900ce927520dd94867e1fe0f06e643637 100644 --- a/tasks/0014_952_14952543_qa_1/task.toml +++ b/tasks/0014_952_14952543_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0014_952_14952543_qa_3/environment/bootstrap.sh b/tasks/0014_952_14952543_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0014_952_14952543_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0014_952_14952543_qa_3/environment/pull_bucket.py b/tasks/0014_952_14952543_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0014_952_14952543_qa_3/environment/pull_bucket.py +++ b/tasks/0014_952_14952543_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0014_952_14952543_qa_3/task.toml b/tasks/0014_952_14952543_qa_3/task.toml index 75dc98dddf20db15b1077b0fc64cfc4cccc8db51..64c4146f4da6167b91883894d1a13e478f5fe6e3 100644 --- a/tasks/0014_952_14952543_qa_3/task.toml +++ b/tasks/0014_952_14952543_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_048_15048236_qa_3/environment/bootstrap.sh b/tasks/0015_048_15048236_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_048_15048236_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_048_15048236_qa_3/environment/pull_bucket.py b/tasks/0015_048_15048236_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_048_15048236_qa_3/environment/pull_bucket.py +++ b/tasks/0015_048_15048236_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_048_15048236_qa_3/task.toml b/tasks/0015_048_15048236_qa_3/task.toml index 515418815478b76cd9111b8e1fc1e6eee0272388..5615e4599f41608faf6e463b2547754292518a38 100644 --- a/tasks/0015_048_15048236_qa_3/task.toml +++ b/tasks/0015_048_15048236_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_050_15050710_qa_1/environment/bootstrap.sh b/tasks/0015_050_15050710_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_050_15050710_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_050_15050710_qa_1/environment/pull_bucket.py b/tasks/0015_050_15050710_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_050_15050710_qa_1/environment/pull_bucket.py +++ b/tasks/0015_050_15050710_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_050_15050710_qa_1/task.toml b/tasks/0015_050_15050710_qa_1/task.toml index 1537db6fe9e7f3796600c53ef01636aa242773e7..44c12f0f086e2a926353ca9a1c4a0d38bf0629c0 100644 --- a/tasks/0015_050_15050710_qa_1/task.toml +++ b/tasks/0015_050_15050710_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_050_15050710_qa_2/environment/bootstrap.sh b/tasks/0015_050_15050710_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_050_15050710_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_050_15050710_qa_2/environment/pull_bucket.py b/tasks/0015_050_15050710_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_050_15050710_qa_2/environment/pull_bucket.py +++ b/tasks/0015_050_15050710_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_050_15050710_qa_2/task.toml b/tasks/0015_050_15050710_qa_2/task.toml index 3af6b04b4e26000e7d491a484fd3234f1b8b2866..9dc508ed313a3a46a198d1632bf34c9b35cea27b 100644 --- a/tasks/0015_050_15050710_qa_2/task.toml +++ b/tasks/0015_050_15050710_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_153_15153699_qa_3/environment/bootstrap.sh b/tasks/0015_153_15153699_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_153_15153699_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_153_15153699_qa_3/environment/pull_bucket.py b/tasks/0015_153_15153699_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_153_15153699_qa_3/environment/pull_bucket.py +++ b/tasks/0015_153_15153699_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_153_15153699_qa_3/task.toml b/tasks/0015_153_15153699_qa_3/task.toml index 009a55758425c18c08ab112155fa5349ca931a20..98e65cae28b89f0b58c37ddeb38acf7dde21a852 100644 --- a/tasks/0015_153_15153699_qa_3/task.toml +++ b/tasks/0015_153_15153699_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_157_15157151_qa_5/environment/bootstrap.sh b/tasks/0015_157_15157151_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_157_15157151_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_157_15157151_qa_5/environment/pull_bucket.py b/tasks/0015_157_15157151_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_157_15157151_qa_5/environment/pull_bucket.py +++ b/tasks/0015_157_15157151_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_157_15157151_qa_5/task.toml b/tasks/0015_157_15157151_qa_5/task.toml index df15a8adf773e9893d9d6b78aefd048ab104fe41..d4b9da901a343e194eff51a3076d7e5f044c18a0 100644 --- a/tasks/0015_157_15157151_qa_5/task.toml +++ b/tasks/0015_157_15157151_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_211_15211665_qa_1/environment/bootstrap.sh b/tasks/0015_211_15211665_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_211_15211665_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_211_15211665_qa_1/environment/pull_bucket.py b/tasks/0015_211_15211665_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_211_15211665_qa_1/environment/pull_bucket.py +++ b/tasks/0015_211_15211665_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_211_15211665_qa_1/task.toml b/tasks/0015_211_15211665_qa_1/task.toml index 8acc53dc427472061feab01150b4c2e5436ec7e4..9dc5a5201c4c9bb33fad36aacd3c462116255d6b 100644 --- a/tasks/0015_211_15211665_qa_1/task.toml +++ b/tasks/0015_211_15211665_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_211_15211665_qa_2/environment/bootstrap.sh b/tasks/0015_211_15211665_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_211_15211665_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_211_15211665_qa_2/environment/pull_bucket.py b/tasks/0015_211_15211665_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_211_15211665_qa_2/environment/pull_bucket.py +++ b/tasks/0015_211_15211665_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_211_15211665_qa_2/task.toml b/tasks/0015_211_15211665_qa_2/task.toml index d9c9e2c58f5a6fcdc01ef3c6e3ffee5547f006ab..016ef05353d0179bf18cc832a28a5d51a16f3866 100644 --- a/tasks/0015_211_15211665_qa_2/task.toml +++ b/tasks/0015_211_15211665_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_256_15256843_qa_3/environment/bootstrap.sh b/tasks/0015_256_15256843_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_256_15256843_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_256_15256843_qa_3/environment/pull_bucket.py b/tasks/0015_256_15256843_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_256_15256843_qa_3/environment/pull_bucket.py +++ b/tasks/0015_256_15256843_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_256_15256843_qa_3/task.toml b/tasks/0015_256_15256843_qa_3/task.toml index 17444002e40c76eb0f5f62e3782d70c993394dc6..312ecc17a4881a89b0b4f4d9c6b7527aaebbd11b 100644 --- a/tasks/0015_256_15256843_qa_3/task.toml +++ b/tasks/0015_256_15256843_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_256_15256843_qa_5/environment/bootstrap.sh b/tasks/0015_256_15256843_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_256_15256843_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_256_15256843_qa_5/environment/pull_bucket.py b/tasks/0015_256_15256843_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_256_15256843_qa_5/environment/pull_bucket.py +++ b/tasks/0015_256_15256843_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_256_15256843_qa_5/task.toml b/tasks/0015_256_15256843_qa_5/task.toml index a969c631b4fffbe556b8002270c07851d22d4f3a..0920bae3ffc7afbda68861a8deed1bd9aee477e5 100644 --- a/tasks/0015_256_15256843_qa_5/task.toml +++ b/tasks/0015_256_15256843_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_285_15285404_qa_3/environment/bootstrap.sh b/tasks/0015_285_15285404_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_285_15285404_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_285_15285404_qa_3/environment/pull_bucket.py b/tasks/0015_285_15285404_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_285_15285404_qa_3/environment/pull_bucket.py +++ b/tasks/0015_285_15285404_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_285_15285404_qa_3/task.toml b/tasks/0015_285_15285404_qa_3/task.toml index 44cd42b655d3b7073b8d8b753254d667ee43a7cf..b98aa4bdcecadb9f024b1568d1307e5ed0694558 100644 --- a/tasks/0015_285_15285404_qa_3/task.toml +++ b/tasks/0015_285_15285404_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_404_15404226_qa_1/environment/bootstrap.sh b/tasks/0015_404_15404226_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_404_15404226_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_404_15404226_qa_1/environment/pull_bucket.py b/tasks/0015_404_15404226_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_404_15404226_qa_1/environment/pull_bucket.py +++ b/tasks/0015_404_15404226_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_404_15404226_qa_1/task.toml b/tasks/0015_404_15404226_qa_1/task.toml index fb7349a80035039401f61e4029e0da5af9238418..fa5239ffbab8ed744089b0820469ed4b7fffa6ef 100644 --- a/tasks/0015_404_15404226_qa_1/task.toml +++ b/tasks/0015_404_15404226_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_404_15404226_qa_2/environment/bootstrap.sh b/tasks/0015_404_15404226_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_404_15404226_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_404_15404226_qa_2/environment/pull_bucket.py b/tasks/0015_404_15404226_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_404_15404226_qa_2/environment/pull_bucket.py +++ b/tasks/0015_404_15404226_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_404_15404226_qa_2/task.toml b/tasks/0015_404_15404226_qa_2/task.toml index 252ff19b72bc613e42efe1df8e3add1606f554cd..16255cb06b5ef9a65c60de49e6627e45ccb9243f 100644 --- a/tasks/0015_404_15404226_qa_2/task.toml +++ b/tasks/0015_404_15404226_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_404_15404226_qa_3/environment/bootstrap.sh b/tasks/0015_404_15404226_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_404_15404226_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_404_15404226_qa_3/environment/pull_bucket.py b/tasks/0015_404_15404226_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_404_15404226_qa_3/environment/pull_bucket.py +++ b/tasks/0015_404_15404226_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_404_15404226_qa_3/task.toml b/tasks/0015_404_15404226_qa_3/task.toml index 3a9ca9297f4aa5f3aa8699246a11f77505677014..4b70da54a207550cdc902b55248373a6fef7cfd3 100644 --- a/tasks/0015_404_15404226_qa_3/task.toml +++ b/tasks/0015_404_15404226_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_404_15404226_qa_4/environment/bootstrap.sh b/tasks/0015_404_15404226_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_404_15404226_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_404_15404226_qa_4/environment/pull_bucket.py b/tasks/0015_404_15404226_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_404_15404226_qa_4/environment/pull_bucket.py +++ b/tasks/0015_404_15404226_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_404_15404226_qa_4/task.toml b/tasks/0015_404_15404226_qa_4/task.toml index 5e108184bf880108431f7167ca076805943b9bea..6dd13b4b605684a2d7d7d66b1672d41e8250cb21 100644 --- a/tasks/0015_404_15404226_qa_4/task.toml +++ b/tasks/0015_404_15404226_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_404_15404226_qa_5/environment/bootstrap.sh b/tasks/0015_404_15404226_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_404_15404226_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_404_15404226_qa_5/environment/pull_bucket.py b/tasks/0015_404_15404226_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_404_15404226_qa_5/environment/pull_bucket.py +++ b/tasks/0015_404_15404226_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_404_15404226_qa_5/task.toml b/tasks/0015_404_15404226_qa_5/task.toml index b9b70748ce737fdc52355ffb4a7caa6af4c10d36..0c287ba805c320e0618fb60a10b27edb690094dd 100644 --- a/tasks/0015_404_15404226_qa_5/task.toml +++ b/tasks/0015_404_15404226_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_420_15420402_qa_1/environment/bootstrap.sh b/tasks/0015_420_15420402_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_420_15420402_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_420_15420402_qa_1/environment/pull_bucket.py b/tasks/0015_420_15420402_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_420_15420402_qa_1/environment/pull_bucket.py +++ b/tasks/0015_420_15420402_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_420_15420402_qa_1/task.toml b/tasks/0015_420_15420402_qa_1/task.toml index 0273ba9e6c467a72c0136796e089aa024b7fdded..87f8c55cf50153725ec26925135ae1917d15e722 100644 --- a/tasks/0015_420_15420402_qa_1/task.toml +++ b/tasks/0015_420_15420402_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_420_15420402_qa_4/environment/bootstrap.sh b/tasks/0015_420_15420402_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_420_15420402_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_420_15420402_qa_4/environment/pull_bucket.py b/tasks/0015_420_15420402_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_420_15420402_qa_4/environment/pull_bucket.py +++ b/tasks/0015_420_15420402_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_420_15420402_qa_4/task.toml b/tasks/0015_420_15420402_qa_4/task.toml index 995fa499c31454299205b053397889b4e2facb17..6cafb49a0ecccbd05d8c180a2bb31584dac9c0db 100644 --- a/tasks/0015_420_15420402_qa_4/task.toml +++ b/tasks/0015_420_15420402_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_456_15456455_qa_4/environment/bootstrap.sh b/tasks/0015_456_15456455_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_456_15456455_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_456_15456455_qa_4/environment/pull_bucket.py b/tasks/0015_456_15456455_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_456_15456455_qa_4/environment/pull_bucket.py +++ b/tasks/0015_456_15456455_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_456_15456455_qa_4/task.toml b/tasks/0015_456_15456455_qa_4/task.toml index 7e707f3927bdfca92fd9104bbcfc4ff3260a6154..fdb78544362b4bbddd7fc86c122df9c043054bfe 100644 --- a/tasks/0015_456_15456455_qa_4/task.toml +++ b/tasks/0015_456_15456455_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_494_15494676_qa_1/environment/bootstrap.sh b/tasks/0015_494_15494676_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_494_15494676_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_494_15494676_qa_1/environment/pull_bucket.py b/tasks/0015_494_15494676_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_494_15494676_qa_1/environment/pull_bucket.py +++ b/tasks/0015_494_15494676_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_494_15494676_qa_1/task.toml b/tasks/0015_494_15494676_qa_1/task.toml index 13a9a4e8c164d05087089cff4e7894d9a2ca9c67..f95176c114e2490b210ee8023a44d91a2fc1978a 100644 --- a/tasks/0015_494_15494676_qa_1/task.toml +++ b/tasks/0015_494_15494676_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_604_15604957_qa_3/environment/bootstrap.sh b/tasks/0015_604_15604957_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_604_15604957_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_604_15604957_qa_3/environment/pull_bucket.py b/tasks/0015_604_15604957_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_604_15604957_qa_3/environment/pull_bucket.py +++ b/tasks/0015_604_15604957_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_604_15604957_qa_3/task.toml b/tasks/0015_604_15604957_qa_3/task.toml index 593da2f1c1b2335e5e14e35e10448f65405deb6e..3f884bfb615298094be701b57f70995509afd090 100644 --- a/tasks/0015_604_15604957_qa_3/task.toml +++ b/tasks/0015_604_15604957_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_624_15624986_qa_4/environment/bootstrap.sh b/tasks/0015_624_15624986_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_624_15624986_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_624_15624986_qa_4/environment/pull_bucket.py b/tasks/0015_624_15624986_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_624_15624986_qa_4/environment/pull_bucket.py +++ b/tasks/0015_624_15624986_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_624_15624986_qa_4/task.toml b/tasks/0015_624_15624986_qa_4/task.toml index ac2cafdb86df8958de886b6c3fa4f8744eeb4141..3e4228da76c14e78a50e55813cffa6f8bc90982c 100644 --- a/tasks/0015_624_15624986_qa_4/task.toml +++ b/tasks/0015_624_15624986_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_684_15684716_qa_5/environment/bootstrap.sh b/tasks/0015_684_15684716_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_684_15684716_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_684_15684716_qa_5/environment/pull_bucket.py b/tasks/0015_684_15684716_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_684_15684716_qa_5/environment/pull_bucket.py +++ b/tasks/0015_684_15684716_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_684_15684716_qa_5/task.toml b/tasks/0015_684_15684716_qa_5/task.toml index 9f5059189c661da4ff4eac03bb1218d61fb030d9..0f66f8d910ee056363a96cb265f04cab4e38c443 100644 --- a/tasks/0015_684_15684716_qa_5/task.toml +++ b/tasks/0015_684_15684716_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_808_15808353_qa_1/environment/bootstrap.sh b/tasks/0015_808_15808353_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_808_15808353_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_808_15808353_qa_1/environment/pull_bucket.py b/tasks/0015_808_15808353_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_808_15808353_qa_1/environment/pull_bucket.py +++ b/tasks/0015_808_15808353_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_808_15808353_qa_1/task.toml b/tasks/0015_808_15808353_qa_1/task.toml index 522ef57e93694b8cb912e3cc9c3e743f9337dd4e..64f220db315031c66d34f89ad766a560b0d1f5ff 100644 --- a/tasks/0015_808_15808353_qa_1/task.toml +++ b/tasks/0015_808_15808353_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_817_15817041_qa_2/environment/bootstrap.sh b/tasks/0015_817_15817041_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_817_15817041_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_817_15817041_qa_2/environment/pull_bucket.py b/tasks/0015_817_15817041_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_817_15817041_qa_2/environment/pull_bucket.py +++ b/tasks/0015_817_15817041_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_817_15817041_qa_2/task.toml b/tasks/0015_817_15817041_qa_2/task.toml index ab2f509262530a025084dfab2a2745f1283b818f..c6658142baead7f0048f0fd863233a1b7ff8c78e 100644 --- a/tasks/0015_817_15817041_qa_2/task.toml +++ b/tasks/0015_817_15817041_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_861_15861774_qa_1/environment/bootstrap.sh b/tasks/0015_861_15861774_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_861_15861774_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_861_15861774_qa_1/environment/pull_bucket.py b/tasks/0015_861_15861774_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_861_15861774_qa_1/environment/pull_bucket.py +++ b/tasks/0015_861_15861774_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_861_15861774_qa_1/task.toml b/tasks/0015_861_15861774_qa_1/task.toml index 38c5e8761047554a409f626d2474655117ec31a6..70a90751d9396de990daf5eb89501a4b94189331 100644 --- a/tasks/0015_861_15861774_qa_1/task.toml +++ b/tasks/0015_861_15861774_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0015_881_15881525_qa_2/environment/bootstrap.sh b/tasks/0015_881_15881525_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0015_881_15881525_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0015_881_15881525_qa_2/environment/pull_bucket.py b/tasks/0015_881_15881525_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0015_881_15881525_qa_2/environment/pull_bucket.py +++ b/tasks/0015_881_15881525_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0015_881_15881525_qa_2/task.toml b/tasks/0015_881_15881525_qa_2/task.toml index dffcef7f50315b976c85f340e57dd1fe2af5e4b2..32964b8c934cd14e58ba1ce964fa37a16cb1f58a 100644 --- a/tasks/0015_881_15881525_qa_2/task.toml +++ b/tasks/0015_881_15881525_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_039_16039611_qa_1/environment/bootstrap.sh b/tasks/0016_039_16039611_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_039_16039611_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_039_16039611_qa_1/environment/pull_bucket.py b/tasks/0016_039_16039611_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_039_16039611_qa_1/environment/pull_bucket.py +++ b/tasks/0016_039_16039611_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_039_16039611_qa_1/task.toml b/tasks/0016_039_16039611_qa_1/task.toml index 9aa17b7d33e41599a3251bfcb4570a95ac66fb1d..8217f74d84210239b1b213feff6cb71d039986b7 100644 --- a/tasks/0016_039_16039611_qa_1/task.toml +++ b/tasks/0016_039_16039611_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_135_16135360_qa_2/environment/bootstrap.sh b/tasks/0016_135_16135360_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_135_16135360_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_135_16135360_qa_2/environment/pull_bucket.py b/tasks/0016_135_16135360_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_135_16135360_qa_2/environment/pull_bucket.py +++ b/tasks/0016_135_16135360_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_135_16135360_qa_2/task.toml b/tasks/0016_135_16135360_qa_2/task.toml index 2e35eb9f866bb8b2b2971e07b8ff498bf6f528e6..1e18157800a140cc50c79efb72075e79765f030b 100644 --- a/tasks/0016_135_16135360_qa_2/task.toml +++ b/tasks/0016_135_16135360_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_135_16135360_qa_3/environment/bootstrap.sh b/tasks/0016_135_16135360_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_135_16135360_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_135_16135360_qa_3/environment/pull_bucket.py b/tasks/0016_135_16135360_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_135_16135360_qa_3/environment/pull_bucket.py +++ b/tasks/0016_135_16135360_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_135_16135360_qa_3/task.toml b/tasks/0016_135_16135360_qa_3/task.toml index 24a0348e6bf168e0055d78d14a2edd176f79ac8f..5afcd82d3be620c56a5684753415d096575499ec 100644 --- a/tasks/0016_135_16135360_qa_3/task.toml +++ b/tasks/0016_135_16135360_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_136_16136283_qa_1/environment/bootstrap.sh b/tasks/0016_136_16136283_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_136_16136283_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_136_16136283_qa_1/environment/pull_bucket.py b/tasks/0016_136_16136283_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_136_16136283_qa_1/environment/pull_bucket.py +++ b/tasks/0016_136_16136283_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_136_16136283_qa_1/task.toml b/tasks/0016_136_16136283_qa_1/task.toml index f23c7fafd72c2326fb9799d2c8eeceb548fc07de..e6eb765d2e40369d220d6348396f610a14a1e82e 100644 --- a/tasks/0016_136_16136283_qa_1/task.toml +++ b/tasks/0016_136_16136283_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_369_16369869_qa_1/environment/bootstrap.sh b/tasks/0016_369_16369869_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_369_16369869_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_369_16369869_qa_1/environment/pull_bucket.py b/tasks/0016_369_16369869_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_369_16369869_qa_1/environment/pull_bucket.py +++ b/tasks/0016_369_16369869_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_369_16369869_qa_1/task.toml b/tasks/0016_369_16369869_qa_1/task.toml index 4f1990e30f4a4d9dff0e97c76eb75eb7757516d5..315928777d345c7505057b38de0b5db81cbfd2a7 100644 --- a/tasks/0016_369_16369869_qa_1/task.toml +++ b/tasks/0016_369_16369869_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_498_16498602_qa_3/environment/bootstrap.sh b/tasks/0016_498_16498602_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_498_16498602_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_498_16498602_qa_3/environment/pull_bucket.py b/tasks/0016_498_16498602_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_498_16498602_qa_3/environment/pull_bucket.py +++ b/tasks/0016_498_16498602_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_498_16498602_qa_3/task.toml b/tasks/0016_498_16498602_qa_3/task.toml index 246192a47ab77bd88344efc09131b2781a87eabd..6d2d22e6b9c111fa3937067af0fda08ed7213b19 100644 --- a/tasks/0016_498_16498602_qa_3/task.toml +++ b/tasks/0016_498_16498602_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_498_16498602_qa_5/environment/bootstrap.sh b/tasks/0016_498_16498602_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_498_16498602_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_498_16498602_qa_5/environment/pull_bucket.py b/tasks/0016_498_16498602_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_498_16498602_qa_5/environment/pull_bucket.py +++ b/tasks/0016_498_16498602_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_498_16498602_qa_5/task.toml b/tasks/0016_498_16498602_qa_5/task.toml index b1dbe937d95970f8c0790257fd29e8ddb37f0fc9..1dd5b5c53a175baf12e79fd183968b082bb9dd93 100644 --- a/tasks/0016_498_16498602_qa_5/task.toml +++ b/tasks/0016_498_16498602_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_558_16558367_qa_1/environment/bootstrap.sh b/tasks/0016_558_16558367_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_558_16558367_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_558_16558367_qa_1/environment/pull_bucket.py b/tasks/0016_558_16558367_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_558_16558367_qa_1/environment/pull_bucket.py +++ b/tasks/0016_558_16558367_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_558_16558367_qa_1/task.toml b/tasks/0016_558_16558367_qa_1/task.toml index 3b9981788f9ebd47b1b658c4cb112649443a4fc7..81c47693de7561de1ee4c0e8169a53e955819b3e 100644 --- a/tasks/0016_558_16558367_qa_1/task.toml +++ b/tasks/0016_558_16558367_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_573_16573161_qa_2/environment/bootstrap.sh b/tasks/0016_573_16573161_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_573_16573161_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_573_16573161_qa_2/environment/pull_bucket.py b/tasks/0016_573_16573161_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_573_16573161_qa_2/environment/pull_bucket.py +++ b/tasks/0016_573_16573161_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_573_16573161_qa_2/task.toml b/tasks/0016_573_16573161_qa_2/task.toml index 19587033854286f2aa6bad992a7d2d8b9f9d9d4b..9a0f43e4694f2facd6db16a5d2b2c6fb4aea06d1 100644 --- a/tasks/0016_573_16573161_qa_2/task.toml +++ b/tasks/0016_573_16573161_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_673_16673727_qa_2/environment/bootstrap.sh b/tasks/0016_673_16673727_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_673_16673727_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_673_16673727_qa_2/environment/pull_bucket.py b/tasks/0016_673_16673727_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_673_16673727_qa_2/environment/pull_bucket.py +++ b/tasks/0016_673_16673727_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_673_16673727_qa_2/task.toml b/tasks/0016_673_16673727_qa_2/task.toml index 8627d2aaeb4ce3cd5ea44a9938e85809cf8af1e0..40137d9fbab132d0dc6577d7cf3fc9a203df0179 100644 --- a/tasks/0016_673_16673727_qa_2/task.toml +++ b/tasks/0016_673_16673727_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_712_16712977_qa_1/environment/bootstrap.sh b/tasks/0016_712_16712977_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_712_16712977_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_712_16712977_qa_1/environment/pull_bucket.py b/tasks/0016_712_16712977_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_712_16712977_qa_1/environment/pull_bucket.py +++ b/tasks/0016_712_16712977_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_712_16712977_qa_1/task.toml b/tasks/0016_712_16712977_qa_1/task.toml index dbce4ce8b13859929d35c14affe06aa0eea50740..34e7c9c0b998189e80da889c69d6e601d93d4e44 100644 --- a/tasks/0016_712_16712977_qa_1/task.toml +++ b/tasks/0016_712_16712977_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_712_16712977_qa_5/environment/bootstrap.sh b/tasks/0016_712_16712977_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_712_16712977_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_712_16712977_qa_5/environment/pull_bucket.py b/tasks/0016_712_16712977_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_712_16712977_qa_5/environment/pull_bucket.py +++ b/tasks/0016_712_16712977_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_712_16712977_qa_5/task.toml b/tasks/0016_712_16712977_qa_5/task.toml index 3f5e2cdfb0085e6e6d67c72f2fe13d2f48a7a677..264825f27722b067e35b941939ce5a8d48a51632 100644 --- a/tasks/0016_712_16712977_qa_5/task.toml +++ b/tasks/0016_712_16712977_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_714_16714217_qa_1/environment/bootstrap.sh b/tasks/0016_714_16714217_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_714_16714217_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_714_16714217_qa_1/environment/pull_bucket.py b/tasks/0016_714_16714217_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_714_16714217_qa_1/environment/pull_bucket.py +++ b/tasks/0016_714_16714217_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_714_16714217_qa_1/task.toml b/tasks/0016_714_16714217_qa_1/task.toml index 2bbd2601c6512b7ebfd05f3ddc7334fab7ea8f93..c5741cd92701f1d22b9e17fa7a9b8edb4a2efb90 100644 --- a/tasks/0016_714_16714217_qa_1/task.toml +++ b/tasks/0016_714_16714217_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_714_16714217_qa_3/environment/bootstrap.sh b/tasks/0016_714_16714217_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_714_16714217_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_714_16714217_qa_3/environment/pull_bucket.py b/tasks/0016_714_16714217_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_714_16714217_qa_3/environment/pull_bucket.py +++ b/tasks/0016_714_16714217_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_714_16714217_qa_3/task.toml b/tasks/0016_714_16714217_qa_3/task.toml index 39063b7c8aba2e50890427a6618bdb4c59825639..daab465d9ca99a283c1f45fbf022294a869a2234 100644 --- a/tasks/0016_714_16714217_qa_3/task.toml +++ b/tasks/0016_714_16714217_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_714_16714217_qa_4/environment/bootstrap.sh b/tasks/0016_714_16714217_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_714_16714217_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_714_16714217_qa_4/environment/pull_bucket.py b/tasks/0016_714_16714217_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_714_16714217_qa_4/environment/pull_bucket.py +++ b/tasks/0016_714_16714217_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_714_16714217_qa_4/task.toml b/tasks/0016_714_16714217_qa_4/task.toml index ee3ad5737b91a0adc1b2a0b9da467cb8e16dd921..61b93a8b5aede31b4c44260c1f28370efe15b7b1 100644 --- a/tasks/0016_714_16714217_qa_4/task.toml +++ b/tasks/0016_714_16714217_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_770_16770911_qa_2/environment/bootstrap.sh b/tasks/0016_770_16770911_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_770_16770911_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_770_16770911_qa_2/environment/pull_bucket.py b/tasks/0016_770_16770911_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_770_16770911_qa_2/environment/pull_bucket.py +++ b/tasks/0016_770_16770911_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_770_16770911_qa_2/task.toml b/tasks/0016_770_16770911_qa_2/task.toml index 18fdce8ef3811fda22472c6969e8a92bfa7f3b6c..409989afc655062590174bbb205306cb98a72c0c 100644 --- a/tasks/0016_770_16770911_qa_2/task.toml +++ b/tasks/0016_770_16770911_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_795_16795888_qa_4/environment/bootstrap.sh b/tasks/0016_795_16795888_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_795_16795888_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_795_16795888_qa_4/environment/pull_bucket.py b/tasks/0016_795_16795888_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_795_16795888_qa_4/environment/pull_bucket.py +++ b/tasks/0016_795_16795888_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_795_16795888_qa_4/task.toml b/tasks/0016_795_16795888_qa_4/task.toml index bb7ff16c04b19123d88f5e85ee495320cc47219e..1a8c41eb2d6eb9f65a04d68f9e05a7826af05827 100644 --- a/tasks/0016_795_16795888_qa_4/task.toml +++ b/tasks/0016_795_16795888_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_945_16945752_qa_1/environment/bootstrap.sh b/tasks/0016_945_16945752_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_945_16945752_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_945_16945752_qa_1/environment/pull_bucket.py b/tasks/0016_945_16945752_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_945_16945752_qa_1/environment/pull_bucket.py +++ b/tasks/0016_945_16945752_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_945_16945752_qa_1/task.toml b/tasks/0016_945_16945752_qa_1/task.toml index 664b280e0055a14df0857da92371a20bc25e4808..6401b8411e0bae4f70650bfed00a360d917aee33 100644 --- a/tasks/0016_945_16945752_qa_1/task.toml +++ b/tasks/0016_945_16945752_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_945_16945752_qa_5/environment/bootstrap.sh b/tasks/0016_945_16945752_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_945_16945752_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_945_16945752_qa_5/environment/pull_bucket.py b/tasks/0016_945_16945752_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_945_16945752_qa_5/environment/pull_bucket.py +++ b/tasks/0016_945_16945752_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_945_16945752_qa_5/task.toml b/tasks/0016_945_16945752_qa_5/task.toml index c489e71438650d7bcf6611651aac101b079ed58e..65952b4bfeb32424a888be2155ab2b691e8f8e0f 100644 --- a/tasks/0016_945_16945752_qa_5/task.toml +++ b/tasks/0016_945_16945752_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_952_16952441_qa_1/environment/bootstrap.sh b/tasks/0016_952_16952441_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_952_16952441_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_952_16952441_qa_1/environment/pull_bucket.py b/tasks/0016_952_16952441_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_952_16952441_qa_1/environment/pull_bucket.py +++ b/tasks/0016_952_16952441_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_952_16952441_qa_1/task.toml b/tasks/0016_952_16952441_qa_1/task.toml index 9ac1938886824b04ea4208d22c4cd35a2251e743..7fff6d842df08a56d7392d421c6b0fe2b6aa91cf 100644 --- a/tasks/0016_952_16952441_qa_1/task.toml +++ b/tasks/0016_952_16952441_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_952_16952441_qa_2/environment/bootstrap.sh b/tasks/0016_952_16952441_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_952_16952441_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_952_16952441_qa_2/environment/pull_bucket.py b/tasks/0016_952_16952441_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_952_16952441_qa_2/environment/pull_bucket.py +++ b/tasks/0016_952_16952441_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_952_16952441_qa_2/task.toml b/tasks/0016_952_16952441_qa_2/task.toml index fab062a4729297f4e485e5acb32a346119cb46c7..7efaaacc1e62710711146e18cc607af345143775 100644 --- a/tasks/0016_952_16952441_qa_2/task.toml +++ b/tasks/0016_952_16952441_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_952_16952441_qa_4/environment/bootstrap.sh b/tasks/0016_952_16952441_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_952_16952441_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_952_16952441_qa_4/environment/pull_bucket.py b/tasks/0016_952_16952441_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_952_16952441_qa_4/environment/pull_bucket.py +++ b/tasks/0016_952_16952441_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_952_16952441_qa_4/task.toml b/tasks/0016_952_16952441_qa_4/task.toml index 15941506ca45a9c67b6cc42baf08e9d1940e8a14..99920b71c4605e2428483a4f816065b12843ebc0 100644 --- a/tasks/0016_952_16952441_qa_4/task.toml +++ b/tasks/0016_952_16952441_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_971_16971389_qa_1/environment/bootstrap.sh b/tasks/0016_971_16971389_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_971_16971389_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_971_16971389_qa_1/environment/pull_bucket.py b/tasks/0016_971_16971389_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_971_16971389_qa_1/environment/pull_bucket.py +++ b/tasks/0016_971_16971389_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_971_16971389_qa_1/task.toml b/tasks/0016_971_16971389_qa_1/task.toml index 776a2f3606b3df4987ac0d956a7cb95c386de842..0e1b2f4deac2eb43b4df57d864c87144c84685ef 100644 --- a/tasks/0016_971_16971389_qa_1/task.toml +++ b/tasks/0016_971_16971389_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0016_985_16985676_qa_3/environment/bootstrap.sh b/tasks/0016_985_16985676_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0016_985_16985676_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0016_985_16985676_qa_3/environment/pull_bucket.py b/tasks/0016_985_16985676_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0016_985_16985676_qa_3/environment/pull_bucket.py +++ b/tasks/0016_985_16985676_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0016_985_16985676_qa_3/task.toml b/tasks/0016_985_16985676_qa_3/task.toml index 3bdc331f9b3648734b9fc78c302fc5b494e384f1..b5b38fb2f26ad6d8c5a63c714e915670c8bbe4c3 100644 --- a/tasks/0016_985_16985676_qa_3/task.toml +++ b/tasks/0016_985_16985676_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_247_17247673_qa_2/environment/bootstrap.sh b/tasks/0017_247_17247673_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_247_17247673_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_247_17247673_qa_2/environment/pull_bucket.py b/tasks/0017_247_17247673_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_247_17247673_qa_2/environment/pull_bucket.py +++ b/tasks/0017_247_17247673_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_247_17247673_qa_2/task.toml b/tasks/0017_247_17247673_qa_2/task.toml index 893ed487ad1326fafcff07609fd4a3aba3fb6715..29265bbec384d2a4f1cd081f76c2f7c93fe69707 100644 --- a/tasks/0017_247_17247673_qa_2/task.toml +++ b/tasks/0017_247_17247673_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_257_17257933_qa_3/environment/bootstrap.sh b/tasks/0017_257_17257933_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_257_17257933_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_257_17257933_qa_3/environment/pull_bucket.py b/tasks/0017_257_17257933_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_257_17257933_qa_3/environment/pull_bucket.py +++ b/tasks/0017_257_17257933_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_257_17257933_qa_3/task.toml b/tasks/0017_257_17257933_qa_3/task.toml index b1e67046fe3705fce39503d7f587cad48fffa760..40867e0a7c71624d2fdbaa2cc7e37950b6615967 100644 --- a/tasks/0017_257_17257933_qa_3/task.toml +++ b/tasks/0017_257_17257933_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_257_17257933_qa_4/environment/bootstrap.sh b/tasks/0017_257_17257933_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_257_17257933_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_257_17257933_qa_4/environment/pull_bucket.py b/tasks/0017_257_17257933_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_257_17257933_qa_4/environment/pull_bucket.py +++ b/tasks/0017_257_17257933_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_257_17257933_qa_4/task.toml b/tasks/0017_257_17257933_qa_4/task.toml index 5118ebf7e5df804f3dbe192785c669434db81682..77d5d3af063a6a89f8dd3a6fb7eac68c44a0421e 100644 --- a/tasks/0017_257_17257933_qa_4/task.toml +++ b/tasks/0017_257_17257933_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_257_17257933_qa_5/environment/bootstrap.sh b/tasks/0017_257_17257933_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_257_17257933_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_257_17257933_qa_5/environment/pull_bucket.py b/tasks/0017_257_17257933_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_257_17257933_qa_5/environment/pull_bucket.py +++ b/tasks/0017_257_17257933_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_257_17257933_qa_5/task.toml b/tasks/0017_257_17257933_qa_5/task.toml index 67b95050e984f09c1b95cd1ace98f77b83808e10..bafaa397700c9d17fb7872f5dad3f946a84b2ebd 100644 --- a/tasks/0017_257_17257933_qa_5/task.toml +++ b/tasks/0017_257_17257933_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_291_17291057_qa_1/environment/bootstrap.sh b/tasks/0017_291_17291057_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_291_17291057_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_291_17291057_qa_1/environment/pull_bucket.py b/tasks/0017_291_17291057_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_291_17291057_qa_1/environment/pull_bucket.py +++ b/tasks/0017_291_17291057_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_291_17291057_qa_1/task.toml b/tasks/0017_291_17291057_qa_1/task.toml index df9cb8b3b830b96c1fc208ae7313bb5079b163b3..0a404374a85ced15afb2aeb9b649162f4495188a 100644 --- a/tasks/0017_291_17291057_qa_1/task.toml +++ b/tasks/0017_291_17291057_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_291_17291057_qa_5/environment/bootstrap.sh b/tasks/0017_291_17291057_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_291_17291057_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_291_17291057_qa_5/environment/pull_bucket.py b/tasks/0017_291_17291057_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_291_17291057_qa_5/environment/pull_bucket.py +++ b/tasks/0017_291_17291057_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_291_17291057_qa_5/task.toml b/tasks/0017_291_17291057_qa_5/task.toml index 932e83604db42c93b2ae79934c8796876f972c7f..798f958e47242ab4efe9e01ee1715597c059a7eb 100644 --- a/tasks/0017_291_17291057_qa_5/task.toml +++ b/tasks/0017_291_17291057_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_311_17311492_qa_2/environment/bootstrap.sh b/tasks/0017_311_17311492_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_311_17311492_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_311_17311492_qa_2/environment/pull_bucket.py b/tasks/0017_311_17311492_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_311_17311492_qa_2/environment/pull_bucket.py +++ b/tasks/0017_311_17311492_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_311_17311492_qa_2/task.toml b/tasks/0017_311_17311492_qa_2/task.toml index cce421d25efc737d9fd54a32d33b87a88adf8945..ca85ed4e66e88fc4e21dfdc6e0cf648000efa869 100644 --- a/tasks/0017_311_17311492_qa_2/task.toml +++ b/tasks/0017_311_17311492_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_339_17339042_qa_3/environment/bootstrap.sh b/tasks/0017_339_17339042_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_339_17339042_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_339_17339042_qa_3/environment/pull_bucket.py b/tasks/0017_339_17339042_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_339_17339042_qa_3/environment/pull_bucket.py +++ b/tasks/0017_339_17339042_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_339_17339042_qa_3/task.toml b/tasks/0017_339_17339042_qa_3/task.toml index d27fddb2781f07feb9ac8733ff254ad27ba08cb6..623d0c1f91b185da71d52723569e331e4c9a578d 100644 --- a/tasks/0017_339_17339042_qa_3/task.toml +++ b/tasks/0017_339_17339042_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_359_17359385_qa_4/environment/bootstrap.sh b/tasks/0017_359_17359385_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_359_17359385_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_359_17359385_qa_4/environment/pull_bucket.py b/tasks/0017_359_17359385_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_359_17359385_qa_4/environment/pull_bucket.py +++ b/tasks/0017_359_17359385_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_359_17359385_qa_4/task.toml b/tasks/0017_359_17359385_qa_4/task.toml index c3753f7d77d476a2c564ab8e74c527cab1f8c64b..406611511f234c83f6a1785f0a4bac015d0f399d 100644 --- a/tasks/0017_359_17359385_qa_4/task.toml +++ b/tasks/0017_359_17359385_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_359_17359385_qa_5/environment/bootstrap.sh b/tasks/0017_359_17359385_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_359_17359385_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_359_17359385_qa_5/environment/pull_bucket.py b/tasks/0017_359_17359385_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_359_17359385_qa_5/environment/pull_bucket.py +++ b/tasks/0017_359_17359385_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_359_17359385_qa_5/task.toml b/tasks/0017_359_17359385_qa_5/task.toml index c76d1281792d8ec66e6f6346e658f5b7d5b970d7..829250024e2658440222798df65562f41fdbc646 100644 --- a/tasks/0017_359_17359385_qa_5/task.toml +++ b/tasks/0017_359_17359385_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_565_17565404_qa_1/environment/bootstrap.sh b/tasks/0017_565_17565404_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_565_17565404_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_565_17565404_qa_1/environment/pull_bucket.py b/tasks/0017_565_17565404_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_565_17565404_qa_1/environment/pull_bucket.py +++ b/tasks/0017_565_17565404_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_565_17565404_qa_1/task.toml b/tasks/0017_565_17565404_qa_1/task.toml index 6c7c4f80218a3212e6f7ef58a6243d5866d25ced..728f0759d4aad76476ebfe8d82d6ffe7f050d249 100644 --- a/tasks/0017_565_17565404_qa_1/task.toml +++ b/tasks/0017_565_17565404_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_565_17565404_qa_2/environment/bootstrap.sh b/tasks/0017_565_17565404_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_565_17565404_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_565_17565404_qa_2/environment/pull_bucket.py b/tasks/0017_565_17565404_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_565_17565404_qa_2/environment/pull_bucket.py +++ b/tasks/0017_565_17565404_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_565_17565404_qa_2/task.toml b/tasks/0017_565_17565404_qa_2/task.toml index 8f187edb34530b31afae3f08999fe5749b3f999a..690f34295398ae59c23b84c97af7bf32849e49c6 100644 --- a/tasks/0017_565_17565404_qa_2/task.toml +++ b/tasks/0017_565_17565404_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_693_17693429_qa_4/environment/bootstrap.sh b/tasks/0017_693_17693429_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_693_17693429_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_693_17693429_qa_4/environment/pull_bucket.py b/tasks/0017_693_17693429_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_693_17693429_qa_4/environment/pull_bucket.py +++ b/tasks/0017_693_17693429_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_693_17693429_qa_4/task.toml b/tasks/0017_693_17693429_qa_4/task.toml index e82a9897f38534c714bb48e390327297d8a542f3..fda63b4bcf0e8bb7581cf30debcf43e7310a4d19 100644 --- a/tasks/0017_693_17693429_qa_4/task.toml +++ b/tasks/0017_693_17693429_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_703_17703063_qa_2/environment/bootstrap.sh b/tasks/0017_703_17703063_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_703_17703063_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_703_17703063_qa_2/environment/pull_bucket.py b/tasks/0017_703_17703063_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_703_17703063_qa_2/environment/pull_bucket.py +++ b/tasks/0017_703_17703063_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_703_17703063_qa_2/task.toml b/tasks/0017_703_17703063_qa_2/task.toml index 009f147ff6384b74b7ed28338ab198c4eac4086f..0f8d4dfa5c9665b4e34db17e422ce738b02ca6d5 100644 --- a/tasks/0017_703_17703063_qa_2/task.toml +++ b/tasks/0017_703_17703063_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_740_17740333_qa_1/environment/bootstrap.sh b/tasks/0017_740_17740333_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_740_17740333_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_740_17740333_qa_1/environment/pull_bucket.py b/tasks/0017_740_17740333_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_740_17740333_qa_1/environment/pull_bucket.py +++ b/tasks/0017_740_17740333_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_740_17740333_qa_1/task.toml b/tasks/0017_740_17740333_qa_1/task.toml index 98f9b4be2c433af0f7513742715a5c8e2506ed9f..f218b54a5cd1738316870c1a15c46bca80370da7 100644 --- a/tasks/0017_740_17740333_qa_1/task.toml +++ b/tasks/0017_740_17740333_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_795_17795348_qa_5/environment/bootstrap.sh b/tasks/0017_795_17795348_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_795_17795348_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_795_17795348_qa_5/environment/pull_bucket.py b/tasks/0017_795_17795348_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_795_17795348_qa_5/environment/pull_bucket.py +++ b/tasks/0017_795_17795348_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_795_17795348_qa_5/task.toml b/tasks/0017_795_17795348_qa_5/task.toml index 5030f8c74661cd64102dd82c9b8bf4fcc7705b5d..1b17c3c3aa31b46e554d3665983a250cfe5ad821 100644 --- a/tasks/0017_795_17795348_qa_5/task.toml +++ b/tasks/0017_795_17795348_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_802_17802867_qa_4/environment/bootstrap.sh b/tasks/0017_802_17802867_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_802_17802867_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_802_17802867_qa_4/environment/pull_bucket.py b/tasks/0017_802_17802867_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_802_17802867_qa_4/environment/pull_bucket.py +++ b/tasks/0017_802_17802867_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_802_17802867_qa_4/task.toml b/tasks/0017_802_17802867_qa_4/task.toml index 180169af9bda249e60de20b185e7cb0ea9e04772..eb5a006c555c7672141b50bf50a995ec3968f544 100644 --- a/tasks/0017_802_17802867_qa_4/task.toml +++ b/tasks/0017_802_17802867_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_808_17808830_qa_5/environment/bootstrap.sh b/tasks/0017_808_17808830_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_808_17808830_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_808_17808830_qa_5/environment/pull_bucket.py b/tasks/0017_808_17808830_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_808_17808830_qa_5/environment/pull_bucket.py +++ b/tasks/0017_808_17808830_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_808_17808830_qa_5/task.toml b/tasks/0017_808_17808830_qa_5/task.toml index 3a38b1d2fee1948318624c77884e0b7a32ebd0be..e195efd7c258863b2572ebc950554baeac4dcdda 100644 --- a/tasks/0017_808_17808830_qa_5/task.toml +++ b/tasks/0017_808_17808830_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_810_17810500_qa_2/environment/bootstrap.sh b/tasks/0017_810_17810500_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_810_17810500_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_810_17810500_qa_2/environment/pull_bucket.py b/tasks/0017_810_17810500_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_810_17810500_qa_2/environment/pull_bucket.py +++ b/tasks/0017_810_17810500_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_810_17810500_qa_2/task.toml b/tasks/0017_810_17810500_qa_2/task.toml index b7c4c13e9f3ff1c0df965fd28f7cdd7b5576d856..d8aa4d0f43b49e27da81dfbdf5d44f1eb5805cee 100644 --- a/tasks/0017_810_17810500_qa_2/task.toml +++ b/tasks/0017_810_17810500_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_859_17859052_qa_1/environment/bootstrap.sh b/tasks/0017_859_17859052_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_859_17859052_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_859_17859052_qa_1/environment/pull_bucket.py b/tasks/0017_859_17859052_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_859_17859052_qa_1/environment/pull_bucket.py +++ b/tasks/0017_859_17859052_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_859_17859052_qa_1/task.toml b/tasks/0017_859_17859052_qa_1/task.toml index eb5baf179619874d7efda6f3da93c44dca57d134..65620d1a55fd7a02595031f24c838ff3d6267c1e 100644 --- a/tasks/0017_859_17859052_qa_1/task.toml +++ b/tasks/0017_859_17859052_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_914_17914820_qa_1/environment/bootstrap.sh b/tasks/0017_914_17914820_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_914_17914820_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_914_17914820_qa_1/environment/pull_bucket.py b/tasks/0017_914_17914820_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_914_17914820_qa_1/environment/pull_bucket.py +++ b/tasks/0017_914_17914820_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_914_17914820_qa_1/task.toml b/tasks/0017_914_17914820_qa_1/task.toml index ae321d9a294dcc224b16ded27d59fb180706c9a2..8373f3441fca369c96d12cbeaaa5afc493cc8be8 100644 --- a/tasks/0017_914_17914820_qa_1/task.toml +++ b/tasks/0017_914_17914820_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_914_17914820_qa_5/environment/bootstrap.sh b/tasks/0017_914_17914820_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_914_17914820_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_914_17914820_qa_5/environment/pull_bucket.py b/tasks/0017_914_17914820_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_914_17914820_qa_5/environment/pull_bucket.py +++ b/tasks/0017_914_17914820_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_914_17914820_qa_5/task.toml b/tasks/0017_914_17914820_qa_5/task.toml index 25dc89908f8c6af763d8db941f0809e115aa34c2..907d33600696022b3f98ee77bd29cfa763863171 100644 --- a/tasks/0017_914_17914820_qa_5/task.toml +++ b/tasks/0017_914_17914820_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_920_17920359_qa_1/environment/bootstrap.sh b/tasks/0017_920_17920359_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_920_17920359_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_920_17920359_qa_1/environment/pull_bucket.py b/tasks/0017_920_17920359_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_920_17920359_qa_1/environment/pull_bucket.py +++ b/tasks/0017_920_17920359_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_920_17920359_qa_1/task.toml b/tasks/0017_920_17920359_qa_1/task.toml index a1b4047749a99a2223dce589b53bd83667a42a1e..4521ed7835795619e5712ac62dde7be45f137d7c 100644 --- a/tasks/0017_920_17920359_qa_1/task.toml +++ b/tasks/0017_920_17920359_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0017_920_17920359_qa_2/environment/bootstrap.sh b/tasks/0017_920_17920359_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0017_920_17920359_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0017_920_17920359_qa_2/environment/pull_bucket.py b/tasks/0017_920_17920359_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0017_920_17920359_qa_2/environment/pull_bucket.py +++ b/tasks/0017_920_17920359_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0017_920_17920359_qa_2/task.toml b/tasks/0017_920_17920359_qa_2/task.toml index d18389af6eca49e80ad734579e26eab54c9da80a..2d0d5499456f592d769ba39b0390ce3fee6b18b6 100644 --- a/tasks/0017_920_17920359_qa_2/task.toml +++ b/tasks/0017_920_17920359_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_020_18020173_qa_3/environment/bootstrap.sh b/tasks/0018_020_18020173_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_020_18020173_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_020_18020173_qa_3/environment/pull_bucket.py b/tasks/0018_020_18020173_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_020_18020173_qa_3/environment/pull_bucket.py +++ b/tasks/0018_020_18020173_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_020_18020173_qa_3/task.toml b/tasks/0018_020_18020173_qa_3/task.toml index ffe8a19ff4260a5ba89abf7caa371ea10411093d..03770629cb66c81091d3b3d2e7d6ff6d90efee38 100644 --- a/tasks/0018_020_18020173_qa_3/task.toml +++ b/tasks/0018_020_18020173_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_020_18020173_qa_5/environment/bootstrap.sh b/tasks/0018_020_18020173_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_020_18020173_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_020_18020173_qa_5/environment/pull_bucket.py b/tasks/0018_020_18020173_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_020_18020173_qa_5/environment/pull_bucket.py +++ b/tasks/0018_020_18020173_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_020_18020173_qa_5/task.toml b/tasks/0018_020_18020173_qa_5/task.toml index 00844e9cd0394121279a090da9e71fa9413a7bcf..3a2ec00e03d486e36f4a96e1bbe544bc67f0006a 100644 --- a/tasks/0018_020_18020173_qa_5/task.toml +++ b/tasks/0018_020_18020173_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_038_18038519_qa_5/environment/bootstrap.sh b/tasks/0018_038_18038519_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_038_18038519_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_038_18038519_qa_5/environment/pull_bucket.py b/tasks/0018_038_18038519_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_038_18038519_qa_5/environment/pull_bucket.py +++ b/tasks/0018_038_18038519_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_038_18038519_qa_5/task.toml b/tasks/0018_038_18038519_qa_5/task.toml index e8a1e057600fb0e699adc3a84da6f1bf96fa264b..095cefe4eda0a01eb5ac6cc94a1e62e79267bda2 100644 --- a/tasks/0018_038_18038519_qa_5/task.toml +++ b/tasks/0018_038_18038519_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_278_18278432_qa_1/environment/bootstrap.sh b/tasks/0018_278_18278432_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_278_18278432_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_278_18278432_qa_1/environment/pull_bucket.py b/tasks/0018_278_18278432_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_278_18278432_qa_1/environment/pull_bucket.py +++ b/tasks/0018_278_18278432_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_278_18278432_qa_1/task.toml b/tasks/0018_278_18278432_qa_1/task.toml index 5308f7640d1004eab8f9bda6cce66365ca023cb9..82106a1fa70b28b03b57570695777a5a4367f7f4 100644 --- a/tasks/0018_278_18278432_qa_1/task.toml +++ b/tasks/0018_278_18278432_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_278_18278542_qa_3/environment/bootstrap.sh b/tasks/0018_278_18278542_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_278_18278542_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_278_18278542_qa_3/environment/pull_bucket.py b/tasks/0018_278_18278542_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_278_18278542_qa_3/environment/pull_bucket.py +++ b/tasks/0018_278_18278542_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_278_18278542_qa_3/task.toml b/tasks/0018_278_18278542_qa_3/task.toml index c7436a4d5d9984565974772fe373a041d6395961..5ba09f80fde150b33b59aee559718728dc7e66d5 100644 --- a/tasks/0018_278_18278542_qa_3/task.toml +++ b/tasks/0018_278_18278542_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_395_18395380_qa_5/environment/bootstrap.sh b/tasks/0018_395_18395380_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_395_18395380_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_395_18395380_qa_5/environment/pull_bucket.py b/tasks/0018_395_18395380_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_395_18395380_qa_5/environment/pull_bucket.py +++ b/tasks/0018_395_18395380_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_395_18395380_qa_5/task.toml b/tasks/0018_395_18395380_qa_5/task.toml index 8f922875174203db43cd48ea29bbe4bf5920a9ce..cfdb7176f82190ca47137d0f463c486aea02318a 100644 --- a/tasks/0018_395_18395380_qa_5/task.toml +++ b/tasks/0018_395_18395380_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_456_18456045_qa_5/environment/bootstrap.sh b/tasks/0018_456_18456045_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_456_18456045_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_456_18456045_qa_5/environment/pull_bucket.py b/tasks/0018_456_18456045_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_456_18456045_qa_5/environment/pull_bucket.py +++ b/tasks/0018_456_18456045_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_456_18456045_qa_5/task.toml b/tasks/0018_456_18456045_qa_5/task.toml index 492ff00f049ecab7a9ebddaa3cbb2c539fc1197d..2bc35d76e6764b3f9bc68c0b25ff67aad6738748 100644 --- a/tasks/0018_456_18456045_qa_5/task.toml +++ b/tasks/0018_456_18456045_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_479_18479259_qa_4/environment/bootstrap.sh b/tasks/0018_479_18479259_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_479_18479259_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_479_18479259_qa_4/environment/pull_bucket.py b/tasks/0018_479_18479259_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_479_18479259_qa_4/environment/pull_bucket.py +++ b/tasks/0018_479_18479259_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_479_18479259_qa_4/task.toml b/tasks/0018_479_18479259_qa_4/task.toml index a31e284f5bb495b3a8f6ff44075f7b7d72f18f97..48b933f53f73e1aa5adf60036fabdc92038e0f75 100644 --- a/tasks/0018_479_18479259_qa_4/task.toml +++ b/tasks/0018_479_18479259_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_479_18479259_qa_5/environment/bootstrap.sh b/tasks/0018_479_18479259_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_479_18479259_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_479_18479259_qa_5/environment/pull_bucket.py b/tasks/0018_479_18479259_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_479_18479259_qa_5/environment/pull_bucket.py +++ b/tasks/0018_479_18479259_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_479_18479259_qa_5/task.toml b/tasks/0018_479_18479259_qa_5/task.toml index 4b52d580b774f802f2bff52bdd7e94a7cb7d2784..02849d7f30b93ee167e7df61accb6c23c7d9cfee 100644 --- a/tasks/0018_479_18479259_qa_5/task.toml +++ b/tasks/0018_479_18479259_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_493_18493579_qa_1/environment/bootstrap.sh b/tasks/0018_493_18493579_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_493_18493579_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_493_18493579_qa_1/environment/pull_bucket.py b/tasks/0018_493_18493579_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_493_18493579_qa_1/environment/pull_bucket.py +++ b/tasks/0018_493_18493579_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_493_18493579_qa_1/task.toml b/tasks/0018_493_18493579_qa_1/task.toml index 308f591f8f887617418b8a8d618d2a15050c533c..483c31cd391405ba4e969eeafff7225e5b4aea6c 100644 --- a/tasks/0018_493_18493579_qa_1/task.toml +++ b/tasks/0018_493_18493579_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_493_18493579_qa_2/environment/bootstrap.sh b/tasks/0018_493_18493579_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_493_18493579_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_493_18493579_qa_2/environment/pull_bucket.py b/tasks/0018_493_18493579_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_493_18493579_qa_2/environment/pull_bucket.py +++ b/tasks/0018_493_18493579_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_493_18493579_qa_2/task.toml b/tasks/0018_493_18493579_qa_2/task.toml index aaaf9b99390d8437b899dbcb556101f8d9003d48..575991bd0bfa7d9b5e48a976af3ce4b142688b9d 100644 --- a/tasks/0018_493_18493579_qa_2/task.toml +++ b/tasks/0018_493_18493579_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_510_18510968_qa_2/environment/bootstrap.sh b/tasks/0018_510_18510968_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_510_18510968_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_510_18510968_qa_2/environment/pull_bucket.py b/tasks/0018_510_18510968_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_510_18510968_qa_2/environment/pull_bucket.py +++ b/tasks/0018_510_18510968_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_510_18510968_qa_2/task.toml b/tasks/0018_510_18510968_qa_2/task.toml index a325e552cee2f4d2c478f756bc7b818c594246cf..255600c089fe065d420fc3a15eb06ca0495a9c4d 100644 --- a/tasks/0018_510_18510968_qa_2/task.toml +++ b/tasks/0018_510_18510968_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_519_18519406_qa_1/environment/bootstrap.sh b/tasks/0018_519_18519406_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_519_18519406_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_519_18519406_qa_1/environment/pull_bucket.py b/tasks/0018_519_18519406_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_519_18519406_qa_1/environment/pull_bucket.py +++ b/tasks/0018_519_18519406_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_519_18519406_qa_1/task.toml b/tasks/0018_519_18519406_qa_1/task.toml index f9015587d45ed65f63e18f355ade1d4871eabe5e..cf5d0d43b7334bc980d9522a5cc17d4770d70e03 100644 --- a/tasks/0018_519_18519406_qa_1/task.toml +++ b/tasks/0018_519_18519406_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_519_18519406_qa_3/environment/bootstrap.sh b/tasks/0018_519_18519406_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_519_18519406_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_519_18519406_qa_3/environment/pull_bucket.py b/tasks/0018_519_18519406_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_519_18519406_qa_3/environment/pull_bucket.py +++ b/tasks/0018_519_18519406_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_519_18519406_qa_3/task.toml b/tasks/0018_519_18519406_qa_3/task.toml index 5c87184d0a033c18474349e5088c1b0a3a0f9f9c..50d3df6892a9019e36503aabc008772c922e85d7 100644 --- a/tasks/0018_519_18519406_qa_3/task.toml +++ b/tasks/0018_519_18519406_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_550_18550354_qa_2/environment/bootstrap.sh b/tasks/0018_550_18550354_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_550_18550354_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_550_18550354_qa_2/environment/pull_bucket.py b/tasks/0018_550_18550354_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_550_18550354_qa_2/environment/pull_bucket.py +++ b/tasks/0018_550_18550354_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_550_18550354_qa_2/task.toml b/tasks/0018_550_18550354_qa_2/task.toml index b48ef0155cb66d902d6873823c98a9328517cac3..90f5527344689a9f651863d244356e19ba4e923b 100644 --- a/tasks/0018_550_18550354_qa_2/task.toml +++ b/tasks/0018_550_18550354_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_550_18550354_qa_4/environment/bootstrap.sh b/tasks/0018_550_18550354_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_550_18550354_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_550_18550354_qa_4/environment/pull_bucket.py b/tasks/0018_550_18550354_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_550_18550354_qa_4/environment/pull_bucket.py +++ b/tasks/0018_550_18550354_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_550_18550354_qa_4/task.toml b/tasks/0018_550_18550354_qa_4/task.toml index 6c426aee4b85ec9803cef351385b13d7c2a1e224..be87f4317cd3503a3dd6cf83eee93780a97bbee7 100644 --- a/tasks/0018_550_18550354_qa_4/task.toml +++ b/tasks/0018_550_18550354_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_563_18563893_qa_5/environment/bootstrap.sh b/tasks/0018_563_18563893_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_563_18563893_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_563_18563893_qa_5/environment/pull_bucket.py b/tasks/0018_563_18563893_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_563_18563893_qa_5/environment/pull_bucket.py +++ b/tasks/0018_563_18563893_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_563_18563893_qa_5/task.toml b/tasks/0018_563_18563893_qa_5/task.toml index c89a4660c774bd9ae27810c72dd50463bd036e52..c45432cefb9236a1d2c2791a39a50e5de2c57794 100644 --- a/tasks/0018_563_18563893_qa_5/task.toml +++ b/tasks/0018_563_18563893_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_822_18822167_qa_1/environment/bootstrap.sh b/tasks/0018_822_18822167_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_822_18822167_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_822_18822167_qa_1/environment/pull_bucket.py b/tasks/0018_822_18822167_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_822_18822167_qa_1/environment/pull_bucket.py +++ b/tasks/0018_822_18822167_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_822_18822167_qa_1/task.toml b/tasks/0018_822_18822167_qa_1/task.toml index 4fb1707bd30109b6c5a4173806db9dc614539a44..81069f2df779218b9f9d2f1a0509db1237058140 100644 --- a/tasks/0018_822_18822167_qa_1/task.toml +++ b/tasks/0018_822_18822167_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0018_823_18823003_qa_5/environment/bootstrap.sh b/tasks/0018_823_18823003_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0018_823_18823003_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0018_823_18823003_qa_5/environment/pull_bucket.py b/tasks/0018_823_18823003_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0018_823_18823003_qa_5/environment/pull_bucket.py +++ b/tasks/0018_823_18823003_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0018_823_18823003_qa_5/task.toml b/tasks/0018_823_18823003_qa_5/task.toml index c768c6fda3b18089bfa81017e0eae6e7d58c6252..3a7a131a027f46a3f080ff7e74482d2cbd5935a4 100644 --- a/tasks/0018_823_18823003_qa_5/task.toml +++ b/tasks/0018_823_18823003_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_106_19106342_qa_1/environment/bootstrap.sh b/tasks/0019_106_19106342_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_106_19106342_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_106_19106342_qa_1/environment/pull_bucket.py b/tasks/0019_106_19106342_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_106_19106342_qa_1/environment/pull_bucket.py +++ b/tasks/0019_106_19106342_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_106_19106342_qa_1/task.toml b/tasks/0019_106_19106342_qa_1/task.toml index fd1cccb89388735e800fd4bb8c05f7147df09671..9766207303192b5c5438dafed2de648a6d8c88c3 100644 --- a/tasks/0019_106_19106342_qa_1/task.toml +++ b/tasks/0019_106_19106342_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_205_19205019_qa_1/environment/bootstrap.sh b/tasks/0019_205_19205019_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_205_19205019_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_205_19205019_qa_1/environment/pull_bucket.py b/tasks/0019_205_19205019_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_205_19205019_qa_1/environment/pull_bucket.py +++ b/tasks/0019_205_19205019_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_205_19205019_qa_1/task.toml b/tasks/0019_205_19205019_qa_1/task.toml index 5b16cbe64a245f558b1d5e3f2ab60d25f15ad355..18f04a1ddcb037010afe58e4beef11d664527be7 100644 --- a/tasks/0019_205_19205019_qa_1/task.toml +++ b/tasks/0019_205_19205019_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_267_19267356_qa_5/environment/bootstrap.sh b/tasks/0019_267_19267356_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_267_19267356_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_267_19267356_qa_5/environment/pull_bucket.py b/tasks/0019_267_19267356_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_267_19267356_qa_5/environment/pull_bucket.py +++ b/tasks/0019_267_19267356_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_267_19267356_qa_5/task.toml b/tasks/0019_267_19267356_qa_5/task.toml index 81687b8a26385b0e0bf70992424c6226f7cc21c8..113c4d7892bfa4aa376e9b8b8b469d2fe3670742 100644 --- a/tasks/0019_267_19267356_qa_5/task.toml +++ b/tasks/0019_267_19267356_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_288_19288397_qa_1/environment/bootstrap.sh b/tasks/0019_288_19288397_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_288_19288397_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_288_19288397_qa_1/environment/pull_bucket.py b/tasks/0019_288_19288397_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_288_19288397_qa_1/environment/pull_bucket.py +++ b/tasks/0019_288_19288397_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_288_19288397_qa_1/task.toml b/tasks/0019_288_19288397_qa_1/task.toml index ee0612c4f4a30a86067a500e61296e586f2150b8..db98247e868143f149a79ffc4c5964770c98652f 100644 --- a/tasks/0019_288_19288397_qa_1/task.toml +++ b/tasks/0019_288_19288397_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_309_19309067_qa_5/environment/bootstrap.sh b/tasks/0019_309_19309067_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_309_19309067_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_309_19309067_qa_5/environment/pull_bucket.py b/tasks/0019_309_19309067_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_309_19309067_qa_5/environment/pull_bucket.py +++ b/tasks/0019_309_19309067_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_309_19309067_qa_5/task.toml b/tasks/0019_309_19309067_qa_5/task.toml index 8c925517a3bf39b5ecb57d7d15465adaad0d0e67..06c6c18687dcfc1ec8decda50efcc5b720f15755 100644 --- a/tasks/0019_309_19309067_qa_5/task.toml +++ b/tasks/0019_309_19309067_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_416_19416448_qa_4/environment/bootstrap.sh b/tasks/0019_416_19416448_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_416_19416448_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_416_19416448_qa_4/environment/pull_bucket.py b/tasks/0019_416_19416448_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_416_19416448_qa_4/environment/pull_bucket.py +++ b/tasks/0019_416_19416448_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_416_19416448_qa_4/task.toml b/tasks/0019_416_19416448_qa_4/task.toml index 94790b023176ace437ab37439ecd188e1bc975b8..d59a078364b772f167730389af622f794954dfd7 100644 --- a/tasks/0019_416_19416448_qa_4/task.toml +++ b/tasks/0019_416_19416448_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_434_19434702_qa_1/environment/bootstrap.sh b/tasks/0019_434_19434702_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_434_19434702_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_434_19434702_qa_1/environment/pull_bucket.py b/tasks/0019_434_19434702_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_434_19434702_qa_1/environment/pull_bucket.py +++ b/tasks/0019_434_19434702_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_434_19434702_qa_1/task.toml b/tasks/0019_434_19434702_qa_1/task.toml index c9ea6c32d5f3bd9bebcbcbef9ee7f3aea8e0017c..8a6e89c853de09fc2ed0fa4c08a17d5582159d98 100644 --- a/tasks/0019_434_19434702_qa_1/task.toml +++ b/tasks/0019_434_19434702_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_469_19469309_qa_5/environment/bootstrap.sh b/tasks/0019_469_19469309_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_469_19469309_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_469_19469309_qa_5/environment/pull_bucket.py b/tasks/0019_469_19469309_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_469_19469309_qa_5/environment/pull_bucket.py +++ b/tasks/0019_469_19469309_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_469_19469309_qa_5/task.toml b/tasks/0019_469_19469309_qa_5/task.toml index 4501e3498099f3ab536bac94fb44e6b54cc7d6f7..aa889e36b17ce341c50515d5bdaaa77cae79e372 100644 --- a/tasks/0019_469_19469309_qa_5/task.toml +++ b/tasks/0019_469_19469309_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_517_19517366_qa_3/environment/bootstrap.sh b/tasks/0019_517_19517366_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_517_19517366_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_517_19517366_qa_3/environment/pull_bucket.py b/tasks/0019_517_19517366_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_517_19517366_qa_3/environment/pull_bucket.py +++ b/tasks/0019_517_19517366_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_517_19517366_qa_3/task.toml b/tasks/0019_517_19517366_qa_3/task.toml index c141d1e0e76f3569c78b3e25d99b101ed666dabd..e1557df3bb4fb862b8a761da937af3cc04c183db 100644 --- a/tasks/0019_517_19517366_qa_3/task.toml +++ b/tasks/0019_517_19517366_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_517_19517811_qa_1/environment/bootstrap.sh b/tasks/0019_517_19517811_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_517_19517811_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_517_19517811_qa_1/environment/pull_bucket.py b/tasks/0019_517_19517811_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_517_19517811_qa_1/environment/pull_bucket.py +++ b/tasks/0019_517_19517811_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_517_19517811_qa_1/task.toml b/tasks/0019_517_19517811_qa_1/task.toml index 32f532e556a1739483917087eaa4b2f81ded7196..442347ad1912794384bc8a28efcafa0808159757 100644 --- a/tasks/0019_517_19517811_qa_1/task.toml +++ b/tasks/0019_517_19517811_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_521_19521236_qa_1/environment/bootstrap.sh b/tasks/0019_521_19521236_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_521_19521236_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_521_19521236_qa_1/environment/pull_bucket.py b/tasks/0019_521_19521236_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_521_19521236_qa_1/environment/pull_bucket.py +++ b/tasks/0019_521_19521236_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_521_19521236_qa_1/task.toml b/tasks/0019_521_19521236_qa_1/task.toml index cfc8ae79c5a01f88c7b6bca4450af15f2a7f5f95..2bf890ff112fed86e3b43203d93545c16137c497 100644 --- a/tasks/0019_521_19521236_qa_1/task.toml +++ b/tasks/0019_521_19521236_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_521_19521236_qa_2/environment/bootstrap.sh b/tasks/0019_521_19521236_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_521_19521236_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_521_19521236_qa_2/environment/pull_bucket.py b/tasks/0019_521_19521236_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_521_19521236_qa_2/environment/pull_bucket.py +++ b/tasks/0019_521_19521236_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_521_19521236_qa_2/task.toml b/tasks/0019_521_19521236_qa_2/task.toml index 2f3b3669fe3abcee3545e27aaeb5f3ca641405dc..37de72a059e1f552314fd481083f58f84b0135d9 100644 --- a/tasks/0019_521_19521236_qa_2/task.toml +++ b/tasks/0019_521_19521236_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_521_19521236_qa_3/environment/bootstrap.sh b/tasks/0019_521_19521236_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_521_19521236_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_521_19521236_qa_3/environment/pull_bucket.py b/tasks/0019_521_19521236_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_521_19521236_qa_3/environment/pull_bucket.py +++ b/tasks/0019_521_19521236_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_521_19521236_qa_3/task.toml b/tasks/0019_521_19521236_qa_3/task.toml index d535707e09ed64b1c0096025fa835b166c9f26bc..7f9cab4fbe7f9f2eee8d1fc1fd5e7ab1f6cc41ca 100644 --- a/tasks/0019_521_19521236_qa_3/task.toml +++ b/tasks/0019_521_19521236_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_570_19570997_qa_1/environment/bootstrap.sh b/tasks/0019_570_19570997_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_570_19570997_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_570_19570997_qa_1/environment/pull_bucket.py b/tasks/0019_570_19570997_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_570_19570997_qa_1/environment/pull_bucket.py +++ b/tasks/0019_570_19570997_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_570_19570997_qa_1/task.toml b/tasks/0019_570_19570997_qa_1/task.toml index ad388290a4727990649e1fb0ce2731ad22df5afc..41c73a444437ec09ed209aa51f9d22b16bedb6e3 100644 --- a/tasks/0019_570_19570997_qa_1/task.toml +++ b/tasks/0019_570_19570997_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_570_19570997_qa_5/environment/bootstrap.sh b/tasks/0019_570_19570997_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_570_19570997_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_570_19570997_qa_5/environment/pull_bucket.py b/tasks/0019_570_19570997_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_570_19570997_qa_5/environment/pull_bucket.py +++ b/tasks/0019_570_19570997_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_570_19570997_qa_5/task.toml b/tasks/0019_570_19570997_qa_5/task.toml index 4c87f64808f7463b9719f43a55ce19a3988e1f24..224b032ace223e8bfcc62692748465e3e75c1271 100644 --- a/tasks/0019_570_19570997_qa_5/task.toml +++ b/tasks/0019_570_19570997_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_685_19685428_qa_1/environment/bootstrap.sh b/tasks/0019_685_19685428_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_685_19685428_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_685_19685428_qa_1/environment/pull_bucket.py b/tasks/0019_685_19685428_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_685_19685428_qa_1/environment/pull_bucket.py +++ b/tasks/0019_685_19685428_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_685_19685428_qa_1/task.toml b/tasks/0019_685_19685428_qa_1/task.toml index c3e291321fd2e1f37ac1cb889a928d063beb855b..1e58fafd7257674faee7439b67d0bb75c9a6e0ae 100644 --- a/tasks/0019_685_19685428_qa_1/task.toml +++ b/tasks/0019_685_19685428_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_706_19706257_qa_2/environment/bootstrap.sh b/tasks/0019_706_19706257_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_706_19706257_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_706_19706257_qa_2/environment/pull_bucket.py b/tasks/0019_706_19706257_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_706_19706257_qa_2/environment/pull_bucket.py +++ b/tasks/0019_706_19706257_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_706_19706257_qa_2/task.toml b/tasks/0019_706_19706257_qa_2/task.toml index 1f46859b1fa85656e45f491456fd905ecb1c4f90..804311176196147013329f7b2bc9483bfb5dd54e 100644 --- a/tasks/0019_706_19706257_qa_2/task.toml +++ b/tasks/0019_706_19706257_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_787_19787626_qa_3/environment/bootstrap.sh b/tasks/0019_787_19787626_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_787_19787626_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_787_19787626_qa_3/environment/pull_bucket.py b/tasks/0019_787_19787626_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_787_19787626_qa_3/environment/pull_bucket.py +++ b/tasks/0019_787_19787626_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_787_19787626_qa_3/task.toml b/tasks/0019_787_19787626_qa_3/task.toml index aac74a7f192a857b377836e89191a1cab5847095..075c4d5b0f4c6951c60ece0698b9d6d47072bbd6 100644 --- a/tasks/0019_787_19787626_qa_3/task.toml +++ b/tasks/0019_787_19787626_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_787_19787626_qa_4/environment/bootstrap.sh b/tasks/0019_787_19787626_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_787_19787626_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_787_19787626_qa_4/environment/pull_bucket.py b/tasks/0019_787_19787626_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_787_19787626_qa_4/environment/pull_bucket.py +++ b/tasks/0019_787_19787626_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_787_19787626_qa_4/task.toml b/tasks/0019_787_19787626_qa_4/task.toml index 90b9e23dc834e36c3b27f427daf224623d36f2da..04d5acf39fc06fc7da7b637ee80ce37179fab8a5 100644 --- a/tasks/0019_787_19787626_qa_4/task.toml +++ b/tasks/0019_787_19787626_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_978_19978878_qa_2/environment/bootstrap.sh b/tasks/0019_978_19978878_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_978_19978878_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_978_19978878_qa_2/environment/pull_bucket.py b/tasks/0019_978_19978878_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_978_19978878_qa_2/environment/pull_bucket.py +++ b/tasks/0019_978_19978878_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_978_19978878_qa_2/task.toml b/tasks/0019_978_19978878_qa_2/task.toml index c7dd8ed91eccae97adec6f31e6f26be48c6e5a71..34a71b03c5d3b95e9cc63982eeb27422b06d1179 100644 --- a/tasks/0019_978_19978878_qa_2/task.toml +++ b/tasks/0019_978_19978878_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0019_978_19978878_qa_3/environment/bootstrap.sh b/tasks/0019_978_19978878_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0019_978_19978878_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0019_978_19978878_qa_3/environment/pull_bucket.py b/tasks/0019_978_19978878_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0019_978_19978878_qa_3/environment/pull_bucket.py +++ b/tasks/0019_978_19978878_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0019_978_19978878_qa_3/task.toml b/tasks/0019_978_19978878_qa_3/task.toml index 51accb97eb6f06c03704e6dd3820ccb985dd1f6c..a9c93fdae5e711f34743487e539668c8f9640fb0 100644 --- a/tasks/0019_978_19978878_qa_3/task.toml +++ b/tasks/0019_978_19978878_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_001_20001575_qa_5/environment/bootstrap.sh b/tasks/0020_001_20001575_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_001_20001575_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_001_20001575_qa_5/environment/pull_bucket.py b/tasks/0020_001_20001575_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_001_20001575_qa_5/environment/pull_bucket.py +++ b/tasks/0020_001_20001575_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_001_20001575_qa_5/task.toml b/tasks/0020_001_20001575_qa_5/task.toml index f073eb74fece2f076747c5597a0c2677e799f525..fa8c1df23a9cea6ae30c43a9308ec45f5f2ce8a7 100644 --- a/tasks/0020_001_20001575_qa_5/task.toml +++ b/tasks/0020_001_20001575_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_098_20098950_qa_1/environment/bootstrap.sh b/tasks/0020_098_20098950_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_098_20098950_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_098_20098950_qa_1/environment/pull_bucket.py b/tasks/0020_098_20098950_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_098_20098950_qa_1/environment/pull_bucket.py +++ b/tasks/0020_098_20098950_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_098_20098950_qa_1/task.toml b/tasks/0020_098_20098950_qa_1/task.toml index 6a88542e1f895db786af0c872cdd5940e0317f03..87112033daf3804f262511bbfbddc952a7f334b2 100644 --- a/tasks/0020_098_20098950_qa_1/task.toml +++ b/tasks/0020_098_20098950_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_143_20143569_qa_3/environment/bootstrap.sh b/tasks/0020_143_20143569_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_143_20143569_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_143_20143569_qa_3/environment/pull_bucket.py b/tasks/0020_143_20143569_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_143_20143569_qa_3/environment/pull_bucket.py +++ b/tasks/0020_143_20143569_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_143_20143569_qa_3/task.toml b/tasks/0020_143_20143569_qa_3/task.toml index 50b4184b629993d50485ded92b8bf814642dacde..f867fb01260903f3db7c9c7743b14c548e26959e 100644 --- a/tasks/0020_143_20143569_qa_3/task.toml +++ b/tasks/0020_143_20143569_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_162_20162109_qa_3/environment/bootstrap.sh b/tasks/0020_162_20162109_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_162_20162109_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_162_20162109_qa_3/environment/pull_bucket.py b/tasks/0020_162_20162109_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_162_20162109_qa_3/environment/pull_bucket.py +++ b/tasks/0020_162_20162109_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_162_20162109_qa_3/task.toml b/tasks/0020_162_20162109_qa_3/task.toml index 84cac4c674e3f26c6c671682feb19e60e74f0c85..11f0f0f57ed55433660d258622d4fd021bb3d8da 100644 --- a/tasks/0020_162_20162109_qa_3/task.toml +++ b/tasks/0020_162_20162109_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_216_20216126_qa_1/environment/bootstrap.sh b/tasks/0020_216_20216126_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_216_20216126_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_216_20216126_qa_1/environment/pull_bucket.py b/tasks/0020_216_20216126_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_216_20216126_qa_1/environment/pull_bucket.py +++ b/tasks/0020_216_20216126_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_216_20216126_qa_1/task.toml b/tasks/0020_216_20216126_qa_1/task.toml index fbdf3ea6ca2f781683adc25635bb0290ea19267a..37155d11646e38d8a0363d3286a58111c37f3b61 100644 --- a/tasks/0020_216_20216126_qa_1/task.toml +++ b/tasks/0020_216_20216126_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_216_20216126_qa_2/environment/bootstrap.sh b/tasks/0020_216_20216126_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_216_20216126_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_216_20216126_qa_2/environment/pull_bucket.py b/tasks/0020_216_20216126_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_216_20216126_qa_2/environment/pull_bucket.py +++ b/tasks/0020_216_20216126_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_216_20216126_qa_2/task.toml b/tasks/0020_216_20216126_qa_2/task.toml index a20849d772671c13dc30bf46a865dd78db66fd90..c591c7f25600f4814b282c49264e44efc2a6e75f 100644 --- a/tasks/0020_216_20216126_qa_2/task.toml +++ b/tasks/0020_216_20216126_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_395_20395932_qa_4/environment/bootstrap.sh b/tasks/0020_395_20395932_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_395_20395932_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_395_20395932_qa_4/environment/pull_bucket.py b/tasks/0020_395_20395932_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_395_20395932_qa_4/environment/pull_bucket.py +++ b/tasks/0020_395_20395932_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_395_20395932_qa_4/task.toml b/tasks/0020_395_20395932_qa_4/task.toml index c00852dd711eebf658be61a81827df423151cd0f..c9c6c01e7a3c8279bd6ff854d7273c14b8dfcef5 100644 --- a/tasks/0020_395_20395932_qa_4/task.toml +++ b/tasks/0020_395_20395932_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_397_20397857_qa_2/environment/bootstrap.sh b/tasks/0020_397_20397857_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_397_20397857_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_397_20397857_qa_2/environment/pull_bucket.py b/tasks/0020_397_20397857_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_397_20397857_qa_2/environment/pull_bucket.py +++ b/tasks/0020_397_20397857_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_397_20397857_qa_2/task.toml b/tasks/0020_397_20397857_qa_2/task.toml index 4ef79d6854fb291e9ff098ccc2d764a58fe4770b..49dc9b2e7ccf5169071d3dbf19bac1a7597db8d0 100644 --- a/tasks/0020_397_20397857_qa_2/task.toml +++ b/tasks/0020_397_20397857_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_397_20397857_qa_5/environment/bootstrap.sh b/tasks/0020_397_20397857_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_397_20397857_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_397_20397857_qa_5/environment/pull_bucket.py b/tasks/0020_397_20397857_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_397_20397857_qa_5/environment/pull_bucket.py +++ b/tasks/0020_397_20397857_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_397_20397857_qa_5/task.toml b/tasks/0020_397_20397857_qa_5/task.toml index 46286163fe09b4c7d83aac1e96315a9cc4841a6b..6790f52c69e3a15c436cf3a4d46102d23c28a117 100644 --- a/tasks/0020_397_20397857_qa_5/task.toml +++ b/tasks/0020_397_20397857_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_400_20400458_qa_3/environment/bootstrap.sh b/tasks/0020_400_20400458_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_400_20400458_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_400_20400458_qa_3/environment/pull_bucket.py b/tasks/0020_400_20400458_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_400_20400458_qa_3/environment/pull_bucket.py +++ b/tasks/0020_400_20400458_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_400_20400458_qa_3/task.toml b/tasks/0020_400_20400458_qa_3/task.toml index db9c540a34a9315e85c0b796d0762d005a0771b5..6f2310800f593ffeacc7efdf2845a74d003391c5 100644 --- a/tasks/0020_400_20400458_qa_3/task.toml +++ b/tasks/0020_400_20400458_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_470_20470916_qa_1/environment/bootstrap.sh b/tasks/0020_470_20470916_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_470_20470916_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_470_20470916_qa_1/environment/pull_bucket.py b/tasks/0020_470_20470916_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_470_20470916_qa_1/environment/pull_bucket.py +++ b/tasks/0020_470_20470916_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_470_20470916_qa_1/task.toml b/tasks/0020_470_20470916_qa_1/task.toml index ba6dc35ded4c19bec9e110469e2f262bc38a4e0e..0e45523256768a659c9a1b18be62b56a8e999a60 100644 --- a/tasks/0020_470_20470916_qa_1/task.toml +++ b/tasks/0020_470_20470916_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_511_20511877_qa_1/environment/bootstrap.sh b/tasks/0020_511_20511877_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_511_20511877_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_511_20511877_qa_1/environment/pull_bucket.py b/tasks/0020_511_20511877_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_511_20511877_qa_1/environment/pull_bucket.py +++ b/tasks/0020_511_20511877_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_511_20511877_qa_1/task.toml b/tasks/0020_511_20511877_qa_1/task.toml index 4949bcfc47460d8608451225e3298332278316d3..eb39465f6af1ee2ad3d207111be9f7d73ee77a60 100644 --- a/tasks/0020_511_20511877_qa_1/task.toml +++ b/tasks/0020_511_20511877_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_511_20511877_qa_4/environment/bootstrap.sh b/tasks/0020_511_20511877_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_511_20511877_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_511_20511877_qa_4/environment/pull_bucket.py b/tasks/0020_511_20511877_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_511_20511877_qa_4/environment/pull_bucket.py +++ b/tasks/0020_511_20511877_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_511_20511877_qa_4/task.toml b/tasks/0020_511_20511877_qa_4/task.toml index 6a6bb4a777fc85408bf75a0e509d5c5451461936..939f9d5de4f792a2f41d669235e80fd3fa37cf10 100644 --- a/tasks/0020_511_20511877_qa_4/task.toml +++ b/tasks/0020_511_20511877_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_539_20539860_qa_3/environment/bootstrap.sh b/tasks/0020_539_20539860_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_539_20539860_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_539_20539860_qa_3/environment/pull_bucket.py b/tasks/0020_539_20539860_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_539_20539860_qa_3/environment/pull_bucket.py +++ b/tasks/0020_539_20539860_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_539_20539860_qa_3/task.toml b/tasks/0020_539_20539860_qa_3/task.toml index 02b135c6ddf6156073297a9d95579c861b6d2c53..142d2d49137a3ffbb1f4aef181e31ba0165ce546 100644 --- a/tasks/0020_539_20539860_qa_3/task.toml +++ b/tasks/0020_539_20539860_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_539_20539860_qa_5/environment/bootstrap.sh b/tasks/0020_539_20539860_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_539_20539860_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_539_20539860_qa_5/environment/pull_bucket.py b/tasks/0020_539_20539860_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_539_20539860_qa_5/environment/pull_bucket.py +++ b/tasks/0020_539_20539860_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_539_20539860_qa_5/task.toml b/tasks/0020_539_20539860_qa_5/task.toml index c33b7ff041d1b913aeeadb4b1020574dabc4a907..00c64c762ab420cf875df2b69164c7bd48d9a614 100644 --- a/tasks/0020_539_20539860_qa_5/task.toml +++ b/tasks/0020_539_20539860_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_610_20610563_qa_5/environment/bootstrap.sh b/tasks/0020_610_20610563_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_610_20610563_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_610_20610563_qa_5/environment/pull_bucket.py b/tasks/0020_610_20610563_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_610_20610563_qa_5/environment/pull_bucket.py +++ b/tasks/0020_610_20610563_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_610_20610563_qa_5/task.toml b/tasks/0020_610_20610563_qa_5/task.toml index 65dd7a55fa5ded5bdbbaa7100fa2d94246eb5d8d..fe512fb00c5811991a43096d1d228f6db06b7ae2 100644 --- a/tasks/0020_610_20610563_qa_5/task.toml +++ b/tasks/0020_610_20610563_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_611_20611134_qa_1/environment/bootstrap.sh b/tasks/0020_611_20611134_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_611_20611134_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_611_20611134_qa_1/environment/pull_bucket.py b/tasks/0020_611_20611134_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_611_20611134_qa_1/environment/pull_bucket.py +++ b/tasks/0020_611_20611134_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_611_20611134_qa_1/task.toml b/tasks/0020_611_20611134_qa_1/task.toml index e2d187ec66b7ef5ea13065805aadfd83fcd3f735..3d514e65f12294cf39fda377b44325b57e15ff76 100644 --- a/tasks/0020_611_20611134_qa_1/task.toml +++ b/tasks/0020_611_20611134_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_613_20613845_qa_4/environment/bootstrap.sh b/tasks/0020_613_20613845_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_613_20613845_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_613_20613845_qa_4/environment/pull_bucket.py b/tasks/0020_613_20613845_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_613_20613845_qa_4/environment/pull_bucket.py +++ b/tasks/0020_613_20613845_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_613_20613845_qa_4/task.toml b/tasks/0020_613_20613845_qa_4/task.toml index 56a867d885a235124470e81d3f108f76b5fff044..d2f059009fb87b4562630d915fccd1ef28c5e135 100644 --- a/tasks/0020_613_20613845_qa_4/task.toml +++ b/tasks/0020_613_20613845_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_756_20756026_qa_2/environment/bootstrap.sh b/tasks/0020_756_20756026_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_756_20756026_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_756_20756026_qa_2/environment/pull_bucket.py b/tasks/0020_756_20756026_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_756_20756026_qa_2/environment/pull_bucket.py +++ b/tasks/0020_756_20756026_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_756_20756026_qa_2/task.toml b/tasks/0020_756_20756026_qa_2/task.toml index 312fb83a6121d5a34758f4cb69742d9ef82bcbad..9a50dbd1dc86374a76563bf2e3800b8bba73d6bd 100644 --- a/tasks/0020_756_20756026_qa_2/task.toml +++ b/tasks/0020_756_20756026_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_764_20764174_qa_3/environment/bootstrap.sh b/tasks/0020_764_20764174_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_764_20764174_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_764_20764174_qa_3/environment/pull_bucket.py b/tasks/0020_764_20764174_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_764_20764174_qa_3/environment/pull_bucket.py +++ b/tasks/0020_764_20764174_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_764_20764174_qa_3/task.toml b/tasks/0020_764_20764174_qa_3/task.toml index 4ee6dda2a727c247cb89b25d8d73a3054ce7666f..7e8c352ae22477e69b04378ff7bd65a83b316ba0 100644 --- a/tasks/0020_764_20764174_qa_3/task.toml +++ b/tasks/0020_764_20764174_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_815_20815404_qa_2/environment/bootstrap.sh b/tasks/0020_815_20815404_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_815_20815404_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_815_20815404_qa_2/environment/pull_bucket.py b/tasks/0020_815_20815404_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_815_20815404_qa_2/environment/pull_bucket.py +++ b/tasks/0020_815_20815404_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_815_20815404_qa_2/task.toml b/tasks/0020_815_20815404_qa_2/task.toml index 98d6b552f0455a002712e51f83cce74917d53acb..e10945e73b71666d86a079f7cbad955e100c12f9 100644 --- a/tasks/0020_815_20815404_qa_2/task.toml +++ b/tasks/0020_815_20815404_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_828_20828784_qa_1/environment/bootstrap.sh b/tasks/0020_828_20828784_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_828_20828784_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_828_20828784_qa_1/environment/pull_bucket.py b/tasks/0020_828_20828784_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_828_20828784_qa_1/environment/pull_bucket.py +++ b/tasks/0020_828_20828784_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_828_20828784_qa_1/task.toml b/tasks/0020_828_20828784_qa_1/task.toml index 7202f6735ec8ac0f5e76bf77b8038f4ae54ce66b..eb24095cfaccacdb976c386d74adb48a190285b0 100644 --- a/tasks/0020_828_20828784_qa_1/task.toml +++ b/tasks/0020_828_20828784_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_895_20895805_qa_2/environment/bootstrap.sh b/tasks/0020_895_20895805_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_895_20895805_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_895_20895805_qa_2/environment/pull_bucket.py b/tasks/0020_895_20895805_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_895_20895805_qa_2/environment/pull_bucket.py +++ b/tasks/0020_895_20895805_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_895_20895805_qa_2/task.toml b/tasks/0020_895_20895805_qa_2/task.toml index 4816a7abad76e7b27df3300e5cc745dd6c1fcdf7..d3d4fb2b0fc7e4bf6632b36c9c3d27826a938417 100644 --- a/tasks/0020_895_20895805_qa_2/task.toml +++ b/tasks/0020_895_20895805_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_904_20904261_qa_2/environment/bootstrap.sh b/tasks/0020_904_20904261_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_904_20904261_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_904_20904261_qa_2/environment/pull_bucket.py b/tasks/0020_904_20904261_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_904_20904261_qa_2/environment/pull_bucket.py +++ b/tasks/0020_904_20904261_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_904_20904261_qa_2/task.toml b/tasks/0020_904_20904261_qa_2/task.toml index 4ddd77aaf1ce9aeef7e38226d6b3804fe575c72f..aa68583944a0d3e9ac20ff34d9f4572f466de367 100644 --- a/tasks/0020_904_20904261_qa_2/task.toml +++ b/tasks/0020_904_20904261_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_991_20991108_qa_5/environment/bootstrap.sh b/tasks/0020_991_20991108_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_991_20991108_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_991_20991108_qa_5/environment/pull_bucket.py b/tasks/0020_991_20991108_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_991_20991108_qa_5/environment/pull_bucket.py +++ b/tasks/0020_991_20991108_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_991_20991108_qa_5/task.toml b/tasks/0020_991_20991108_qa_5/task.toml index fd96fedbd435ff260e0243319db7bb599a7bf113..25d156d3af12b49f2ab61325bf2b4344bce56844 100644 --- a/tasks/0020_991_20991108_qa_5/task.toml +++ b/tasks/0020_991_20991108_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0020_991_20991289_qa_3/environment/bootstrap.sh b/tasks/0020_991_20991289_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0020_991_20991289_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0020_991_20991289_qa_3/environment/pull_bucket.py b/tasks/0020_991_20991289_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0020_991_20991289_qa_3/environment/pull_bucket.py +++ b/tasks/0020_991_20991289_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0020_991_20991289_qa_3/task.toml b/tasks/0020_991_20991289_qa_3/task.toml index 13d47618e417ee2529ea97a7af3f26ce94944906..bb0467d9d6818f6a07685861f87055b034d36b8d 100644 --- a/tasks/0020_991_20991289_qa_3/task.toml +++ b/tasks/0020_991_20991289_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_030_21030697_qa_5/environment/bootstrap.sh b/tasks/0021_030_21030697_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_030_21030697_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_030_21030697_qa_5/environment/pull_bucket.py b/tasks/0021_030_21030697_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_030_21030697_qa_5/environment/pull_bucket.py +++ b/tasks/0021_030_21030697_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_030_21030697_qa_5/task.toml b/tasks/0021_030_21030697_qa_5/task.toml index 7358bc62bc7c6f250674287989adb4a64d8e54de..99475d57dd82264a880025ebfe57d23becc52eb2 100644 --- a/tasks/0021_030_21030697_qa_5/task.toml +++ b/tasks/0021_030_21030697_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_046_21046589_qa_1/environment/bootstrap.sh b/tasks/0021_046_21046589_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_046_21046589_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_046_21046589_qa_1/environment/pull_bucket.py b/tasks/0021_046_21046589_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_046_21046589_qa_1/environment/pull_bucket.py +++ b/tasks/0021_046_21046589_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_046_21046589_qa_1/task.toml b/tasks/0021_046_21046589_qa_1/task.toml index eb987a4942378e1cd2ab17582fb9beb31f1c1237..1215a7908133d33d83ff2550d95d82e687b34cbd 100644 --- a/tasks/0021_046_21046589_qa_1/task.toml +++ b/tasks/0021_046_21046589_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_063_21063235_qa_1/environment/bootstrap.sh b/tasks/0021_063_21063235_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_063_21063235_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_063_21063235_qa_1/environment/pull_bucket.py b/tasks/0021_063_21063235_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_063_21063235_qa_1/environment/pull_bucket.py +++ b/tasks/0021_063_21063235_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_063_21063235_qa_1/task.toml b/tasks/0021_063_21063235_qa_1/task.toml index dd73420b47f04761ceecd4749399eb73e7fb9ce4..f68ff1fc662b253ebb591c6d29c04e0377aa7527 100644 --- a/tasks/0021_063_21063235_qa_1/task.toml +++ b/tasks/0021_063_21063235_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_093_21093883_qa_2/environment/bootstrap.sh b/tasks/0021_093_21093883_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_093_21093883_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_093_21093883_qa_2/environment/pull_bucket.py b/tasks/0021_093_21093883_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_093_21093883_qa_2/environment/pull_bucket.py +++ b/tasks/0021_093_21093883_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_093_21093883_qa_2/task.toml b/tasks/0021_093_21093883_qa_2/task.toml index 043216b96f606319d540030a61bbdcba1ac9bd7b..2153e9413b4d515fa9e9011ff392b8f57657c41b 100644 --- a/tasks/0021_093_21093883_qa_2/task.toml +++ b/tasks/0021_093_21093883_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_093_21093883_qa_3/environment/bootstrap.sh b/tasks/0021_093_21093883_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_093_21093883_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_093_21093883_qa_3/environment/pull_bucket.py b/tasks/0021_093_21093883_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_093_21093883_qa_3/environment/pull_bucket.py +++ b/tasks/0021_093_21093883_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_093_21093883_qa_3/task.toml b/tasks/0021_093_21093883_qa_3/task.toml index aac7e34363ddb84ea5f82b849ddd216b99c7eb04..e62160fecae40e6c1ed74536fa54c62c93216620 100644 --- a/tasks/0021_093_21093883_qa_3/task.toml +++ b/tasks/0021_093_21093883_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_121_21121885_qa_3/environment/bootstrap.sh b/tasks/0021_121_21121885_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_121_21121885_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_121_21121885_qa_3/environment/pull_bucket.py b/tasks/0021_121_21121885_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_121_21121885_qa_3/environment/pull_bucket.py +++ b/tasks/0021_121_21121885_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_121_21121885_qa_3/task.toml b/tasks/0021_121_21121885_qa_3/task.toml index ffffb5afd6733f1c8c3ecbf040b1c3b710a73057..2c0e0c8d0fff29c2dce68f63d643e3866aa37465 100644 --- a/tasks/0021_121_21121885_qa_3/task.toml +++ b/tasks/0021_121_21121885_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_135_21135636_qa_3/environment/bootstrap.sh b/tasks/0021_135_21135636_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_135_21135636_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_135_21135636_qa_3/environment/pull_bucket.py b/tasks/0021_135_21135636_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_135_21135636_qa_3/environment/pull_bucket.py +++ b/tasks/0021_135_21135636_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_135_21135636_qa_3/task.toml b/tasks/0021_135_21135636_qa_3/task.toml index 54dad2e397ef1b3d04605f19d7230ffff347aca1..67214a6daaca03d2e2179cf861575d4c8d8bc6ca 100644 --- a/tasks/0021_135_21135636_qa_3/task.toml +++ b/tasks/0021_135_21135636_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_145_21145195_qa_3/environment/bootstrap.sh b/tasks/0021_145_21145195_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_145_21145195_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_145_21145195_qa_3/environment/pull_bucket.py b/tasks/0021_145_21145195_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_145_21145195_qa_3/environment/pull_bucket.py +++ b/tasks/0021_145_21145195_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_145_21145195_qa_3/task.toml b/tasks/0021_145_21145195_qa_3/task.toml index 024fe1b1ab723e2977a0f2428daabdb6c945f585..7c1b4e334ea7201a6fb5e734c8ec4c4a298b035e 100644 --- a/tasks/0021_145_21145195_qa_3/task.toml +++ b/tasks/0021_145_21145195_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_147_21147512_qa_4/environment/bootstrap.sh b/tasks/0021_147_21147512_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_147_21147512_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_147_21147512_qa_4/environment/pull_bucket.py b/tasks/0021_147_21147512_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_147_21147512_qa_4/environment/pull_bucket.py +++ b/tasks/0021_147_21147512_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_147_21147512_qa_4/task.toml b/tasks/0021_147_21147512_qa_4/task.toml index e56e7fa8a93726bea99064daa81245c48b2d4627..99c68ba44cb714464264cd1ecc508ad92dd24da2 100644 --- a/tasks/0021_147_21147512_qa_4/task.toml +++ b/tasks/0021_147_21147512_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_193_21193214_qa_1/environment/bootstrap.sh b/tasks/0021_193_21193214_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_193_21193214_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_193_21193214_qa_1/environment/pull_bucket.py b/tasks/0021_193_21193214_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_193_21193214_qa_1/environment/pull_bucket.py +++ b/tasks/0021_193_21193214_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_193_21193214_qa_1/task.toml b/tasks/0021_193_21193214_qa_1/task.toml index 3421e2f1b8e909b79d5518b231bc10c76876ab1b..92cb31f502c50e3dd3e0ef8238239e0fb534c7f2 100644 --- a/tasks/0021_193_21193214_qa_1/task.toml +++ b/tasks/0021_193_21193214_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_193_21193214_qa_3/environment/bootstrap.sh b/tasks/0021_193_21193214_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_193_21193214_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_193_21193214_qa_3/environment/pull_bucket.py b/tasks/0021_193_21193214_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_193_21193214_qa_3/environment/pull_bucket.py +++ b/tasks/0021_193_21193214_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_193_21193214_qa_3/task.toml b/tasks/0021_193_21193214_qa_3/task.toml index f269bc16e332609adbd62d396a20a9b90d42d622..1c1a164d3048b116913d6dcfe7b9a40e09c953f3 100644 --- a/tasks/0021_193_21193214_qa_3/task.toml +++ b/tasks/0021_193_21193214_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_193_21193214_qa_5/environment/bootstrap.sh b/tasks/0021_193_21193214_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_193_21193214_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_193_21193214_qa_5/environment/pull_bucket.py b/tasks/0021_193_21193214_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_193_21193214_qa_5/environment/pull_bucket.py +++ b/tasks/0021_193_21193214_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_193_21193214_qa_5/task.toml b/tasks/0021_193_21193214_qa_5/task.toml index d903fd8a9a083ec0c680936eff14d845de99a855..b567e5533109d079efe82f0d7818193d17eec5a4 100644 --- a/tasks/0021_193_21193214_qa_5/task.toml +++ b/tasks/0021_193_21193214_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_222_21222912_qa_1/environment/bootstrap.sh b/tasks/0021_222_21222912_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_222_21222912_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_222_21222912_qa_1/environment/pull_bucket.py b/tasks/0021_222_21222912_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_222_21222912_qa_1/environment/pull_bucket.py +++ b/tasks/0021_222_21222912_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_222_21222912_qa_1/task.toml b/tasks/0021_222_21222912_qa_1/task.toml index 9c991bb34ce8d80ae5a3e0ad0d8224fdfbb1b614..49ef0b809a4ce13752c9aafab9741cd5384432d0 100644 --- a/tasks/0021_222_21222912_qa_1/task.toml +++ b/tasks/0021_222_21222912_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_225_21225981_qa_3/environment/bootstrap.sh b/tasks/0021_225_21225981_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_225_21225981_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_225_21225981_qa_3/environment/pull_bucket.py b/tasks/0021_225_21225981_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_225_21225981_qa_3/environment/pull_bucket.py +++ b/tasks/0021_225_21225981_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_225_21225981_qa_3/task.toml b/tasks/0021_225_21225981_qa_3/task.toml index 7295156b48f995521467d7ea8d8aa6967583c4a1..cac846c2ca17bc35624d461812e8d220200f2d2a 100644 --- a/tasks/0021_225_21225981_qa_3/task.toml +++ b/tasks/0021_225_21225981_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_225_21225981_qa_4/environment/bootstrap.sh b/tasks/0021_225_21225981_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_225_21225981_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_225_21225981_qa_4/environment/pull_bucket.py b/tasks/0021_225_21225981_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_225_21225981_qa_4/environment/pull_bucket.py +++ b/tasks/0021_225_21225981_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_225_21225981_qa_4/task.toml b/tasks/0021_225_21225981_qa_4/task.toml index 7884ed03d2044ce55af0f9cb0bb63d24aa001c7b..dabd39d401a698849a35799f6d2dab92474a29a3 100644 --- a/tasks/0021_225_21225981_qa_4/task.toml +++ b/tasks/0021_225_21225981_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_299_21299002_qa_3/environment/bootstrap.sh b/tasks/0021_299_21299002_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_299_21299002_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_299_21299002_qa_3/environment/pull_bucket.py b/tasks/0021_299_21299002_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_299_21299002_qa_3/environment/pull_bucket.py +++ b/tasks/0021_299_21299002_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_299_21299002_qa_3/task.toml b/tasks/0021_299_21299002_qa_3/task.toml index d37502b00390236358b74e99b87a154daae9788d..6e9e9007fed0b794257b03e6c5ac5b1f600f1da9 100644 --- a/tasks/0021_299_21299002_qa_3/task.toml +++ b/tasks/0021_299_21299002_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_336_21336465_qa_1/environment/bootstrap.sh b/tasks/0021_336_21336465_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_336_21336465_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_336_21336465_qa_1/environment/pull_bucket.py b/tasks/0021_336_21336465_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_336_21336465_qa_1/environment/pull_bucket.py +++ b/tasks/0021_336_21336465_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_336_21336465_qa_1/task.toml b/tasks/0021_336_21336465_qa_1/task.toml index 1e24cf7d51e485e002f85126c9713cac48245384..fb021b475f10eb86d8fd7c4c65e1a977d6c21697 100644 --- a/tasks/0021_336_21336465_qa_1/task.toml +++ b/tasks/0021_336_21336465_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_336_21336465_qa_2/environment/bootstrap.sh b/tasks/0021_336_21336465_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_336_21336465_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_336_21336465_qa_2/environment/pull_bucket.py b/tasks/0021_336_21336465_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_336_21336465_qa_2/environment/pull_bucket.py +++ b/tasks/0021_336_21336465_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_336_21336465_qa_2/task.toml b/tasks/0021_336_21336465_qa_2/task.toml index 17c8980a2cfe011c3e6e9f8c8532eb73179d28c0..0644686d51cfc95834473ce5f3211cfe81fdb856 100644 --- a/tasks/0021_336_21336465_qa_2/task.toml +++ b/tasks/0021_336_21336465_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_353_21353656_qa_1/environment/bootstrap.sh b/tasks/0021_353_21353656_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_353_21353656_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_353_21353656_qa_1/environment/pull_bucket.py b/tasks/0021_353_21353656_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_353_21353656_qa_1/environment/pull_bucket.py +++ b/tasks/0021_353_21353656_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_353_21353656_qa_1/task.toml b/tasks/0021_353_21353656_qa_1/task.toml index b294174f6b37cf546f8b80944d2503d52a456527..27d41a68e7443877d894a0fd799ca3b74b302474 100644 --- a/tasks/0021_353_21353656_qa_1/task.toml +++ b/tasks/0021_353_21353656_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_358_21358195_qa_1/environment/bootstrap.sh b/tasks/0021_358_21358195_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_358_21358195_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_358_21358195_qa_1/environment/pull_bucket.py b/tasks/0021_358_21358195_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_358_21358195_qa_1/environment/pull_bucket.py +++ b/tasks/0021_358_21358195_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_358_21358195_qa_1/task.toml b/tasks/0021_358_21358195_qa_1/task.toml index a57fc9028b89c111d31006ec40af4815469c1346..3ddd9c725648f96f538152fac6463b06f386bc18 100644 --- a/tasks/0021_358_21358195_qa_1/task.toml +++ b/tasks/0021_358_21358195_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_358_21358195_qa_4/environment/bootstrap.sh b/tasks/0021_358_21358195_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_358_21358195_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_358_21358195_qa_4/environment/pull_bucket.py b/tasks/0021_358_21358195_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_358_21358195_qa_4/environment/pull_bucket.py +++ b/tasks/0021_358_21358195_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_358_21358195_qa_4/task.toml b/tasks/0021_358_21358195_qa_4/task.toml index ad05681bc8ecb6bbbf4c791c5b868fd4dad8fdec..4c6327857fee574c1644230721e7a0b705d437f6 100644 --- a/tasks/0021_358_21358195_qa_4/task.toml +++ b/tasks/0021_358_21358195_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_358_21358195_qa_5/environment/bootstrap.sh b/tasks/0021_358_21358195_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_358_21358195_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_358_21358195_qa_5/environment/pull_bucket.py b/tasks/0021_358_21358195_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_358_21358195_qa_5/environment/pull_bucket.py +++ b/tasks/0021_358_21358195_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_358_21358195_qa_5/task.toml b/tasks/0021_358_21358195_qa_5/task.toml index 0da962d2f541e896819efc591fe554c324d5fbba..16f109796d0750adc55469812cb27a3c85a5d003 100644 --- a/tasks/0021_358_21358195_qa_5/task.toml +++ b/tasks/0021_358_21358195_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_384_21384330_qa_2/environment/bootstrap.sh b/tasks/0021_384_21384330_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_384_21384330_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_384_21384330_qa_2/environment/pull_bucket.py b/tasks/0021_384_21384330_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_384_21384330_qa_2/environment/pull_bucket.py +++ b/tasks/0021_384_21384330_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_384_21384330_qa_2/task.toml b/tasks/0021_384_21384330_qa_2/task.toml index 41c711c2de306fd324f5b5506b31bedc4f4c4b65..093192bbecddbfcbe428825d153155ad61fb7674 100644 --- a/tasks/0021_384_21384330_qa_2/task.toml +++ b/tasks/0021_384_21384330_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_389_21389737_qa_4/environment/bootstrap.sh b/tasks/0021_389_21389737_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_389_21389737_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_389_21389737_qa_4/environment/pull_bucket.py b/tasks/0021_389_21389737_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_389_21389737_qa_4/environment/pull_bucket.py +++ b/tasks/0021_389_21389737_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_389_21389737_qa_4/task.toml b/tasks/0021_389_21389737_qa_4/task.toml index 5513b9af09986b6efe3c712edc5cdbd412dc0083..4ceee1d4aa64527b56280daf574fbe9f993447c6 100644 --- a/tasks/0021_389_21389737_qa_4/task.toml +++ b/tasks/0021_389_21389737_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_453_21453047_qa_2/environment/bootstrap.sh b/tasks/0021_453_21453047_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_453_21453047_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_453_21453047_qa_2/environment/pull_bucket.py b/tasks/0021_453_21453047_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_453_21453047_qa_2/environment/pull_bucket.py +++ b/tasks/0021_453_21453047_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_453_21453047_qa_2/task.toml b/tasks/0021_453_21453047_qa_2/task.toml index 264f4f0d235c3d1c35ad1e319173470f6bd72ac7..a545f2aac8c08d66fc94f26552821378711c3cb5 100644 --- a/tasks/0021_453_21453047_qa_2/task.toml +++ b/tasks/0021_453_21453047_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_453_21453047_qa_4/environment/bootstrap.sh b/tasks/0021_453_21453047_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_453_21453047_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_453_21453047_qa_4/environment/pull_bucket.py b/tasks/0021_453_21453047_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_453_21453047_qa_4/environment/pull_bucket.py +++ b/tasks/0021_453_21453047_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_453_21453047_qa_4/task.toml b/tasks/0021_453_21453047_qa_4/task.toml index 084467cf66b74753d8b39d1e115729ee2c1aa3a8..4642f9c42d4773f0269e4fdae442e77187c46266 100644 --- a/tasks/0021_453_21453047_qa_4/task.toml +++ b/tasks/0021_453_21453047_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_470_21470555_qa_4/environment/bootstrap.sh b/tasks/0021_470_21470555_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_470_21470555_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_470_21470555_qa_4/environment/pull_bucket.py b/tasks/0021_470_21470555_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_470_21470555_qa_4/environment/pull_bucket.py +++ b/tasks/0021_470_21470555_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_470_21470555_qa_4/task.toml b/tasks/0021_470_21470555_qa_4/task.toml index 99f19cf59c55c0524e0fd35c3f0057f8fabb2eb1..efd47c8b035103a563b625f455ebea03a98c5b02 100644 --- a/tasks/0021_470_21470555_qa_4/task.toml +++ b/tasks/0021_470_21470555_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_562_21562813_qa_3/environment/bootstrap.sh b/tasks/0021_562_21562813_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_562_21562813_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_562_21562813_qa_3/environment/pull_bucket.py b/tasks/0021_562_21562813_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_562_21562813_qa_3/environment/pull_bucket.py +++ b/tasks/0021_562_21562813_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_562_21562813_qa_3/task.toml b/tasks/0021_562_21562813_qa_3/task.toml index ca4fbb3f92d5f5c5e3307ebd04d03e04af859d06..d56e8f784ec15e75fec1d8c4dbc8bfdc86733c73 100644 --- a/tasks/0021_562_21562813_qa_3/task.toml +++ b/tasks/0021_562_21562813_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_636_21636109_qa_2/environment/bootstrap.sh b/tasks/0021_636_21636109_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_636_21636109_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_636_21636109_qa_2/environment/pull_bucket.py b/tasks/0021_636_21636109_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_636_21636109_qa_2/environment/pull_bucket.py +++ b/tasks/0021_636_21636109_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_636_21636109_qa_2/task.toml b/tasks/0021_636_21636109_qa_2/task.toml index f3261c1ef3ed97cf968da9f1309e7725f7c97327..8bac003da44292828c829213903dd2d1e1529d7b 100644 --- a/tasks/0021_636_21636109_qa_2/task.toml +++ b/tasks/0021_636_21636109_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_636_21636109_qa_3/environment/bootstrap.sh b/tasks/0021_636_21636109_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_636_21636109_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_636_21636109_qa_3/environment/pull_bucket.py b/tasks/0021_636_21636109_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_636_21636109_qa_3/environment/pull_bucket.py +++ b/tasks/0021_636_21636109_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_636_21636109_qa_3/task.toml b/tasks/0021_636_21636109_qa_3/task.toml index 9acb51c513c7ac1b20b522dd6b6557a9f7df001c..f84bc3075efbbe05131effc19401ec7d84bdf43e 100644 --- a/tasks/0021_636_21636109_qa_3/task.toml +++ b/tasks/0021_636_21636109_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_643_21643452_qa_5/environment/bootstrap.sh b/tasks/0021_643_21643452_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_643_21643452_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_643_21643452_qa_5/environment/pull_bucket.py b/tasks/0021_643_21643452_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_643_21643452_qa_5/environment/pull_bucket.py +++ b/tasks/0021_643_21643452_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_643_21643452_qa_5/task.toml b/tasks/0021_643_21643452_qa_5/task.toml index bc2275fadf4a4aa33085d7294bbdfdcc9b090fa6..1fce8a79cd6356ed99ee0a2c55e6bd13091ca0e5 100644 --- a/tasks/0021_643_21643452_qa_5/task.toml +++ b/tasks/0021_643_21643452_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_656_21656365_qa_5/environment/bootstrap.sh b/tasks/0021_656_21656365_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_656_21656365_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_656_21656365_qa_5/environment/pull_bucket.py b/tasks/0021_656_21656365_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_656_21656365_qa_5/environment/pull_bucket.py +++ b/tasks/0021_656_21656365_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_656_21656365_qa_5/task.toml b/tasks/0021_656_21656365_qa_5/task.toml index 188a13750fde1bcff6f75e2cbac65ebd4727fd40..b74a3de1345ba5013bb866359aa4e7c01fb05ad1 100644 --- a/tasks/0021_656_21656365_qa_5/task.toml +++ b/tasks/0021_656_21656365_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_681_21681967_qa_1/environment/bootstrap.sh b/tasks/0021_681_21681967_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_681_21681967_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_681_21681967_qa_1/environment/pull_bucket.py b/tasks/0021_681_21681967_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_681_21681967_qa_1/environment/pull_bucket.py +++ b/tasks/0021_681_21681967_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_681_21681967_qa_1/task.toml b/tasks/0021_681_21681967_qa_1/task.toml index c3a761f9bd1bb103489d620b931d898fd5fea460..7c093c88d67bf3524935bd9c0f10d2123fa53122 100644 --- a/tasks/0021_681_21681967_qa_1/task.toml +++ b/tasks/0021_681_21681967_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_687_21687757_qa_1/environment/bootstrap.sh b/tasks/0021_687_21687757_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_687_21687757_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_687_21687757_qa_1/environment/pull_bucket.py b/tasks/0021_687_21687757_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_687_21687757_qa_1/environment/pull_bucket.py +++ b/tasks/0021_687_21687757_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_687_21687757_qa_1/task.toml b/tasks/0021_687_21687757_qa_1/task.toml index 85f7cf12f58adf77dc68ce8702a93f4bb0d7ca07..756cce054423a7214d632e8c5dae867e235b78cb 100644 --- a/tasks/0021_687_21687757_qa_1/task.toml +++ b/tasks/0021_687_21687757_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_688_21688932_qa_1/environment/bootstrap.sh b/tasks/0021_688_21688932_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_688_21688932_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_688_21688932_qa_1/environment/pull_bucket.py b/tasks/0021_688_21688932_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_688_21688932_qa_1/environment/pull_bucket.py +++ b/tasks/0021_688_21688932_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_688_21688932_qa_1/task.toml b/tasks/0021_688_21688932_qa_1/task.toml index 2c5a5683d9526847a2ca83d14e7b58749c97c8e8..272210fb8fbff8e81f51d806e06801a2fa170d56 100644 --- a/tasks/0021_688_21688932_qa_1/task.toml +++ b/tasks/0021_688_21688932_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_698_21698205_qa_2/environment/bootstrap.sh b/tasks/0021_698_21698205_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_698_21698205_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_698_21698205_qa_2/environment/pull_bucket.py b/tasks/0021_698_21698205_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_698_21698205_qa_2/environment/pull_bucket.py +++ b/tasks/0021_698_21698205_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_698_21698205_qa_2/task.toml b/tasks/0021_698_21698205_qa_2/task.toml index 77557eaae5fd07f91cd8f84cbc2ec1bc3db246b0..0e61d83fea733815546da1dd0955119a02f2a480 100644 --- a/tasks/0021_698_21698205_qa_2/task.toml +++ b/tasks/0021_698_21698205_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_699_21699891_qa_1/environment/bootstrap.sh b/tasks/0021_699_21699891_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_699_21699891_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_699_21699891_qa_1/environment/pull_bucket.py b/tasks/0021_699_21699891_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_699_21699891_qa_1/environment/pull_bucket.py +++ b/tasks/0021_699_21699891_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_699_21699891_qa_1/task.toml b/tasks/0021_699_21699891_qa_1/task.toml index 1c1f9ec1f902a2925a2bb46f847d65ae2589cad8..56b4508c8d8dda37054b4ee1990492df5eccb352 100644 --- a/tasks/0021_699_21699891_qa_1/task.toml +++ b/tasks/0021_699_21699891_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_719_21719622_qa_1/environment/bootstrap.sh b/tasks/0021_719_21719622_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_719_21719622_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_719_21719622_qa_1/environment/pull_bucket.py b/tasks/0021_719_21719622_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_719_21719622_qa_1/environment/pull_bucket.py +++ b/tasks/0021_719_21719622_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_719_21719622_qa_1/task.toml b/tasks/0021_719_21719622_qa_1/task.toml index 1879c58f196a18ec32ac37aeff71b937fbd35b69..2cfc8c0fec6a3d093ca8accd852f74891fa12891 100644 --- a/tasks/0021_719_21719622_qa_1/task.toml +++ b/tasks/0021_719_21719622_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_719_21719622_qa_2/environment/bootstrap.sh b/tasks/0021_719_21719622_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_719_21719622_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_719_21719622_qa_2/environment/pull_bucket.py b/tasks/0021_719_21719622_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_719_21719622_qa_2/environment/pull_bucket.py +++ b/tasks/0021_719_21719622_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_719_21719622_qa_2/task.toml b/tasks/0021_719_21719622_qa_2/task.toml index 289847c23ab376645cef4b5677af8386887c2752..871f6b7ebc5a2633a8f36fdfb8ea9e1585f56b1c 100644 --- a/tasks/0021_719_21719622_qa_2/task.toml +++ b/tasks/0021_719_21719622_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_719_21719622_qa_4/environment/bootstrap.sh b/tasks/0021_719_21719622_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_719_21719622_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_719_21719622_qa_4/environment/pull_bucket.py b/tasks/0021_719_21719622_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_719_21719622_qa_4/environment/pull_bucket.py +++ b/tasks/0021_719_21719622_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_719_21719622_qa_4/task.toml b/tasks/0021_719_21719622_qa_4/task.toml index a0a21737e9c4136d5caa9ce33423a7b2bb4e51a5..18cf5561c67f93fdf4d7487654afc1973ac7905c 100644 --- a/tasks/0021_719_21719622_qa_4/task.toml +++ b/tasks/0021_719_21719622_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_719_21719622_qa_5/environment/bootstrap.sh b/tasks/0021_719_21719622_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_719_21719622_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_719_21719622_qa_5/environment/pull_bucket.py b/tasks/0021_719_21719622_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_719_21719622_qa_5/environment/pull_bucket.py +++ b/tasks/0021_719_21719622_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_719_21719622_qa_5/task.toml b/tasks/0021_719_21719622_qa_5/task.toml index 525034578e6f6d3e5ed41c718c94dee55fbc7fb3..151bb11875853924e9632d9cf8c9d491130aaf32 100644 --- a/tasks/0021_719_21719622_qa_5/task.toml +++ b/tasks/0021_719_21719622_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_751_21751462_qa_3/environment/bootstrap.sh b/tasks/0021_751_21751462_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_751_21751462_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_751_21751462_qa_3/environment/pull_bucket.py b/tasks/0021_751_21751462_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_751_21751462_qa_3/environment/pull_bucket.py +++ b/tasks/0021_751_21751462_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_751_21751462_qa_3/task.toml b/tasks/0021_751_21751462_qa_3/task.toml index c6059af0e72f32bc821c2e5e4e55aad34326682f..3e77739663d905ecbac3b607b78ff0d50d760f4e 100644 --- a/tasks/0021_751_21751462_qa_3/task.toml +++ b/tasks/0021_751_21751462_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_751_21751462_qa_4/environment/bootstrap.sh b/tasks/0021_751_21751462_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_751_21751462_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_751_21751462_qa_4/environment/pull_bucket.py b/tasks/0021_751_21751462_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_751_21751462_qa_4/environment/pull_bucket.py +++ b/tasks/0021_751_21751462_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_751_21751462_qa_4/task.toml b/tasks/0021_751_21751462_qa_4/task.toml index 08e3a161ff28c9ae3033dc9eb0ef958dfcd55e60..ede21a7ee7b4f92e4eac712ee2fbbd2b03757267 100644 --- a/tasks/0021_751_21751462_qa_4/task.toml +++ b/tasks/0021_751_21751462_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_794_21794618_qa_2/environment/bootstrap.sh b/tasks/0021_794_21794618_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_794_21794618_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_794_21794618_qa_2/environment/pull_bucket.py b/tasks/0021_794_21794618_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_794_21794618_qa_2/environment/pull_bucket.py +++ b/tasks/0021_794_21794618_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_794_21794618_qa_2/task.toml b/tasks/0021_794_21794618_qa_2/task.toml index 7540df7affa7e84c740f60f958f55a4cb12c1a9e..9c44d23d7856a281280f3b2726d6a55034096720 100644 --- a/tasks/0021_794_21794618_qa_2/task.toml +++ b/tasks/0021_794_21794618_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_803_21803688_qa_1/environment/bootstrap.sh b/tasks/0021_803_21803688_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_803_21803688_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_803_21803688_qa_1/environment/pull_bucket.py b/tasks/0021_803_21803688_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_803_21803688_qa_1/environment/pull_bucket.py +++ b/tasks/0021_803_21803688_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_803_21803688_qa_1/task.toml b/tasks/0021_803_21803688_qa_1/task.toml index 769c7f6840a4f4039b1364937ae1fa8b6e30c4dd..da5969a681f3ff92c8f8ed25d0826358b898e3a0 100644 --- a/tasks/0021_803_21803688_qa_1/task.toml +++ b/tasks/0021_803_21803688_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_803_21803688_qa_2/environment/bootstrap.sh b/tasks/0021_803_21803688_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_803_21803688_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_803_21803688_qa_2/environment/pull_bucket.py b/tasks/0021_803_21803688_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_803_21803688_qa_2/environment/pull_bucket.py +++ b/tasks/0021_803_21803688_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_803_21803688_qa_2/task.toml b/tasks/0021_803_21803688_qa_2/task.toml index ead5ed0b894866a6697132d95a5f6bce575ab53c..d71d5015001f615cf17dcbf06506d78c3ca9504d 100644 --- a/tasks/0021_803_21803688_qa_2/task.toml +++ b/tasks/0021_803_21803688_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_804_21804957_qa_3/environment/bootstrap.sh b/tasks/0021_804_21804957_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_804_21804957_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_804_21804957_qa_3/environment/pull_bucket.py b/tasks/0021_804_21804957_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_804_21804957_qa_3/environment/pull_bucket.py +++ b/tasks/0021_804_21804957_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_804_21804957_qa_3/task.toml b/tasks/0021_804_21804957_qa_3/task.toml index bd7573b759ff1841ed5e53bdbfe95e94d5602171..b94896432c3a3b139a6d9c4423fb6c7d00d08925 100644 --- a/tasks/0021_804_21804957_qa_3/task.toml +++ b/tasks/0021_804_21804957_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_828_21828791_qa_2/environment/bootstrap.sh b/tasks/0021_828_21828791_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_828_21828791_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_828_21828791_qa_2/environment/pull_bucket.py b/tasks/0021_828_21828791_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_828_21828791_qa_2/environment/pull_bucket.py +++ b/tasks/0021_828_21828791_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_828_21828791_qa_2/task.toml b/tasks/0021_828_21828791_qa_2/task.toml index df3c88787413ee752ae9c6319eb6d8410bbd5934..51f866e53e3c9a54bbd7962a5873274a77bbad9a 100644 --- a/tasks/0021_828_21828791_qa_2/task.toml +++ b/tasks/0021_828_21828791_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_847_21847371_qa_3/environment/bootstrap.sh b/tasks/0021_847_21847371_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_847_21847371_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_847_21847371_qa_3/environment/pull_bucket.py b/tasks/0021_847_21847371_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_847_21847371_qa_3/environment/pull_bucket.py +++ b/tasks/0021_847_21847371_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_847_21847371_qa_3/task.toml b/tasks/0021_847_21847371_qa_3/task.toml index 9047e8acfba1ba0725bf50038d6149989eb43009..e45722dd20d0a947daa3b168de410ac8b14c927e 100644 --- a/tasks/0021_847_21847371_qa_3/task.toml +++ b/tasks/0021_847_21847371_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_868_21868084_qa_1/environment/bootstrap.sh b/tasks/0021_868_21868084_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_868_21868084_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_868_21868084_qa_1/environment/pull_bucket.py b/tasks/0021_868_21868084_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_868_21868084_qa_1/environment/pull_bucket.py +++ b/tasks/0021_868_21868084_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_868_21868084_qa_1/task.toml b/tasks/0021_868_21868084_qa_1/task.toml index 613c834a1d1a9b2cecad4a8cc2c84d2f91bee9af..a7b1351c7d01fc1c4ff5ba2132ed6f518f0e1cc1 100644 --- a/tasks/0021_868_21868084_qa_1/task.toml +++ b/tasks/0021_868_21868084_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_873_21873405_qa_2/environment/bootstrap.sh b/tasks/0021_873_21873405_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_873_21873405_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_873_21873405_qa_2/environment/pull_bucket.py b/tasks/0021_873_21873405_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_873_21873405_qa_2/environment/pull_bucket.py +++ b/tasks/0021_873_21873405_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_873_21873405_qa_2/task.toml b/tasks/0021_873_21873405_qa_2/task.toml index e03510a0fc6ee215f89ad2eecd722f92f22bb182..b14b9f0cb2fcc8383cb3fa4eca36dcff06715df4 100644 --- a/tasks/0021_873_21873405_qa_2/task.toml +++ b/tasks/0021_873_21873405_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_893_21893685_qa_1/environment/bootstrap.sh b/tasks/0021_893_21893685_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_893_21893685_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_893_21893685_qa_1/environment/pull_bucket.py b/tasks/0021_893_21893685_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_893_21893685_qa_1/environment/pull_bucket.py +++ b/tasks/0021_893_21893685_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_893_21893685_qa_1/task.toml b/tasks/0021_893_21893685_qa_1/task.toml index 58ec613cbd8116b9c94cec5f7619401bf4aa1d19..7be0ddc856fbd2fb7a67321abfb234a379eed082 100644 --- a/tasks/0021_893_21893685_qa_1/task.toml +++ b/tasks/0021_893_21893685_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_893_21893685_qa_5/environment/bootstrap.sh b/tasks/0021_893_21893685_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_893_21893685_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_893_21893685_qa_5/environment/pull_bucket.py b/tasks/0021_893_21893685_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_893_21893685_qa_5/environment/pull_bucket.py +++ b/tasks/0021_893_21893685_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_893_21893685_qa_5/task.toml b/tasks/0021_893_21893685_qa_5/task.toml index 5ec2e722c4ea0ac6dc3a3e6e46a21e70342e0782..be25e8904f57c1937d2e0ced6eae87933ea028c1 100644 --- a/tasks/0021_893_21893685_qa_5/task.toml +++ b/tasks/0021_893_21893685_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_901_21901400_qa_3/environment/bootstrap.sh b/tasks/0021_901_21901400_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_901_21901400_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_901_21901400_qa_3/environment/pull_bucket.py b/tasks/0021_901_21901400_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_901_21901400_qa_3/environment/pull_bucket.py +++ b/tasks/0021_901_21901400_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_901_21901400_qa_3/task.toml b/tasks/0021_901_21901400_qa_3/task.toml index c8125cb6f2fe7a42a8105db3b7fb68e289233525..31bb69a88cbe20b5ff4a831d9e188fe61924f4f9 100644 --- a/tasks/0021_901_21901400_qa_3/task.toml +++ b/tasks/0021_901_21901400_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_960_21960570_qa_3/environment/bootstrap.sh b/tasks/0021_960_21960570_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_960_21960570_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_960_21960570_qa_3/environment/pull_bucket.py b/tasks/0021_960_21960570_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_960_21960570_qa_3/environment/pull_bucket.py +++ b/tasks/0021_960_21960570_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_960_21960570_qa_3/task.toml b/tasks/0021_960_21960570_qa_3/task.toml index 95b6a13fb5176c23a81fd225e2c109cd2aaee3cf..84602f25e36e01dee5b4a3e29f5d2d41cf8201e7 100644 --- a/tasks/0021_960_21960570_qa_3/task.toml +++ b/tasks/0021_960_21960570_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0021_960_21960570_qa_4/environment/bootstrap.sh b/tasks/0021_960_21960570_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0021_960_21960570_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0021_960_21960570_qa_4/environment/pull_bucket.py b/tasks/0021_960_21960570_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0021_960_21960570_qa_4/environment/pull_bucket.py +++ b/tasks/0021_960_21960570_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0021_960_21960570_qa_4/task.toml b/tasks/0021_960_21960570_qa_4/task.toml index b788f289e5a57f0504c01e3ddbd778fd3ff4ef3e..e68eb5e0fa76c872ba9ceb961e55f1efe896b08a 100644 --- a/tasks/0021_960_21960570_qa_4/task.toml +++ b/tasks/0021_960_21960570_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_056_22056321_qa_5/environment/bootstrap.sh b/tasks/0022_056_22056321_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_056_22056321_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_056_22056321_qa_5/environment/pull_bucket.py b/tasks/0022_056_22056321_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_056_22056321_qa_5/environment/pull_bucket.py +++ b/tasks/0022_056_22056321_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_056_22056321_qa_5/task.toml b/tasks/0022_056_22056321_qa_5/task.toml index 9423caea79a186d52b349a533760e336e9088670..5c565bf5224c28b69c512230f65bb77564ff1433 100644 --- a/tasks/0022_056_22056321_qa_5/task.toml +++ b/tasks/0022_056_22056321_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_076_22076548_qa_2/environment/bootstrap.sh b/tasks/0022_076_22076548_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_076_22076548_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_076_22076548_qa_2/environment/pull_bucket.py b/tasks/0022_076_22076548_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_076_22076548_qa_2/environment/pull_bucket.py +++ b/tasks/0022_076_22076548_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_076_22076548_qa_2/task.toml b/tasks/0022_076_22076548_qa_2/task.toml index 71fc3813ebad1e9a4eb0b1ea51e7c4d9b3445bb5..15655cc46ed760e268d86f430850a93a186d6eba 100644 --- a/tasks/0022_076_22076548_qa_2/task.toml +++ b/tasks/0022_076_22076548_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_076_22076548_qa_3/environment/bootstrap.sh b/tasks/0022_076_22076548_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_076_22076548_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_076_22076548_qa_3/environment/pull_bucket.py b/tasks/0022_076_22076548_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_076_22076548_qa_3/environment/pull_bucket.py +++ b/tasks/0022_076_22076548_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_076_22076548_qa_3/task.toml b/tasks/0022_076_22076548_qa_3/task.toml index 9000f84fdfa77cd780ffd984c8aa06a3b06c598f..97fffe6ba66c7348b834beb1c3dc0ddfd1db04c4 100644 --- a/tasks/0022_076_22076548_qa_3/task.toml +++ b/tasks/0022_076_22076548_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_122_22122831_qa_2/environment/bootstrap.sh b/tasks/0022_122_22122831_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_122_22122831_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_122_22122831_qa_2/environment/pull_bucket.py b/tasks/0022_122_22122831_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_122_22122831_qa_2/environment/pull_bucket.py +++ b/tasks/0022_122_22122831_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_122_22122831_qa_2/task.toml b/tasks/0022_122_22122831_qa_2/task.toml index 1cef8f5ffa52eb764aa96a818df1329673d74a1c..2e5994ad085956e892b1d12de08726ed20a3bc2a 100644 --- a/tasks/0022_122_22122831_qa_2/task.toml +++ b/tasks/0022_122_22122831_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_169_22169428_qa_5/environment/bootstrap.sh b/tasks/0022_169_22169428_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_169_22169428_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_169_22169428_qa_5/environment/pull_bucket.py b/tasks/0022_169_22169428_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_169_22169428_qa_5/environment/pull_bucket.py +++ b/tasks/0022_169_22169428_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_169_22169428_qa_5/task.toml b/tasks/0022_169_22169428_qa_5/task.toml index 94df17ce79f3365906abb6e277130189f4f3ddc9..83465603ff68b223f8071380f9a490a46f5ce6de 100644 --- a/tasks/0022_169_22169428_qa_5/task.toml +++ b/tasks/0022_169_22169428_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_193_22193578_qa_1/environment/bootstrap.sh b/tasks/0022_193_22193578_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_193_22193578_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_193_22193578_qa_1/environment/pull_bucket.py b/tasks/0022_193_22193578_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_193_22193578_qa_1/environment/pull_bucket.py +++ b/tasks/0022_193_22193578_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_193_22193578_qa_1/task.toml b/tasks/0022_193_22193578_qa_1/task.toml index 591e3c2dcfd08500cb740036faa3aa197a897ce6..3d61b8d631a50c8b178521d1298f2ef6983a471a 100644 --- a/tasks/0022_193_22193578_qa_1/task.toml +++ b/tasks/0022_193_22193578_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_193_22193578_qa_5/environment/bootstrap.sh b/tasks/0022_193_22193578_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_193_22193578_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_193_22193578_qa_5/environment/pull_bucket.py b/tasks/0022_193_22193578_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_193_22193578_qa_5/environment/pull_bucket.py +++ b/tasks/0022_193_22193578_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_193_22193578_qa_5/task.toml b/tasks/0022_193_22193578_qa_5/task.toml index 800b3d740bacdcd18925f4b70ee243ece121e1d9..cdd249bdd3a1a9bed806471233c18bb8c4b5a416 100644 --- a/tasks/0022_193_22193578_qa_5/task.toml +++ b/tasks/0022_193_22193578_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_210_22210529_qa_2/environment/bootstrap.sh b/tasks/0022_210_22210529_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_210_22210529_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_210_22210529_qa_2/environment/pull_bucket.py b/tasks/0022_210_22210529_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_210_22210529_qa_2/environment/pull_bucket.py +++ b/tasks/0022_210_22210529_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_210_22210529_qa_2/task.toml b/tasks/0022_210_22210529_qa_2/task.toml index 00eaf56581e1bfa670ee5672f857b0cca36988df..76013dab67a3d27ff25a918d8528d30226b3dfa6 100644 --- a/tasks/0022_210_22210529_qa_2/task.toml +++ b/tasks/0022_210_22210529_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_258_22258436_qa_1/environment/bootstrap.sh b/tasks/0022_258_22258436_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_258_22258436_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_258_22258436_qa_1/environment/pull_bucket.py b/tasks/0022_258_22258436_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_258_22258436_qa_1/environment/pull_bucket.py +++ b/tasks/0022_258_22258436_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_258_22258436_qa_1/task.toml b/tasks/0022_258_22258436_qa_1/task.toml index 31b38a7d8e19ae97e98c6ba1fbea4589e82017ce..d3fc0c7f16f13fbb4f0f5373d86214e6acbfe145 100644 --- a/tasks/0022_258_22258436_qa_1/task.toml +++ b/tasks/0022_258_22258436_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_258_22258436_qa_2/environment/bootstrap.sh b/tasks/0022_258_22258436_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_258_22258436_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_258_22258436_qa_2/environment/pull_bucket.py b/tasks/0022_258_22258436_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_258_22258436_qa_2/environment/pull_bucket.py +++ b/tasks/0022_258_22258436_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_258_22258436_qa_2/task.toml b/tasks/0022_258_22258436_qa_2/task.toml index 85289fa8e12b202ec9cc363168a9d7d9e3132a97..9d6ba1d363868d0125d8c959df082cb9c19650b7 100644 --- a/tasks/0022_258_22258436_qa_2/task.toml +++ b/tasks/0022_258_22258436_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_258_22258436_qa_3/environment/bootstrap.sh b/tasks/0022_258_22258436_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_258_22258436_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_258_22258436_qa_3/environment/pull_bucket.py b/tasks/0022_258_22258436_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_258_22258436_qa_3/environment/pull_bucket.py +++ b/tasks/0022_258_22258436_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_258_22258436_qa_3/task.toml b/tasks/0022_258_22258436_qa_3/task.toml index 15003ed3c380259e17532dd616225f0ca8e98f25..23cbf8c914da4b42f735c40b54d25ff4833c65aa 100644 --- a/tasks/0022_258_22258436_qa_3/task.toml +++ b/tasks/0022_258_22258436_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_258_22258436_qa_4/environment/bootstrap.sh b/tasks/0022_258_22258436_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_258_22258436_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_258_22258436_qa_4/environment/pull_bucket.py b/tasks/0022_258_22258436_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_258_22258436_qa_4/environment/pull_bucket.py +++ b/tasks/0022_258_22258436_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_258_22258436_qa_4/task.toml b/tasks/0022_258_22258436_qa_4/task.toml index 75f030a2dcb212534436d7bf88fa2b91d5055d31..ac8dfe3184f4b32830f45de3ec4b5b2cf9c8d9ca 100644 --- a/tasks/0022_258_22258436_qa_4/task.toml +++ b/tasks/0022_258_22258436_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_272_22272220_qa_3/environment/bootstrap.sh b/tasks/0022_272_22272220_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_272_22272220_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_272_22272220_qa_3/environment/pull_bucket.py b/tasks/0022_272_22272220_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_272_22272220_qa_3/environment/pull_bucket.py +++ b/tasks/0022_272_22272220_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_272_22272220_qa_3/task.toml b/tasks/0022_272_22272220_qa_3/task.toml index 80455f2b58090e136cdfaf284404687960ae124f..be8a9db11a64dc3d49950f3d0b03539ddab0a4ad 100644 --- a/tasks/0022_272_22272220_qa_3/task.toml +++ b/tasks/0022_272_22272220_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_383_22383259_qa_5/environment/bootstrap.sh b/tasks/0022_383_22383259_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_383_22383259_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_383_22383259_qa_5/environment/pull_bucket.py b/tasks/0022_383_22383259_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_383_22383259_qa_5/environment/pull_bucket.py +++ b/tasks/0022_383_22383259_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_383_22383259_qa_5/task.toml b/tasks/0022_383_22383259_qa_5/task.toml index a70dff040c31080f248eb2fc9131b1fdf148445c..b1b54721a17ff0eeb65ebc0c3c3b91bd62b30fc5 100644 --- a/tasks/0022_383_22383259_qa_5/task.toml +++ b/tasks/0022_383_22383259_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_423_22423880_qa_4/environment/bootstrap.sh b/tasks/0022_423_22423880_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_423_22423880_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_423_22423880_qa_4/environment/pull_bucket.py b/tasks/0022_423_22423880_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_423_22423880_qa_4/environment/pull_bucket.py +++ b/tasks/0022_423_22423880_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_423_22423880_qa_4/task.toml b/tasks/0022_423_22423880_qa_4/task.toml index 4c08757d74b221cc18cd8c79539f0d1364a9d00a..3c7650f61288d784d28d3dd1f9010a491252133f 100644 --- a/tasks/0022_423_22423880_qa_4/task.toml +++ b/tasks/0022_423_22423880_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_457_22457642_qa_2/environment/bootstrap.sh b/tasks/0022_457_22457642_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_457_22457642_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_457_22457642_qa_2/environment/pull_bucket.py b/tasks/0022_457_22457642_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_457_22457642_qa_2/environment/pull_bucket.py +++ b/tasks/0022_457_22457642_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_457_22457642_qa_2/task.toml b/tasks/0022_457_22457642_qa_2/task.toml index 9955544db2515583cbf9de2cd180124ee9ab4402..43d6a46af987da1b2509b2e5f8eafa0ba8f7e954 100644 --- a/tasks/0022_457_22457642_qa_2/task.toml +++ b/tasks/0022_457_22457642_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_457_22457642_qa_5/environment/bootstrap.sh b/tasks/0022_457_22457642_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_457_22457642_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_457_22457642_qa_5/environment/pull_bucket.py b/tasks/0022_457_22457642_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_457_22457642_qa_5/environment/pull_bucket.py +++ b/tasks/0022_457_22457642_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_457_22457642_qa_5/task.toml b/tasks/0022_457_22457642_qa_5/task.toml index c213f809c3fa8e8e0033099853ec0a681e562bc0..f13e6c38d692f52c2bf3d140d8f1ed2c65ae1f3f 100644 --- a/tasks/0022_457_22457642_qa_5/task.toml +++ b/tasks/0022_457_22457642_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_482_22482992_qa_2/environment/bootstrap.sh b/tasks/0022_482_22482992_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_482_22482992_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_482_22482992_qa_2/environment/pull_bucket.py b/tasks/0022_482_22482992_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_482_22482992_qa_2/environment/pull_bucket.py +++ b/tasks/0022_482_22482992_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_482_22482992_qa_2/task.toml b/tasks/0022_482_22482992_qa_2/task.toml index fd57406662b9d82334fa7f7033b964c73c9ff41d..a327275636b39f1baa5eee7242a6957ab07b6e52 100644 --- a/tasks/0022_482_22482992_qa_2/task.toml +++ b/tasks/0022_482_22482992_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_555_22555686_qa_2/environment/bootstrap.sh b/tasks/0022_555_22555686_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_555_22555686_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_555_22555686_qa_2/environment/pull_bucket.py b/tasks/0022_555_22555686_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_555_22555686_qa_2/environment/pull_bucket.py +++ b/tasks/0022_555_22555686_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_555_22555686_qa_2/task.toml b/tasks/0022_555_22555686_qa_2/task.toml index 3ea6b248d0cd458fdd75b2df2b56e7d7c74631ed..0e347f718ca02ef5c13fb2ace681944c664ee7bb 100644 --- a/tasks/0022_555_22555686_qa_2/task.toml +++ b/tasks/0022_555_22555686_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_609_22609620_qa_3/environment/bootstrap.sh b/tasks/0022_609_22609620_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_609_22609620_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_609_22609620_qa_3/environment/pull_bucket.py b/tasks/0022_609_22609620_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_609_22609620_qa_3/environment/pull_bucket.py +++ b/tasks/0022_609_22609620_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_609_22609620_qa_3/task.toml b/tasks/0022_609_22609620_qa_3/task.toml index 566d4eead227919a46441d7ea9feabb1d17b4e82..3a11773a89eb5ebdb2f3225666bc0c682b7978ac 100644 --- a/tasks/0022_609_22609620_qa_3/task.toml +++ b/tasks/0022_609_22609620_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_668_22668393_qa_3/environment/bootstrap.sh b/tasks/0022_668_22668393_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_668_22668393_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_668_22668393_qa_3/environment/pull_bucket.py b/tasks/0022_668_22668393_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_668_22668393_qa_3/environment/pull_bucket.py +++ b/tasks/0022_668_22668393_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_668_22668393_qa_3/task.toml b/tasks/0022_668_22668393_qa_3/task.toml index f78062b1bd07c8a3a5562875cba95ff27c697057..51089be5a947e290c33205d49c4c8b37d4cd437a 100644 --- a/tasks/0022_668_22668393_qa_3/task.toml +++ b/tasks/0022_668_22668393_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_704_22704559_qa_4/environment/bootstrap.sh b/tasks/0022_704_22704559_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_704_22704559_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_704_22704559_qa_4/environment/pull_bucket.py b/tasks/0022_704_22704559_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_704_22704559_qa_4/environment/pull_bucket.py +++ b/tasks/0022_704_22704559_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_704_22704559_qa_4/task.toml b/tasks/0022_704_22704559_qa_4/task.toml index bb6ae093feda9df236791872d96cf70be3a9b7fd..cc582f16afdd30eead65b423419b44affb835b40 100644 --- a/tasks/0022_704_22704559_qa_4/task.toml +++ b/tasks/0022_704_22704559_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_712_22712745_qa_5/environment/bootstrap.sh b/tasks/0022_712_22712745_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_712_22712745_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_712_22712745_qa_5/environment/pull_bucket.py b/tasks/0022_712_22712745_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_712_22712745_qa_5/environment/pull_bucket.py +++ b/tasks/0022_712_22712745_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_712_22712745_qa_5/task.toml b/tasks/0022_712_22712745_qa_5/task.toml index 9168c31f722e218c96e908796c2b18ec4c9f0dd9..73e90e1f42e981727241195b1d681b38d26e021f 100644 --- a/tasks/0022_712_22712745_qa_5/task.toml +++ b/tasks/0022_712_22712745_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_788_22788694_qa_2/environment/bootstrap.sh b/tasks/0022_788_22788694_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_788_22788694_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_788_22788694_qa_2/environment/pull_bucket.py b/tasks/0022_788_22788694_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_788_22788694_qa_2/environment/pull_bucket.py +++ b/tasks/0022_788_22788694_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_788_22788694_qa_2/task.toml b/tasks/0022_788_22788694_qa_2/task.toml index e38d67983ce3a4b35305ae6cabc3b90527a62549..42b0a81a797ca2eb69d2381f922f09bd8e0d6931 100644 --- a/tasks/0022_788_22788694_qa_2/task.toml +++ b/tasks/0022_788_22788694_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_790_22790047_qa_2/environment/bootstrap.sh b/tasks/0022_790_22790047_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_790_22790047_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_790_22790047_qa_2/environment/pull_bucket.py b/tasks/0022_790_22790047_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_790_22790047_qa_2/environment/pull_bucket.py +++ b/tasks/0022_790_22790047_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_790_22790047_qa_2/task.toml b/tasks/0022_790_22790047_qa_2/task.toml index 6bc8c69c44abef3708fb2189509e9175b31906f3..e930d8182430a58ad90ff2ad611d4a4eacea2c84 100644 --- a/tasks/0022_790_22790047_qa_2/task.toml +++ b/tasks/0022_790_22790047_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_860_22860039_qa_1/environment/bootstrap.sh b/tasks/0022_860_22860039_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_860_22860039_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_860_22860039_qa_1/environment/pull_bucket.py b/tasks/0022_860_22860039_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_860_22860039_qa_1/environment/pull_bucket.py +++ b/tasks/0022_860_22860039_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_860_22860039_qa_1/task.toml b/tasks/0022_860_22860039_qa_1/task.toml index e701aa57647f8bb04bcd74d130e24d506148252e..47de7fda8d155e277661fe6376027c02f8e3aec2 100644 --- a/tasks/0022_860_22860039_qa_1/task.toml +++ b/tasks/0022_860_22860039_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_886_22886038_qa_4/environment/bootstrap.sh b/tasks/0022_886_22886038_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_886_22886038_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_886_22886038_qa_4/environment/pull_bucket.py b/tasks/0022_886_22886038_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_886_22886038_qa_4/environment/pull_bucket.py +++ b/tasks/0022_886_22886038_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_886_22886038_qa_4/task.toml b/tasks/0022_886_22886038_qa_4/task.toml index 44168354e9cab71d2789c1e422ca8e6ad41e4ca7..f068439fb510ebe03e525f6cbdf61ab55689809a 100644 --- a/tasks/0022_886_22886038_qa_4/task.toml +++ b/tasks/0022_886_22886038_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_916_22916338_qa_1/environment/bootstrap.sh b/tasks/0022_916_22916338_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_916_22916338_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_916_22916338_qa_1/environment/pull_bucket.py b/tasks/0022_916_22916338_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_916_22916338_qa_1/environment/pull_bucket.py +++ b/tasks/0022_916_22916338_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_916_22916338_qa_1/task.toml b/tasks/0022_916_22916338_qa_1/task.toml index d0a665e34e7cd9e59462edc08c9bcc62424d66c3..5261882b2d12d6be6bc8593039887330e20f24e6 100644 --- a/tasks/0022_916_22916338_qa_1/task.toml +++ b/tasks/0022_916_22916338_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_916_22916338_qa_5/environment/bootstrap.sh b/tasks/0022_916_22916338_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_916_22916338_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_916_22916338_qa_5/environment/pull_bucket.py b/tasks/0022_916_22916338_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_916_22916338_qa_5/environment/pull_bucket.py +++ b/tasks/0022_916_22916338_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_916_22916338_qa_5/task.toml b/tasks/0022_916_22916338_qa_5/task.toml index 2be1375c24b0b9a57e61dc90a29bac23c6f4ac24..2a6cb78af8a22dbb93814b01dc45a11e0ffe111b 100644 --- a/tasks/0022_916_22916338_qa_5/task.toml +++ b/tasks/0022_916_22916338_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_928_22928479_qa_2/environment/bootstrap.sh b/tasks/0022_928_22928479_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_928_22928479_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_928_22928479_qa_2/environment/pull_bucket.py b/tasks/0022_928_22928479_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_928_22928479_qa_2/environment/pull_bucket.py +++ b/tasks/0022_928_22928479_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_928_22928479_qa_2/task.toml b/tasks/0022_928_22928479_qa_2/task.toml index 91d3ef85d23e62623760231a10c257b692a95bc7..cfb5505e52b2c7024f1b2104d0e2c5381dc64d90 100644 --- a/tasks/0022_928_22928479_qa_2/task.toml +++ b/tasks/0022_928_22928479_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0022_941_22941609_qa_2/environment/bootstrap.sh b/tasks/0022_941_22941609_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0022_941_22941609_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0022_941_22941609_qa_2/environment/pull_bucket.py b/tasks/0022_941_22941609_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0022_941_22941609_qa_2/environment/pull_bucket.py +++ b/tasks/0022_941_22941609_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0022_941_22941609_qa_2/task.toml b/tasks/0022_941_22941609_qa_2/task.toml index a4c378277e1ca8610e38d72924feb9fadc112068..5d197c88c74c3dfa513ff5de40b183debc784af7 100644 --- a/tasks/0022_941_22941609_qa_2/task.toml +++ b/tasks/0022_941_22941609_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_186_23186300_qa_1/environment/bootstrap.sh b/tasks/0023_186_23186300_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_186_23186300_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_186_23186300_qa_1/environment/pull_bucket.py b/tasks/0023_186_23186300_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_186_23186300_qa_1/environment/pull_bucket.py +++ b/tasks/0023_186_23186300_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_186_23186300_qa_1/task.toml b/tasks/0023_186_23186300_qa_1/task.toml index 128e13f0e03a7600b578ae0c3a95615154f9f675..e9710b5d19535de8e4b8ff8f8223afaf77255c56 100644 --- a/tasks/0023_186_23186300_qa_1/task.toml +++ b/tasks/0023_186_23186300_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_251_23251738_qa_1/environment/bootstrap.sh b/tasks/0023_251_23251738_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_251_23251738_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_251_23251738_qa_1/environment/pull_bucket.py b/tasks/0023_251_23251738_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_251_23251738_qa_1/environment/pull_bucket.py +++ b/tasks/0023_251_23251738_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_251_23251738_qa_1/task.toml b/tasks/0023_251_23251738_qa_1/task.toml index aac002beea1e643d45dbc55518df87021836203a..09f918db4fee2df53d61564df5880e6676e59dcc 100644 --- a/tasks/0023_251_23251738_qa_1/task.toml +++ b/tasks/0023_251_23251738_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_251_23251738_qa_3/environment/bootstrap.sh b/tasks/0023_251_23251738_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_251_23251738_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_251_23251738_qa_3/environment/pull_bucket.py b/tasks/0023_251_23251738_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_251_23251738_qa_3/environment/pull_bucket.py +++ b/tasks/0023_251_23251738_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_251_23251738_qa_3/task.toml b/tasks/0023_251_23251738_qa_3/task.toml index 76e8265aca4ee8311696f9fce5697d40e85fea42..e6cb2668cc41250aae506ebe29b67ad785531b16 100644 --- a/tasks/0023_251_23251738_qa_3/task.toml +++ b/tasks/0023_251_23251738_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_425_23425201_qa_4/environment/bootstrap.sh b/tasks/0023_425_23425201_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_425_23425201_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_425_23425201_qa_4/environment/pull_bucket.py b/tasks/0023_425_23425201_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_425_23425201_qa_4/environment/pull_bucket.py +++ b/tasks/0023_425_23425201_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_425_23425201_qa_4/task.toml b/tasks/0023_425_23425201_qa_4/task.toml index fca50838e693d3b8eec7c7dc0ac12d6346e90528..359505cc3995eab22674db628da9d00502b5dd92 100644 --- a/tasks/0023_425_23425201_qa_4/task.toml +++ b/tasks/0023_425_23425201_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_426_23426961_qa_3/environment/bootstrap.sh b/tasks/0023_426_23426961_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_426_23426961_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_426_23426961_qa_3/environment/pull_bucket.py b/tasks/0023_426_23426961_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_426_23426961_qa_3/environment/pull_bucket.py +++ b/tasks/0023_426_23426961_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_426_23426961_qa_3/task.toml b/tasks/0023_426_23426961_qa_3/task.toml index 5d12edb6a06be490d99b0d5dce3d34d5a68e126b..44c0d3195e76c1af853d431c643edcae8385b137 100644 --- a/tasks/0023_426_23426961_qa_3/task.toml +++ b/tasks/0023_426_23426961_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_468_23468316_qa_2/environment/bootstrap.sh b/tasks/0023_468_23468316_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_468_23468316_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_468_23468316_qa_2/environment/pull_bucket.py b/tasks/0023_468_23468316_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_468_23468316_qa_2/environment/pull_bucket.py +++ b/tasks/0023_468_23468316_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_468_23468316_qa_2/task.toml b/tasks/0023_468_23468316_qa_2/task.toml index c0ac9fb874f4da1c8b15c58ff1b843813d19255e..2acc862b611c01a5a77a3e572b0dba0443d6b290 100644 --- a/tasks/0023_468_23468316_qa_2/task.toml +++ b/tasks/0023_468_23468316_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_468_23468316_qa_3/environment/bootstrap.sh b/tasks/0023_468_23468316_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_468_23468316_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_468_23468316_qa_3/environment/pull_bucket.py b/tasks/0023_468_23468316_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_468_23468316_qa_3/environment/pull_bucket.py +++ b/tasks/0023_468_23468316_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_468_23468316_qa_3/task.toml b/tasks/0023_468_23468316_qa_3/task.toml index bac24e616cd83ae241d2b8cd404db7decc3395e5..88bc26326d6747bcb04f1ffed290f883c3952572 100644 --- a/tasks/0023_468_23468316_qa_3/task.toml +++ b/tasks/0023_468_23468316_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_531_23531492_qa_4/environment/bootstrap.sh b/tasks/0023_531_23531492_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_531_23531492_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_531_23531492_qa_4/environment/pull_bucket.py b/tasks/0023_531_23531492_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_531_23531492_qa_4/environment/pull_bucket.py +++ b/tasks/0023_531_23531492_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_531_23531492_qa_4/task.toml b/tasks/0023_531_23531492_qa_4/task.toml index 0cb4eeba11982f475b9ea83d4e327035c6a5e73e..1fc430abcf8839afeb7b41d9d5dc9aa9da1ea4ed 100644 --- a/tasks/0023_531_23531492_qa_4/task.toml +++ b/tasks/0023_531_23531492_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_531_23531492_qa_5/environment/bootstrap.sh b/tasks/0023_531_23531492_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_531_23531492_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_531_23531492_qa_5/environment/pull_bucket.py b/tasks/0023_531_23531492_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_531_23531492_qa_5/environment/pull_bucket.py +++ b/tasks/0023_531_23531492_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_531_23531492_qa_5/task.toml b/tasks/0023_531_23531492_qa_5/task.toml index d795e68f4fe581c3fd7c943824774fdd7daa4bfd..97e48a460bf3c94013c2c01bbdaca7a2176b44a7 100644 --- a/tasks/0023_531_23531492_qa_5/task.toml +++ b/tasks/0023_531_23531492_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_580_23580177_qa_2/environment/bootstrap.sh b/tasks/0023_580_23580177_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_580_23580177_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_580_23580177_qa_2/environment/pull_bucket.py b/tasks/0023_580_23580177_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_580_23580177_qa_2/environment/pull_bucket.py +++ b/tasks/0023_580_23580177_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_580_23580177_qa_2/task.toml b/tasks/0023_580_23580177_qa_2/task.toml index c4a1ee8f56497541c50e281515edea77c57388fc..8cbf3bfffaf80c2339595d2a02967ed3da36f387 100644 --- a/tasks/0023_580_23580177_qa_2/task.toml +++ b/tasks/0023_580_23580177_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_583_23583710_qa_4/environment/bootstrap.sh b/tasks/0023_583_23583710_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_583_23583710_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_583_23583710_qa_4/environment/pull_bucket.py b/tasks/0023_583_23583710_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_583_23583710_qa_4/environment/pull_bucket.py +++ b/tasks/0023_583_23583710_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_583_23583710_qa_4/task.toml b/tasks/0023_583_23583710_qa_4/task.toml index 4dde654aff827a05c1247c5acd76684280cfc2ba..291af418e6037774ebb6e220029959351174c7a4 100644 --- a/tasks/0023_583_23583710_qa_4/task.toml +++ b/tasks/0023_583_23583710_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_598_23598239_qa_1/environment/bootstrap.sh b/tasks/0023_598_23598239_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_598_23598239_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_598_23598239_qa_1/environment/pull_bucket.py b/tasks/0023_598_23598239_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_598_23598239_qa_1/environment/pull_bucket.py +++ b/tasks/0023_598_23598239_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_598_23598239_qa_1/task.toml b/tasks/0023_598_23598239_qa_1/task.toml index 3e6a8fd540e0790d32832d5937a53dc67b558dbf..9b37aee748e9163ee933d723cdc58470c77bcc88 100644 --- a/tasks/0023_598_23598239_qa_1/task.toml +++ b/tasks/0023_598_23598239_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_598_23598239_qa_4/environment/bootstrap.sh b/tasks/0023_598_23598239_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_598_23598239_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_598_23598239_qa_4/environment/pull_bucket.py b/tasks/0023_598_23598239_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_598_23598239_qa_4/environment/pull_bucket.py +++ b/tasks/0023_598_23598239_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_598_23598239_qa_4/task.toml b/tasks/0023_598_23598239_qa_4/task.toml index 2274db657804f0698745140b0313699b1ab368ec..de8ba6d5fbdd19e59000b135244246ab49d858c1 100644 --- a/tasks/0023_598_23598239_qa_4/task.toml +++ b/tasks/0023_598_23598239_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_626_23626093_qa_1/environment/bootstrap.sh b/tasks/0023_626_23626093_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_626_23626093_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_626_23626093_qa_1/environment/pull_bucket.py b/tasks/0023_626_23626093_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_626_23626093_qa_1/environment/pull_bucket.py +++ b/tasks/0023_626_23626093_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_626_23626093_qa_1/task.toml b/tasks/0023_626_23626093_qa_1/task.toml index c10986d5e1cfea3d3bdaf2315f72c4043df485f7..06b500fca4454e45b222f8713a1f11753e1de2bf 100644 --- a/tasks/0023_626_23626093_qa_1/task.toml +++ b/tasks/0023_626_23626093_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_626_23626093_qa_3/environment/bootstrap.sh b/tasks/0023_626_23626093_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_626_23626093_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_626_23626093_qa_3/environment/pull_bucket.py b/tasks/0023_626_23626093_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_626_23626093_qa_3/environment/pull_bucket.py +++ b/tasks/0023_626_23626093_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_626_23626093_qa_3/task.toml b/tasks/0023_626_23626093_qa_3/task.toml index 228afb8acba1c7f3e34fd4059b26a11f75793559..683436f343ef9d6fe1cb5dea2b6e4af4fb57db13 100644 --- a/tasks/0023_626_23626093_qa_3/task.toml +++ b/tasks/0023_626_23626093_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_670_23670397_qa_1/environment/bootstrap.sh b/tasks/0023_670_23670397_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_670_23670397_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_670_23670397_qa_1/environment/pull_bucket.py b/tasks/0023_670_23670397_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_670_23670397_qa_1/environment/pull_bucket.py +++ b/tasks/0023_670_23670397_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_670_23670397_qa_1/task.toml b/tasks/0023_670_23670397_qa_1/task.toml index 0735af6b76bcb7bc0839d8a1b192ac5f7c9c8cef..c0d34bb87e890568d0bc4101ef72e4c675decef8 100644 --- a/tasks/0023_670_23670397_qa_1/task.toml +++ b/tasks/0023_670_23670397_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_684_23684693_qa_1/environment/bootstrap.sh b/tasks/0023_684_23684693_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_684_23684693_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_684_23684693_qa_1/environment/pull_bucket.py b/tasks/0023_684_23684693_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_684_23684693_qa_1/environment/pull_bucket.py +++ b/tasks/0023_684_23684693_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_684_23684693_qa_1/task.toml b/tasks/0023_684_23684693_qa_1/task.toml index 13bb1e2af9a000ca83afc56af95e3bee0b7167e7..4c9cbb96668b66f384c6ef69b855d8d2c5978d46 100644 --- a/tasks/0023_684_23684693_qa_1/task.toml +++ b/tasks/0023_684_23684693_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_715_23715177_qa_1/environment/bootstrap.sh b/tasks/0023_715_23715177_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_715_23715177_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_715_23715177_qa_1/environment/pull_bucket.py b/tasks/0023_715_23715177_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_715_23715177_qa_1/environment/pull_bucket.py +++ b/tasks/0023_715_23715177_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_715_23715177_qa_1/task.toml b/tasks/0023_715_23715177_qa_1/task.toml index edf6a7b811a8601b6d27dfcab703188c31e23d5d..ce0536df0187df90a2af69bb254857984e318faf 100644 --- a/tasks/0023_715_23715177_qa_1/task.toml +++ b/tasks/0023_715_23715177_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_715_23715177_qa_2/environment/bootstrap.sh b/tasks/0023_715_23715177_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_715_23715177_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_715_23715177_qa_2/environment/pull_bucket.py b/tasks/0023_715_23715177_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_715_23715177_qa_2/environment/pull_bucket.py +++ b/tasks/0023_715_23715177_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_715_23715177_qa_2/task.toml b/tasks/0023_715_23715177_qa_2/task.toml index 34171682bf83c000f0528f5b433e9496ae056adb..be64978ae030edc8507fe90ef3042193514a4a42 100644 --- a/tasks/0023_715_23715177_qa_2/task.toml +++ b/tasks/0023_715_23715177_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_721_23721314_qa_1/environment/bootstrap.sh b/tasks/0023_721_23721314_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_721_23721314_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_721_23721314_qa_1/environment/pull_bucket.py b/tasks/0023_721_23721314_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_721_23721314_qa_1/environment/pull_bucket.py +++ b/tasks/0023_721_23721314_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_721_23721314_qa_1/task.toml b/tasks/0023_721_23721314_qa_1/task.toml index 382f0583c441d3218872e0d4fbe3776f9672f24c..7b116bba75adf70a7e4c75dc81ba9cdd9b3b6b55 100644 --- a/tasks/0023_721_23721314_qa_1/task.toml +++ b/tasks/0023_721_23721314_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_721_23721684_qa_4/environment/bootstrap.sh b/tasks/0023_721_23721684_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_721_23721684_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_721_23721684_qa_4/environment/pull_bucket.py b/tasks/0023_721_23721684_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_721_23721684_qa_4/environment/pull_bucket.py +++ b/tasks/0023_721_23721684_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_721_23721684_qa_4/task.toml b/tasks/0023_721_23721684_qa_4/task.toml index 580363f36da4524a90e7fc460a7da14259ca1c9a..5d4f35af7c2718119f771d51358babedb6a753d1 100644 --- a/tasks/0023_721_23721684_qa_4/task.toml +++ b/tasks/0023_721_23721684_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_721_23721684_qa_5/environment/bootstrap.sh b/tasks/0023_721_23721684_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_721_23721684_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_721_23721684_qa_5/environment/pull_bucket.py b/tasks/0023_721_23721684_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_721_23721684_qa_5/environment/pull_bucket.py +++ b/tasks/0023_721_23721684_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_721_23721684_qa_5/task.toml b/tasks/0023_721_23721684_qa_5/task.toml index b76b9a4656d587e3b98a8643cdb9332259e819ff..c82120334d47969647025a9306b457184b4d28c3 100644 --- a/tasks/0023_721_23721684_qa_5/task.toml +++ b/tasks/0023_721_23721684_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_757_23757075_qa_3/environment/bootstrap.sh b/tasks/0023_757_23757075_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_757_23757075_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_757_23757075_qa_3/environment/pull_bucket.py b/tasks/0023_757_23757075_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_757_23757075_qa_3/environment/pull_bucket.py +++ b/tasks/0023_757_23757075_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_757_23757075_qa_3/task.toml b/tasks/0023_757_23757075_qa_3/task.toml index ce798a3552ae335a7adae9dca2738fbc3c5b79cd..28a72012af6a8ded9776e9faf2b037a220535b0c 100644 --- a/tasks/0023_757_23757075_qa_3/task.toml +++ b/tasks/0023_757_23757075_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_757_23757075_qa_4/environment/bootstrap.sh b/tasks/0023_757_23757075_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_757_23757075_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_757_23757075_qa_4/environment/pull_bucket.py b/tasks/0023_757_23757075_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_757_23757075_qa_4/environment/pull_bucket.py +++ b/tasks/0023_757_23757075_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_757_23757075_qa_4/task.toml b/tasks/0023_757_23757075_qa_4/task.toml index be0da1fcd6a7a36cdc224e2a4902fcf6c23bd3cc..cb034c77abf7161e67bd01ebf32175ef28da8799 100644 --- a/tasks/0023_757_23757075_qa_4/task.toml +++ b/tasks/0023_757_23757075_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_772_23772737_qa_1/environment/bootstrap.sh b/tasks/0023_772_23772737_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_772_23772737_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_772_23772737_qa_1/environment/pull_bucket.py b/tasks/0023_772_23772737_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_772_23772737_qa_1/environment/pull_bucket.py +++ b/tasks/0023_772_23772737_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_772_23772737_qa_1/task.toml b/tasks/0023_772_23772737_qa_1/task.toml index cc7b5cda9f8f07b596e5e463b036a86599679f49..00cf79a1fe65699f5874d25a3266c308a8c20541 100644 --- a/tasks/0023_772_23772737_qa_1/task.toml +++ b/tasks/0023_772_23772737_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_774_23774958_qa_1/environment/bootstrap.sh b/tasks/0023_774_23774958_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_774_23774958_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_774_23774958_qa_1/environment/pull_bucket.py b/tasks/0023_774_23774958_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_774_23774958_qa_1/environment/pull_bucket.py +++ b/tasks/0023_774_23774958_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_774_23774958_qa_1/task.toml b/tasks/0023_774_23774958_qa_1/task.toml index a5aa308afcae1e8f27e56e3f9a736ab65b6248a1..6d566d6aae5ddd4ee7225d23f3b13879a6d2b52f 100644 --- a/tasks/0023_774_23774958_qa_1/task.toml +++ b/tasks/0023_774_23774958_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_813_23813502_qa_1/environment/bootstrap.sh b/tasks/0023_813_23813502_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_813_23813502_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_813_23813502_qa_1/environment/pull_bucket.py b/tasks/0023_813_23813502_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_813_23813502_qa_1/environment/pull_bucket.py +++ b/tasks/0023_813_23813502_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_813_23813502_qa_1/task.toml b/tasks/0023_813_23813502_qa_1/task.toml index 30368ab710141a916ebd5c483f152758dae4519a..7a8060e574412d014b2a1031c44c083fe3750b33 100644 --- a/tasks/0023_813_23813502_qa_1/task.toml +++ b/tasks/0023_813_23813502_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_813_23813502_qa_4/environment/bootstrap.sh b/tasks/0023_813_23813502_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_813_23813502_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_813_23813502_qa_4/environment/pull_bucket.py b/tasks/0023_813_23813502_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_813_23813502_qa_4/environment/pull_bucket.py +++ b/tasks/0023_813_23813502_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_813_23813502_qa_4/task.toml b/tasks/0023_813_23813502_qa_4/task.toml index 9fe86a424c8a6e5e6769b3f8244e0a0f0fe10e68..639cbc148f693bca7719cb6f87f3e3e20b9369f2 100644 --- a/tasks/0023_813_23813502_qa_4/task.toml +++ b/tasks/0023_813_23813502_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_845_23845805_qa_3/environment/bootstrap.sh b/tasks/0023_845_23845805_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_845_23845805_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_845_23845805_qa_3/environment/pull_bucket.py b/tasks/0023_845_23845805_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_845_23845805_qa_3/environment/pull_bucket.py +++ b/tasks/0023_845_23845805_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_845_23845805_qa_3/task.toml b/tasks/0023_845_23845805_qa_3/task.toml index 16c444701b25454bfcd89053701b7107cc457253..db327fe11f7092113d16b2f7c624d516d0bac8be 100644 --- a/tasks/0023_845_23845805_qa_3/task.toml +++ b/tasks/0023_845_23845805_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_846_23846255_qa_1/environment/bootstrap.sh b/tasks/0023_846_23846255_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_846_23846255_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_846_23846255_qa_1/environment/pull_bucket.py b/tasks/0023_846_23846255_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_846_23846255_qa_1/environment/pull_bucket.py +++ b/tasks/0023_846_23846255_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_846_23846255_qa_1/task.toml b/tasks/0023_846_23846255_qa_1/task.toml index 1ce70e37b8446f68f9ce230cae72fefcf7124e44..db178ca9224598d97878029de74aa538742575e9 100644 --- a/tasks/0023_846_23846255_qa_1/task.toml +++ b/tasks/0023_846_23846255_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_908_23908999_qa_2/environment/bootstrap.sh b/tasks/0023_908_23908999_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_908_23908999_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_908_23908999_qa_2/environment/pull_bucket.py b/tasks/0023_908_23908999_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_908_23908999_qa_2/environment/pull_bucket.py +++ b/tasks/0023_908_23908999_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_908_23908999_qa_2/task.toml b/tasks/0023_908_23908999_qa_2/task.toml index 95dd66e91773121c8d650ac29cd3a58e820571a0..6f9338953bdc09d2cef249b498f365b88426584a 100644 --- a/tasks/0023_908_23908999_qa_2/task.toml +++ b/tasks/0023_908_23908999_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_908_23908999_qa_4/environment/bootstrap.sh b/tasks/0023_908_23908999_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_908_23908999_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_908_23908999_qa_4/environment/pull_bucket.py b/tasks/0023_908_23908999_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_908_23908999_qa_4/environment/pull_bucket.py +++ b/tasks/0023_908_23908999_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_908_23908999_qa_4/task.toml b/tasks/0023_908_23908999_qa_4/task.toml index 115341a62e9c1d21a795dfa621357e6add501d34..dd016daa46ae41dc119925ed540c037c253a3591 100644 --- a/tasks/0023_908_23908999_qa_4/task.toml +++ b/tasks/0023_908_23908999_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_913_23913406_qa_1/environment/bootstrap.sh b/tasks/0023_913_23913406_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_913_23913406_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_913_23913406_qa_1/environment/pull_bucket.py b/tasks/0023_913_23913406_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_913_23913406_qa_1/environment/pull_bucket.py +++ b/tasks/0023_913_23913406_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_913_23913406_qa_1/task.toml b/tasks/0023_913_23913406_qa_1/task.toml index e4d2104b786d19065c8184a995b6e6f00b35e28d..4afcb5417896624e97cd657295975923edca2921 100644 --- a/tasks/0023_913_23913406_qa_1/task.toml +++ b/tasks/0023_913_23913406_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_913_23913406_qa_2/environment/bootstrap.sh b/tasks/0023_913_23913406_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_913_23913406_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_913_23913406_qa_2/environment/pull_bucket.py b/tasks/0023_913_23913406_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_913_23913406_qa_2/environment/pull_bucket.py +++ b/tasks/0023_913_23913406_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_913_23913406_qa_2/task.toml b/tasks/0023_913_23913406_qa_2/task.toml index 1814139c96051793e561015f76d25323d7388064..ecaddb58c778febdd5fe50639c68bfc86fdfd229 100644 --- a/tasks/0023_913_23913406_qa_2/task.toml +++ b/tasks/0023_913_23913406_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_931_23931431_qa_1/environment/bootstrap.sh b/tasks/0023_931_23931431_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_931_23931431_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_931_23931431_qa_1/environment/pull_bucket.py b/tasks/0023_931_23931431_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_931_23931431_qa_1/environment/pull_bucket.py +++ b/tasks/0023_931_23931431_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_931_23931431_qa_1/task.toml b/tasks/0023_931_23931431_qa_1/task.toml index 03be3eb2052a4db772a431c57b5fdfdaf4e65d04..81219ef8d3be85dd2a38a6ea4fe02167603d8684 100644 --- a/tasks/0023_931_23931431_qa_1/task.toml +++ b/tasks/0023_931_23931431_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_931_23931431_qa_2/environment/bootstrap.sh b/tasks/0023_931_23931431_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_931_23931431_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_931_23931431_qa_2/environment/pull_bucket.py b/tasks/0023_931_23931431_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_931_23931431_qa_2/environment/pull_bucket.py +++ b/tasks/0023_931_23931431_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_931_23931431_qa_2/task.toml b/tasks/0023_931_23931431_qa_2/task.toml index 775ef84ed4a831f73bda9016bfc799e149fc70b6..a9fd7c91f65a1f29476960a5a1d3ff6431163ea6 100644 --- a/tasks/0023_931_23931431_qa_2/task.toml +++ b/tasks/0023_931_23931431_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_980_23980311_qa_3/environment/bootstrap.sh b/tasks/0023_980_23980311_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_980_23980311_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_980_23980311_qa_3/environment/pull_bucket.py b/tasks/0023_980_23980311_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_980_23980311_qa_3/environment/pull_bucket.py +++ b/tasks/0023_980_23980311_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_980_23980311_qa_3/task.toml b/tasks/0023_980_23980311_qa_3/task.toml index f05d9bbab5b0caa226d91483804f178817f2e9b0..e7b94b7d742028e3691067dc0aa1919c9ce9d619 100644 --- a/tasks/0023_980_23980311_qa_3/task.toml +++ b/tasks/0023_980_23980311_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0023_990_23990837_qa_5/environment/bootstrap.sh b/tasks/0023_990_23990837_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0023_990_23990837_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0023_990_23990837_qa_5/environment/pull_bucket.py b/tasks/0023_990_23990837_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0023_990_23990837_qa_5/environment/pull_bucket.py +++ b/tasks/0023_990_23990837_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0023_990_23990837_qa_5/task.toml b/tasks/0023_990_23990837_qa_5/task.toml index e9f655975ce3503c9a61bd8a6ec38802b5e3c6b3..a71aa2368dd26fdfd6e8aa6e02d8b4647dbfec0b 100644 --- a/tasks/0023_990_23990837_qa_5/task.toml +++ b/tasks/0023_990_23990837_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_025_24025935_qa_1/environment/bootstrap.sh b/tasks/0024_025_24025935_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_025_24025935_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_025_24025935_qa_1/environment/pull_bucket.py b/tasks/0024_025_24025935_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_025_24025935_qa_1/environment/pull_bucket.py +++ b/tasks/0024_025_24025935_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_025_24025935_qa_1/task.toml b/tasks/0024_025_24025935_qa_1/task.toml index bf3aa11fd9ddad5a9b53d7174c74ed92e27888b9..99a1ca3d149d403e7ff647ce1ff3d5b811543eb3 100644 --- a/tasks/0024_025_24025935_qa_1/task.toml +++ b/tasks/0024_025_24025935_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_025_24025935_qa_3/environment/bootstrap.sh b/tasks/0024_025_24025935_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_025_24025935_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_025_24025935_qa_3/environment/pull_bucket.py b/tasks/0024_025_24025935_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_025_24025935_qa_3/environment/pull_bucket.py +++ b/tasks/0024_025_24025935_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_025_24025935_qa_3/task.toml b/tasks/0024_025_24025935_qa_3/task.toml index 4e7e5e6da9a656141c27f86ba721f3320f26605c..fcdf66d524e9b839188241515113fd2a250d99b4 100644 --- a/tasks/0024_025_24025935_qa_3/task.toml +++ b/tasks/0024_025_24025935_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_025_24025935_qa_4/environment/bootstrap.sh b/tasks/0024_025_24025935_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_025_24025935_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_025_24025935_qa_4/environment/pull_bucket.py b/tasks/0024_025_24025935_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_025_24025935_qa_4/environment/pull_bucket.py +++ b/tasks/0024_025_24025935_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_025_24025935_qa_4/task.toml b/tasks/0024_025_24025935_qa_4/task.toml index c16f9705fcb283e6a7c3633d0423a30877922341..f54ddd5a0b2836c680fa0bd5220c0d44d47b522e 100644 --- a/tasks/0024_025_24025935_qa_4/task.toml +++ b/tasks/0024_025_24025935_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_028_24028302_qa_2/environment/bootstrap.sh b/tasks/0024_028_24028302_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_028_24028302_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_028_24028302_qa_2/environment/pull_bucket.py b/tasks/0024_028_24028302_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_028_24028302_qa_2/environment/pull_bucket.py +++ b/tasks/0024_028_24028302_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_028_24028302_qa_2/task.toml b/tasks/0024_028_24028302_qa_2/task.toml index 1f27820322eba70539142290e760844100d6f013..e00bd5415b5c905607207a4023387219bfa70f4a 100644 --- a/tasks/0024_028_24028302_qa_2/task.toml +++ b/tasks/0024_028_24028302_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_069_24069916_qa_1/environment/bootstrap.sh b/tasks/0024_069_24069916_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_069_24069916_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_069_24069916_qa_1/environment/pull_bucket.py b/tasks/0024_069_24069916_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_069_24069916_qa_1/environment/pull_bucket.py +++ b/tasks/0024_069_24069916_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_069_24069916_qa_1/task.toml b/tasks/0024_069_24069916_qa_1/task.toml index 1206b002b7ae887ff0aee784b5648bd16e21f6ff..50cea577a5dea9a2e876bb9cc321653e67da8b4c 100644 --- a/tasks/0024_069_24069916_qa_1/task.toml +++ b/tasks/0024_069_24069916_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_069_24069916_qa_3/environment/bootstrap.sh b/tasks/0024_069_24069916_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_069_24069916_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_069_24069916_qa_3/environment/pull_bucket.py b/tasks/0024_069_24069916_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_069_24069916_qa_3/environment/pull_bucket.py +++ b/tasks/0024_069_24069916_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_069_24069916_qa_3/task.toml b/tasks/0024_069_24069916_qa_3/task.toml index 1e736c90a3c046c3cd6b0c572274d38e54235f46..baeff8e4721c645b0c6d9206efa64d2234460a4d 100644 --- a/tasks/0024_069_24069916_qa_3/task.toml +++ b/tasks/0024_069_24069916_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_069_24069916_qa_5/environment/bootstrap.sh b/tasks/0024_069_24069916_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_069_24069916_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_069_24069916_qa_5/environment/pull_bucket.py b/tasks/0024_069_24069916_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_069_24069916_qa_5/environment/pull_bucket.py +++ b/tasks/0024_069_24069916_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_069_24069916_qa_5/task.toml b/tasks/0024_069_24069916_qa_5/task.toml index 353906b3a18813fef63382806f7e6c7988724e51..0fff8d05604529ecc941e41dfca949e5db856e7a 100644 --- a/tasks/0024_069_24069916_qa_5/task.toml +++ b/tasks/0024_069_24069916_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_081_24081260_qa_3/environment/bootstrap.sh b/tasks/0024_081_24081260_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_081_24081260_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_081_24081260_qa_3/environment/pull_bucket.py b/tasks/0024_081_24081260_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_081_24081260_qa_3/environment/pull_bucket.py +++ b/tasks/0024_081_24081260_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_081_24081260_qa_3/task.toml b/tasks/0024_081_24081260_qa_3/task.toml index 456db1eb630c29b75922411e063803aee67effb3..e9877192c4fdadc6f721096a18534bc1532258c0 100644 --- a/tasks/0024_081_24081260_qa_3/task.toml +++ b/tasks/0024_081_24081260_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_141_24141442_qa_3/environment/bootstrap.sh b/tasks/0024_141_24141442_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_141_24141442_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_141_24141442_qa_3/environment/pull_bucket.py b/tasks/0024_141_24141442_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_141_24141442_qa_3/environment/pull_bucket.py +++ b/tasks/0024_141_24141442_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_141_24141442_qa_3/task.toml b/tasks/0024_141_24141442_qa_3/task.toml index 49350cff01298169e05c09de23916536ecc653f3..4afccc4dc34964b28562d4be9237698d08f267d9 100644 --- a/tasks/0024_141_24141442_qa_3/task.toml +++ b/tasks/0024_141_24141442_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_158_24158944_qa_1/environment/bootstrap.sh b/tasks/0024_158_24158944_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_158_24158944_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_158_24158944_qa_1/environment/pull_bucket.py b/tasks/0024_158_24158944_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_158_24158944_qa_1/environment/pull_bucket.py +++ b/tasks/0024_158_24158944_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_158_24158944_qa_1/task.toml b/tasks/0024_158_24158944_qa_1/task.toml index 803974140262ebc4214f5220b26d12b0649f37de..1b2196925c3eefad9423819e67e49eae1cbfbe01 100644 --- a/tasks/0024_158_24158944_qa_1/task.toml +++ b/tasks/0024_158_24158944_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_251_24251009_qa_3/environment/bootstrap.sh b/tasks/0024_251_24251009_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_251_24251009_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_251_24251009_qa_3/environment/pull_bucket.py b/tasks/0024_251_24251009_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_251_24251009_qa_3/environment/pull_bucket.py +++ b/tasks/0024_251_24251009_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_251_24251009_qa_3/task.toml b/tasks/0024_251_24251009_qa_3/task.toml index b0d209645dbcbe2a6f96883f9351a9aea18dff14..dfa1a49ba1a39680eeae205ea8015d3c78ea5ee3 100644 --- a/tasks/0024_251_24251009_qa_3/task.toml +++ b/tasks/0024_251_24251009_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_252_24252070_qa_2/environment/bootstrap.sh b/tasks/0024_252_24252070_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_252_24252070_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_252_24252070_qa_2/environment/pull_bucket.py b/tasks/0024_252_24252070_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_252_24252070_qa_2/environment/pull_bucket.py +++ b/tasks/0024_252_24252070_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_252_24252070_qa_2/task.toml b/tasks/0024_252_24252070_qa_2/task.toml index 2dc38acefe3d6b1952c22f2ebdd60e8a5317118b..b017f9c85784bf0effa6a9c7c0ccd614e3c02173 100644 --- a/tasks/0024_252_24252070_qa_2/task.toml +++ b/tasks/0024_252_24252070_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_275_24275657_qa_5/environment/bootstrap.sh b/tasks/0024_275_24275657_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_275_24275657_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_275_24275657_qa_5/environment/pull_bucket.py b/tasks/0024_275_24275657_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_275_24275657_qa_5/environment/pull_bucket.py +++ b/tasks/0024_275_24275657_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_275_24275657_qa_5/task.toml b/tasks/0024_275_24275657_qa_5/task.toml index aedb4c566ee34924386d696fbc98cd6d17fa746d..197e721c0fa20d8b18736f29911e79ddf9dc6aa4 100644 --- a/tasks/0024_275_24275657_qa_5/task.toml +++ b/tasks/0024_275_24275657_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_285_24285301_qa_2/environment/bootstrap.sh b/tasks/0024_285_24285301_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_285_24285301_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_285_24285301_qa_2/environment/pull_bucket.py b/tasks/0024_285_24285301_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_285_24285301_qa_2/environment/pull_bucket.py +++ b/tasks/0024_285_24285301_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_285_24285301_qa_2/task.toml b/tasks/0024_285_24285301_qa_2/task.toml index cd92db4da4c2662a95f79b246b1bdc7c5b91e51f..c69b7d92c0e050edbce39a343eabbf26815da9ca 100644 --- a/tasks/0024_285_24285301_qa_2/task.toml +++ b/tasks/0024_285_24285301_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_315_24315517_qa_5/environment/bootstrap.sh b/tasks/0024_315_24315517_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_315_24315517_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_315_24315517_qa_5/environment/pull_bucket.py b/tasks/0024_315_24315517_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_315_24315517_qa_5/environment/pull_bucket.py +++ b/tasks/0024_315_24315517_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_315_24315517_qa_5/task.toml b/tasks/0024_315_24315517_qa_5/task.toml index fccc90d5b00e3c37735b2a652386551e0f3e12d9..ac576f4e4734cf9a99474915673428bf22dadb07 100644 --- a/tasks/0024_315_24315517_qa_5/task.toml +++ b/tasks/0024_315_24315517_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_315_24315892_qa_1/environment/bootstrap.sh b/tasks/0024_315_24315892_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_315_24315892_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_315_24315892_qa_1/environment/pull_bucket.py b/tasks/0024_315_24315892_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_315_24315892_qa_1/environment/pull_bucket.py +++ b/tasks/0024_315_24315892_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_315_24315892_qa_1/task.toml b/tasks/0024_315_24315892_qa_1/task.toml index 3c16ba56e77439ab495609a6cbfde70c34613fc9..6f0da1da4ec7d55580eaf915195add8b90f2e481 100644 --- a/tasks/0024_315_24315892_qa_1/task.toml +++ b/tasks/0024_315_24315892_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_315_24315892_qa_3/environment/bootstrap.sh b/tasks/0024_315_24315892_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_315_24315892_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_315_24315892_qa_3/environment/pull_bucket.py b/tasks/0024_315_24315892_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_315_24315892_qa_3/environment/pull_bucket.py +++ b/tasks/0024_315_24315892_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_315_24315892_qa_3/task.toml b/tasks/0024_315_24315892_qa_3/task.toml index 612a8237c2ab1656980418ac961136bbb2420d22..35e82ea11d05ce25c9d2da4b760473fab69e72a3 100644 --- a/tasks/0024_315_24315892_qa_3/task.toml +++ b/tasks/0024_315_24315892_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_357_24357086_qa_3/environment/bootstrap.sh b/tasks/0024_357_24357086_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_357_24357086_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_357_24357086_qa_3/environment/pull_bucket.py b/tasks/0024_357_24357086_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_357_24357086_qa_3/environment/pull_bucket.py +++ b/tasks/0024_357_24357086_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_357_24357086_qa_3/task.toml b/tasks/0024_357_24357086_qa_3/task.toml index 21f7e8c1a8e1569f5aeddcb4e3b42d17c28d4f69..9b08ca595bb8d353cbfb42d2feaaa8ab71263bb8 100644 --- a/tasks/0024_357_24357086_qa_3/task.toml +++ b/tasks/0024_357_24357086_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_471_24471564_qa_5/environment/bootstrap.sh b/tasks/0024_471_24471564_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_471_24471564_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_471_24471564_qa_5/environment/pull_bucket.py b/tasks/0024_471_24471564_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_471_24471564_qa_5/environment/pull_bucket.py +++ b/tasks/0024_471_24471564_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_471_24471564_qa_5/task.toml b/tasks/0024_471_24471564_qa_5/task.toml index 3e07321a1b72d6305b655561df984d470deff493..43cc9f92b43ebbcafcfd9cc13be80449b917cd44 100644 --- a/tasks/0024_471_24471564_qa_5/task.toml +++ b/tasks/0024_471_24471564_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_556_24556014_qa_1/environment/bootstrap.sh b/tasks/0024_556_24556014_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_556_24556014_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_556_24556014_qa_1/environment/pull_bucket.py b/tasks/0024_556_24556014_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_556_24556014_qa_1/environment/pull_bucket.py +++ b/tasks/0024_556_24556014_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_556_24556014_qa_1/task.toml b/tasks/0024_556_24556014_qa_1/task.toml index 682a07ea9264d35d525b2c5cd2c415aabf7dcffa..e346f75fb3577fae09a8b47cf2abc9d848985dc5 100644 --- a/tasks/0024_556_24556014_qa_1/task.toml +++ b/tasks/0024_556_24556014_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_602_24602868_qa_1/environment/bootstrap.sh b/tasks/0024_602_24602868_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_602_24602868_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_602_24602868_qa_1/environment/pull_bucket.py b/tasks/0024_602_24602868_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_602_24602868_qa_1/environment/pull_bucket.py +++ b/tasks/0024_602_24602868_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_602_24602868_qa_1/task.toml b/tasks/0024_602_24602868_qa_1/task.toml index 63fe7c3f869c4af7384ddaabd8465f9e055eca26..b3eb40a2e025d82dc99b86d27825a21453b12776 100644 --- a/tasks/0024_602_24602868_qa_1/task.toml +++ b/tasks/0024_602_24602868_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_602_24602868_qa_2/environment/bootstrap.sh b/tasks/0024_602_24602868_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_602_24602868_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_602_24602868_qa_2/environment/pull_bucket.py b/tasks/0024_602_24602868_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_602_24602868_qa_2/environment/pull_bucket.py +++ b/tasks/0024_602_24602868_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_602_24602868_qa_2/task.toml b/tasks/0024_602_24602868_qa_2/task.toml index 9e9e856fca70cfa6b31aefdebac75982445f7453..c5a7b3441fb73d4e44ce4305faab32711bd8acd1 100644 --- a/tasks/0024_602_24602868_qa_2/task.toml +++ b/tasks/0024_602_24602868_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_610_24610752_qa_3/environment/bootstrap.sh b/tasks/0024_610_24610752_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_610_24610752_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_610_24610752_qa_3/environment/pull_bucket.py b/tasks/0024_610_24610752_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_610_24610752_qa_3/environment/pull_bucket.py +++ b/tasks/0024_610_24610752_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_610_24610752_qa_3/task.toml b/tasks/0024_610_24610752_qa_3/task.toml index 3d77966cb49182874e455af78c76845180a81fa3..c42e8802995ea96907bf296d9704b716670c8e9b 100644 --- a/tasks/0024_610_24610752_qa_3/task.toml +++ b/tasks/0024_610_24610752_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_633_24633797_qa_1/environment/bootstrap.sh b/tasks/0024_633_24633797_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_633_24633797_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_633_24633797_qa_1/environment/pull_bucket.py b/tasks/0024_633_24633797_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_633_24633797_qa_1/environment/pull_bucket.py +++ b/tasks/0024_633_24633797_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_633_24633797_qa_1/task.toml b/tasks/0024_633_24633797_qa_1/task.toml index 6ba4805ff25951bc8ba12209f5f762b6c718e888..bbad606d5b7ddc6d1ea0a6e6065df883956fb4ba 100644 --- a/tasks/0024_633_24633797_qa_1/task.toml +++ b/tasks/0024_633_24633797_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_650_24650942_qa_2/environment/bootstrap.sh b/tasks/0024_650_24650942_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_650_24650942_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_650_24650942_qa_2/environment/pull_bucket.py b/tasks/0024_650_24650942_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_650_24650942_qa_2/environment/pull_bucket.py +++ b/tasks/0024_650_24650942_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_650_24650942_qa_2/task.toml b/tasks/0024_650_24650942_qa_2/task.toml index 1f0bc2a77c4e676307327e5abf2864870de089c3..5173da27852912a39164e8659a4ed7e69ef326e9 100644 --- a/tasks/0024_650_24650942_qa_2/task.toml +++ b/tasks/0024_650_24650942_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_654_24654257_qa_2/environment/bootstrap.sh b/tasks/0024_654_24654257_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_654_24654257_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_654_24654257_qa_2/environment/pull_bucket.py b/tasks/0024_654_24654257_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_654_24654257_qa_2/environment/pull_bucket.py +++ b/tasks/0024_654_24654257_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_654_24654257_qa_2/task.toml b/tasks/0024_654_24654257_qa_2/task.toml index a6dd9eac61b45293c87db2753444a0120a5ee7e9..3eb0b8109c293d2935acdad5e98c41bdc1b99040 100644 --- a/tasks/0024_654_24654257_qa_2/task.toml +++ b/tasks/0024_654_24654257_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_654_24654257_qa_3/environment/bootstrap.sh b/tasks/0024_654_24654257_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_654_24654257_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_654_24654257_qa_3/environment/pull_bucket.py b/tasks/0024_654_24654257_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_654_24654257_qa_3/environment/pull_bucket.py +++ b/tasks/0024_654_24654257_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_654_24654257_qa_3/task.toml b/tasks/0024_654_24654257_qa_3/task.toml index f032423d2f0d789d3c682254f27de5c7f515966a..f0901d7431a6143a72cb86d97737757410d2537a 100644 --- a/tasks/0024_654_24654257_qa_3/task.toml +++ b/tasks/0024_654_24654257_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_658_24658460_qa_4/environment/bootstrap.sh b/tasks/0024_658_24658460_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_658_24658460_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_658_24658460_qa_4/environment/pull_bucket.py b/tasks/0024_658_24658460_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_658_24658460_qa_4/environment/pull_bucket.py +++ b/tasks/0024_658_24658460_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_658_24658460_qa_4/task.toml b/tasks/0024_658_24658460_qa_4/task.toml index 03ea04d16d0236ab0ce0bf53bd51d38be7cdce1d..99d65afa697c058ede4abda01410dabb680ab7fb 100644 --- a/tasks/0024_658_24658460_qa_4/task.toml +++ b/tasks/0024_658_24658460_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_658_24658460_qa_5/environment/bootstrap.sh b/tasks/0024_658_24658460_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_658_24658460_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_658_24658460_qa_5/environment/pull_bucket.py b/tasks/0024_658_24658460_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_658_24658460_qa_5/environment/pull_bucket.py +++ b/tasks/0024_658_24658460_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_658_24658460_qa_5/task.toml b/tasks/0024_658_24658460_qa_5/task.toml index 377dfcd20fdc9d2c6d266fe9facc7f4508a09fca..95a8d10e82ce518f83fb6ee5490541899f545a6b 100644 --- a/tasks/0024_658_24658460_qa_5/task.toml +++ b/tasks/0024_658_24658460_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_675_24675509_qa_1/environment/bootstrap.sh b/tasks/0024_675_24675509_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_675_24675509_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_675_24675509_qa_1/environment/pull_bucket.py b/tasks/0024_675_24675509_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_675_24675509_qa_1/environment/pull_bucket.py +++ b/tasks/0024_675_24675509_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_675_24675509_qa_1/task.toml b/tasks/0024_675_24675509_qa_1/task.toml index fe5b31ed97086efcf83e4c4dd6ff8ad879d7c19b..f6c9d196032499e03218b7663357e9297697755b 100644 --- a/tasks/0024_675_24675509_qa_1/task.toml +++ b/tasks/0024_675_24675509_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_675_24675509_qa_3/environment/bootstrap.sh b/tasks/0024_675_24675509_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_675_24675509_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_675_24675509_qa_3/environment/pull_bucket.py b/tasks/0024_675_24675509_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_675_24675509_qa_3/environment/pull_bucket.py +++ b/tasks/0024_675_24675509_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_675_24675509_qa_3/task.toml b/tasks/0024_675_24675509_qa_3/task.toml index 66bafff560023fe9b1d0b9a29acab052cb36a97e..ac8bf9543c073b79da5d36b4a865cb10855f5f94 100644 --- a/tasks/0024_675_24675509_qa_3/task.toml +++ b/tasks/0024_675_24675509_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_675_24675509_qa_4/environment/bootstrap.sh b/tasks/0024_675_24675509_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_675_24675509_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_675_24675509_qa_4/environment/pull_bucket.py b/tasks/0024_675_24675509_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_675_24675509_qa_4/environment/pull_bucket.py +++ b/tasks/0024_675_24675509_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_675_24675509_qa_4/task.toml b/tasks/0024_675_24675509_qa_4/task.toml index be30b54fcb5694ee84e556eae729f474b3760acf..86c01252e3d34f595d3d3ab374829ea03691721c 100644 --- a/tasks/0024_675_24675509_qa_4/task.toml +++ b/tasks/0024_675_24675509_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_796_24796579_qa_1/environment/bootstrap.sh b/tasks/0024_796_24796579_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_796_24796579_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_796_24796579_qa_1/environment/pull_bucket.py b/tasks/0024_796_24796579_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_796_24796579_qa_1/environment/pull_bucket.py +++ b/tasks/0024_796_24796579_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_796_24796579_qa_1/task.toml b/tasks/0024_796_24796579_qa_1/task.toml index 4e22a64949ec5082f9abc1a581bc4fdeb4860439..5e2f077cb223d0e56663227581b18d18c072a99e 100644 --- a/tasks/0024_796_24796579_qa_1/task.toml +++ b/tasks/0024_796_24796579_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_796_24796579_qa_2/environment/bootstrap.sh b/tasks/0024_796_24796579_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_796_24796579_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_796_24796579_qa_2/environment/pull_bucket.py b/tasks/0024_796_24796579_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_796_24796579_qa_2/environment/pull_bucket.py +++ b/tasks/0024_796_24796579_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_796_24796579_qa_2/task.toml b/tasks/0024_796_24796579_qa_2/task.toml index 49f5c01e2751581fa1cfa95acfcb5e2bd1942766..79a9113faba1cb496a1b34b73f1aa0fa8f927fe7 100644 --- a/tasks/0024_796_24796579_qa_2/task.toml +++ b/tasks/0024_796_24796579_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_796_24796579_qa_3/environment/bootstrap.sh b/tasks/0024_796_24796579_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_796_24796579_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_796_24796579_qa_3/environment/pull_bucket.py b/tasks/0024_796_24796579_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_796_24796579_qa_3/environment/pull_bucket.py +++ b/tasks/0024_796_24796579_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_796_24796579_qa_3/task.toml b/tasks/0024_796_24796579_qa_3/task.toml index 998e32272989fdff4a41307cbe131126123eec8a..8ca8989d0b1825eda80972b55839ad12b59b7c2c 100644 --- a/tasks/0024_796_24796579_qa_3/task.toml +++ b/tasks/0024_796_24796579_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_829_24829447_qa_4/environment/bootstrap.sh b/tasks/0024_829_24829447_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_829_24829447_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_829_24829447_qa_4/environment/pull_bucket.py b/tasks/0024_829_24829447_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_829_24829447_qa_4/environment/pull_bucket.py +++ b/tasks/0024_829_24829447_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_829_24829447_qa_4/task.toml b/tasks/0024_829_24829447_qa_4/task.toml index bb23caf3a1bcd0f8fc4682951d94120b29aa11ee..3d11672df182e30e2d7b55f40a4553e73f7543f4 100644 --- a/tasks/0024_829_24829447_qa_4/task.toml +++ b/tasks/0024_829_24829447_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_893_24893903_qa_4/environment/bootstrap.sh b/tasks/0024_893_24893903_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_893_24893903_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_893_24893903_qa_4/environment/pull_bucket.py b/tasks/0024_893_24893903_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_893_24893903_qa_4/environment/pull_bucket.py +++ b/tasks/0024_893_24893903_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_893_24893903_qa_4/task.toml b/tasks/0024_893_24893903_qa_4/task.toml index 79435369f71fe402f260ecdae9cba07309bc95d5..e8c87788e83862d3574750c4044c54cef6349fc9 100644 --- a/tasks/0024_893_24893903_qa_4/task.toml +++ b/tasks/0024_893_24893903_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_893_24893903_qa_5/environment/bootstrap.sh b/tasks/0024_893_24893903_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_893_24893903_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_893_24893903_qa_5/environment/pull_bucket.py b/tasks/0024_893_24893903_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_893_24893903_qa_5/environment/pull_bucket.py +++ b/tasks/0024_893_24893903_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_893_24893903_qa_5/task.toml b/tasks/0024_893_24893903_qa_5/task.toml index 40dedf3bbf4fb167f2e734eac19b6573a0acc487..e70b938792911bbe42f81fd387f6a2d5b5fcffe0 100644 --- a/tasks/0024_893_24893903_qa_5/task.toml +++ b/tasks/0024_893_24893903_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_894_24894091_qa_1/environment/bootstrap.sh b/tasks/0024_894_24894091_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_894_24894091_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_894_24894091_qa_1/environment/pull_bucket.py b/tasks/0024_894_24894091_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_894_24894091_qa_1/environment/pull_bucket.py +++ b/tasks/0024_894_24894091_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_894_24894091_qa_1/task.toml b/tasks/0024_894_24894091_qa_1/task.toml index bc645ed16abd65baf2dd25f6a03924fc4fdc870f..c486c241ebf0cfeb1e6bb0d5fc4239212119235a 100644 --- a/tasks/0024_894_24894091_qa_1/task.toml +++ b/tasks/0024_894_24894091_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0024_991_24991983_qa_2/environment/bootstrap.sh b/tasks/0024_991_24991983_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0024_991_24991983_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0024_991_24991983_qa_2/environment/pull_bucket.py b/tasks/0024_991_24991983_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0024_991_24991983_qa_2/environment/pull_bucket.py +++ b/tasks/0024_991_24991983_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0024_991_24991983_qa_2/task.toml b/tasks/0024_991_24991983_qa_2/task.toml index 3fcd423fba207e3ee9efc808e83fde5c5380ed9e..c3ce45ac1f1bb44378941d5f3231fa9954f2cb0b 100644 --- a/tasks/0024_991_24991983_qa_2/task.toml +++ b/tasks/0024_991_24991983_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_024_25024460_qa_1/environment/bootstrap.sh b/tasks/0025_024_25024460_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_024_25024460_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_024_25024460_qa_1/environment/pull_bucket.py b/tasks/0025_024_25024460_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_024_25024460_qa_1/environment/pull_bucket.py +++ b/tasks/0025_024_25024460_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_024_25024460_qa_1/task.toml b/tasks/0025_024_25024460_qa_1/task.toml index 653600cec361a4dfde71333a07550ce4a10f550e..338bea9b1067ed35439344ffcef0468997f9b26c 100644 --- a/tasks/0025_024_25024460_qa_1/task.toml +++ b/tasks/0025_024_25024460_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_160_25160247_qa_2/environment/bootstrap.sh b/tasks/0025_160_25160247_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_160_25160247_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_160_25160247_qa_2/environment/pull_bucket.py b/tasks/0025_160_25160247_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_160_25160247_qa_2/environment/pull_bucket.py +++ b/tasks/0025_160_25160247_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_160_25160247_qa_2/task.toml b/tasks/0025_160_25160247_qa_2/task.toml index c557fea3c67a13a5e4b1d0e2365a665557c2425c..86baba751fd665fac08a8a3e6dd10e4b88f5f45f 100644 --- a/tasks/0025_160_25160247_qa_2/task.toml +++ b/tasks/0025_160_25160247_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_160_25160247_qa_3/environment/bootstrap.sh b/tasks/0025_160_25160247_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_160_25160247_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_160_25160247_qa_3/environment/pull_bucket.py b/tasks/0025_160_25160247_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_160_25160247_qa_3/environment/pull_bucket.py +++ b/tasks/0025_160_25160247_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_160_25160247_qa_3/task.toml b/tasks/0025_160_25160247_qa_3/task.toml index 8c7878ed206ccf1500dc8ee2157936d414573cbc..79471b59bd9bb6b86cb8f96c8d60b1a2c5ff2066 100644 --- a/tasks/0025_160_25160247_qa_3/task.toml +++ b/tasks/0025_160_25160247_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_163_25163859_qa_4/environment/bootstrap.sh b/tasks/0025_163_25163859_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_163_25163859_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_163_25163859_qa_4/environment/pull_bucket.py b/tasks/0025_163_25163859_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_163_25163859_qa_4/environment/pull_bucket.py +++ b/tasks/0025_163_25163859_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_163_25163859_qa_4/task.toml b/tasks/0025_163_25163859_qa_4/task.toml index 8fbd3e7893e610f614eec53b2d3f048112342597..c5fe9ed78c71879e7523f2933b8fcad2d536d7cb 100644 --- a/tasks/0025_163_25163859_qa_4/task.toml +++ b/tasks/0025_163_25163859_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_173_25173804_qa_3/environment/bootstrap.sh b/tasks/0025_173_25173804_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_173_25173804_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_173_25173804_qa_3/environment/pull_bucket.py b/tasks/0025_173_25173804_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_173_25173804_qa_3/environment/pull_bucket.py +++ b/tasks/0025_173_25173804_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_173_25173804_qa_3/task.toml b/tasks/0025_173_25173804_qa_3/task.toml index 12bd151134154158646eed2a123dc61158a5bffd..22b63dce8d1847d616dce02c17f6a0a8a0651b72 100644 --- a/tasks/0025_173_25173804_qa_3/task.toml +++ b/tasks/0025_173_25173804_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_204_25204322_qa_4/environment/bootstrap.sh b/tasks/0025_204_25204322_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_204_25204322_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_204_25204322_qa_4/environment/pull_bucket.py b/tasks/0025_204_25204322_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_204_25204322_qa_4/environment/pull_bucket.py +++ b/tasks/0025_204_25204322_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_204_25204322_qa_4/task.toml b/tasks/0025_204_25204322_qa_4/task.toml index 3916cb20bd17329b791ead04a8df8e381ca76d36..54df9af7f72f73830880aa2fdf5d2c2e3a06dbfb 100644 --- a/tasks/0025_204_25204322_qa_4/task.toml +++ b/tasks/0025_204_25204322_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_207_25207458_qa_2/environment/bootstrap.sh b/tasks/0025_207_25207458_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_207_25207458_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_207_25207458_qa_2/environment/pull_bucket.py b/tasks/0025_207_25207458_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_207_25207458_qa_2/environment/pull_bucket.py +++ b/tasks/0025_207_25207458_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_207_25207458_qa_2/task.toml b/tasks/0025_207_25207458_qa_2/task.toml index 3a2c30bcb0eac549a5e65af03ed4b38dbd55afa6..70192a3c0c6ec4e07509dbdd2d08cf5500a2b73a 100644 --- a/tasks/0025_207_25207458_qa_2/task.toml +++ b/tasks/0025_207_25207458_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_211_25211872_qa_4/environment/bootstrap.sh b/tasks/0025_211_25211872_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_211_25211872_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_211_25211872_qa_4/environment/pull_bucket.py b/tasks/0025_211_25211872_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_211_25211872_qa_4/environment/pull_bucket.py +++ b/tasks/0025_211_25211872_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_211_25211872_qa_4/task.toml b/tasks/0025_211_25211872_qa_4/task.toml index f335cb0da6ce93bfeb84b55572de9190620cc083..864244dd7ea3ae26d8f451971a87c15e6b8f2502 100644 --- a/tasks/0025_211_25211872_qa_4/task.toml +++ b/tasks/0025_211_25211872_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_241_25241426_qa_2/environment/bootstrap.sh b/tasks/0025_241_25241426_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_241_25241426_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_241_25241426_qa_2/environment/pull_bucket.py b/tasks/0025_241_25241426_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_241_25241426_qa_2/environment/pull_bucket.py +++ b/tasks/0025_241_25241426_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_241_25241426_qa_2/task.toml b/tasks/0025_241_25241426_qa_2/task.toml index 20dcaa939e3bbef003209a0c4c797464c9fa0915..f4cb71555c1109cb43f4ee947704f5797b90e24f 100644 --- a/tasks/0025_241_25241426_qa_2/task.toml +++ b/tasks/0025_241_25241426_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_241_25241426_qa_3/environment/bootstrap.sh b/tasks/0025_241_25241426_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_241_25241426_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_241_25241426_qa_3/environment/pull_bucket.py b/tasks/0025_241_25241426_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_241_25241426_qa_3/environment/pull_bucket.py +++ b/tasks/0025_241_25241426_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_241_25241426_qa_3/task.toml b/tasks/0025_241_25241426_qa_3/task.toml index 538cc0538b125f3b90c586203cd5fd97e1f8a18c..07c01b644a7c488897a9bc870bfcfa976eb820ca 100644 --- a/tasks/0025_241_25241426_qa_3/task.toml +++ b/tasks/0025_241_25241426_qa_3/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_273_25273223_qa_3/environment/bootstrap.sh b/tasks/0025_273_25273223_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_273_25273223_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_273_25273223_qa_3/environment/pull_bucket.py b/tasks/0025_273_25273223_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_273_25273223_qa_3/environment/pull_bucket.py +++ b/tasks/0025_273_25273223_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_273_25273223_qa_3/task.toml b/tasks/0025_273_25273223_qa_3/task.toml index cf68a4882e61e512d6be6f255a1d0fd3c82d6022..4ceee3667cb9841869dd396c1f59e3ddc4dd3e80 100644 --- a/tasks/0025_273_25273223_qa_3/task.toml +++ b/tasks/0025_273_25273223_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_273_25273223_qa_4/environment/bootstrap.sh b/tasks/0025_273_25273223_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_273_25273223_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_273_25273223_qa_4/environment/pull_bucket.py b/tasks/0025_273_25273223_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_273_25273223_qa_4/environment/pull_bucket.py +++ b/tasks/0025_273_25273223_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_273_25273223_qa_4/task.toml b/tasks/0025_273_25273223_qa_4/task.toml index 37622b88419ec7a282eabf93b763efe5438656c2..ee930152e838c32eacdb462b4489da6ae12e3a61 100644 --- a/tasks/0025_273_25273223_qa_4/task.toml +++ b/tasks/0025_273_25273223_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_274_25274016_qa_4/environment/bootstrap.sh b/tasks/0025_274_25274016_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_274_25274016_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_274_25274016_qa_4/environment/pull_bucket.py b/tasks/0025_274_25274016_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_274_25274016_qa_4/environment/pull_bucket.py +++ b/tasks/0025_274_25274016_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_274_25274016_qa_4/task.toml b/tasks/0025_274_25274016_qa_4/task.toml index e570fa1a886108a64f998a1ed8e24ea8471157ea..a286a5f7a882d3ea21a3b987d23a4d26bc3ea16c 100644 --- a/tasks/0025_274_25274016_qa_4/task.toml +++ b/tasks/0025_274_25274016_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_491_25491400_qa_4/environment/bootstrap.sh b/tasks/0025_491_25491400_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_491_25491400_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_491_25491400_qa_4/environment/pull_bucket.py b/tasks/0025_491_25491400_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_491_25491400_qa_4/environment/pull_bucket.py +++ b/tasks/0025_491_25491400_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_491_25491400_qa_4/task.toml b/tasks/0025_491_25491400_qa_4/task.toml index f893ad9a8a344c217e6616ed20beb5756083ab83..22dee24827119a82f0621d8fe05df151a4fecf75 100644 --- a/tasks/0025_491_25491400_qa_4/task.toml +++ b/tasks/0025_491_25491400_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_564_25564899_qa_4/environment/bootstrap.sh b/tasks/0025_564_25564899_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_564_25564899_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_564_25564899_qa_4/environment/pull_bucket.py b/tasks/0025_564_25564899_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_564_25564899_qa_4/environment/pull_bucket.py +++ b/tasks/0025_564_25564899_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_564_25564899_qa_4/task.toml b/tasks/0025_564_25564899_qa_4/task.toml index cc02273abf15adae4507291bae76d33e8fb18186..19efdb392dac707814c9b849cf6c7b1111accdfa 100644 --- a/tasks/0025_564_25564899_qa_4/task.toml +++ b/tasks/0025_564_25564899_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0025_744_25744450_qa_1/environment/bootstrap.sh b/tasks/0025_744_25744450_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0025_744_25744450_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0025_744_25744450_qa_1/environment/pull_bucket.py b/tasks/0025_744_25744450_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0025_744_25744450_qa_1/environment/pull_bucket.py +++ b/tasks/0025_744_25744450_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0025_744_25744450_qa_1/task.toml b/tasks/0025_744_25744450_qa_1/task.toml index 5eb3f0b402fe64bd8576ae0033afbcaffea8982a..d47119b5de0e10c18fe0a320c7a04d91debd3520 100644 --- a/tasks/0025_744_25744450_qa_1/task.toml +++ b/tasks/0025_744_25744450_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_141_26141545_qa_1/environment/bootstrap.sh b/tasks/0026_141_26141545_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_141_26141545_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_141_26141545_qa_1/environment/pull_bucket.py b/tasks/0026_141_26141545_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_141_26141545_qa_1/environment/pull_bucket.py +++ b/tasks/0026_141_26141545_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_141_26141545_qa_1/task.toml b/tasks/0026_141_26141545_qa_1/task.toml index 1fbcec2da7c7d2b8cfb327560669ef19fd20a9eb..8b1f3e64be72061cd889f6b1911b08e8cb298a40 100644 --- a/tasks/0026_141_26141545_qa_1/task.toml +++ b/tasks/0026_141_26141545_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_141_26141545_qa_5/environment/bootstrap.sh b/tasks/0026_141_26141545_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_141_26141545_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_141_26141545_qa_5/environment/pull_bucket.py b/tasks/0026_141_26141545_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_141_26141545_qa_5/environment/pull_bucket.py +++ b/tasks/0026_141_26141545_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_141_26141545_qa_5/task.toml b/tasks/0026_141_26141545_qa_5/task.toml index 3e2b397d2311afcbdf6ee71493396fb2843205fa..fc114a5e8aa279a1f0ae7ef41cf5ef7b7e05da60 100644 --- a/tasks/0026_141_26141545_qa_5/task.toml +++ b/tasks/0026_141_26141545_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_168_26168351_qa_5/environment/bootstrap.sh b/tasks/0026_168_26168351_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_168_26168351_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_168_26168351_qa_5/environment/pull_bucket.py b/tasks/0026_168_26168351_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_168_26168351_qa_5/environment/pull_bucket.py +++ b/tasks/0026_168_26168351_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_168_26168351_qa_5/task.toml b/tasks/0026_168_26168351_qa_5/task.toml index fff373150c0a24533ed6e7e326cd0bac46fe3741..de7ec4fe39927f77d173989f238eb457371100f2 100644 --- a/tasks/0026_168_26168351_qa_5/task.toml +++ b/tasks/0026_168_26168351_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_168_26168363_qa_1/environment/bootstrap.sh b/tasks/0026_168_26168363_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_168_26168363_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_168_26168363_qa_1/environment/pull_bucket.py b/tasks/0026_168_26168363_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_168_26168363_qa_1/environment/pull_bucket.py +++ b/tasks/0026_168_26168363_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_168_26168363_qa_1/task.toml b/tasks/0026_168_26168363_qa_1/task.toml index 6c8fcfe7b93c5f1c5e21a2b6dcd3ef207f8d40f8..73d19e452b8b5d36de24c5f92cf2bde77d1bdbb1 100644 --- a/tasks/0026_168_26168363_qa_1/task.toml +++ b/tasks/0026_168_26168363_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_168_26168363_qa_4/environment/bootstrap.sh b/tasks/0026_168_26168363_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_168_26168363_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_168_26168363_qa_4/environment/pull_bucket.py b/tasks/0026_168_26168363_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_168_26168363_qa_4/environment/pull_bucket.py +++ b/tasks/0026_168_26168363_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_168_26168363_qa_4/task.toml b/tasks/0026_168_26168363_qa_4/task.toml index c971967a5aa8019575ac980251d929da07f10bbc..ab7448b58651a6b6aee75f1b04eb31b3a3737146 100644 --- a/tasks/0026_168_26168363_qa_4/task.toml +++ b/tasks/0026_168_26168363_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_293_26293551_qa_3/environment/bootstrap.sh b/tasks/0026_293_26293551_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_293_26293551_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_293_26293551_qa_3/environment/pull_bucket.py b/tasks/0026_293_26293551_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_293_26293551_qa_3/environment/pull_bucket.py +++ b/tasks/0026_293_26293551_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_293_26293551_qa_3/task.toml b/tasks/0026_293_26293551_qa_3/task.toml index e66754c41723147653d6fe9525d5fcea69129247..b7181b7323c553378700f42097f84638f34bae77 100644 --- a/tasks/0026_293_26293551_qa_3/task.toml +++ b/tasks/0026_293_26293551_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_354_26354042_qa_1/environment/bootstrap.sh b/tasks/0026_354_26354042_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_354_26354042_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_354_26354042_qa_1/environment/pull_bucket.py b/tasks/0026_354_26354042_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_354_26354042_qa_1/environment/pull_bucket.py +++ b/tasks/0026_354_26354042_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_354_26354042_qa_1/task.toml b/tasks/0026_354_26354042_qa_1/task.toml index 521f8f3fc4ade45d570aee5e2e72b8970559c5fd..20bfdbb875b85d192e566ad14188d6a82bf68efa 100644 --- a/tasks/0026_354_26354042_qa_1/task.toml +++ b/tasks/0026_354_26354042_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_354_26354042_qa_4/environment/bootstrap.sh b/tasks/0026_354_26354042_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_354_26354042_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_354_26354042_qa_4/environment/pull_bucket.py b/tasks/0026_354_26354042_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_354_26354042_qa_4/environment/pull_bucket.py +++ b/tasks/0026_354_26354042_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_354_26354042_qa_4/task.toml b/tasks/0026_354_26354042_qa_4/task.toml index 66f73c595b815b6866737ab59e102364443eb440..0a0161ff792a759d90b14538a2a89bf76cbb18eb 100644 --- a/tasks/0026_354_26354042_qa_4/task.toml +++ b/tasks/0026_354_26354042_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_376_26376215_qa_4/environment/bootstrap.sh b/tasks/0026_376_26376215_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_376_26376215_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_376_26376215_qa_4/environment/pull_bucket.py b/tasks/0026_376_26376215_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_376_26376215_qa_4/environment/pull_bucket.py +++ b/tasks/0026_376_26376215_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_376_26376215_qa_4/task.toml b/tasks/0026_376_26376215_qa_4/task.toml index f4bd0a62ca9fa28e6f2beec93afcd0b702bd2558..a71fef7f48dbe758d8864e5d8ac4187611e97305 100644 --- a/tasks/0026_376_26376215_qa_4/task.toml +++ b/tasks/0026_376_26376215_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_494_26494658_qa_1/environment/bootstrap.sh b/tasks/0026_494_26494658_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_494_26494658_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_494_26494658_qa_1/environment/pull_bucket.py b/tasks/0026_494_26494658_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_494_26494658_qa_1/environment/pull_bucket.py +++ b/tasks/0026_494_26494658_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_494_26494658_qa_1/task.toml b/tasks/0026_494_26494658_qa_1/task.toml index 20f163191a760259f0fb90f85d469011af9c11f6..494852481741df82709007f15486da0c58422e10 100644 --- a/tasks/0026_494_26494658_qa_1/task.toml +++ b/tasks/0026_494_26494658_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_494_26494658_qa_4/environment/bootstrap.sh b/tasks/0026_494_26494658_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_494_26494658_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_494_26494658_qa_4/environment/pull_bucket.py b/tasks/0026_494_26494658_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_494_26494658_qa_4/environment/pull_bucket.py +++ b/tasks/0026_494_26494658_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_494_26494658_qa_4/task.toml b/tasks/0026_494_26494658_qa_4/task.toml index 8ced1574d63b848d9658ccde0609b9e96b6a063a..b76b8a74bc118d540994b125ba4fd00c63fa160f 100644 --- a/tasks/0026_494_26494658_qa_4/task.toml +++ b/tasks/0026_494_26494658_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_494_26494658_qa_5/environment/bootstrap.sh b/tasks/0026_494_26494658_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_494_26494658_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_494_26494658_qa_5/environment/pull_bucket.py b/tasks/0026_494_26494658_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_494_26494658_qa_5/environment/pull_bucket.py +++ b/tasks/0026_494_26494658_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_494_26494658_qa_5/task.toml b/tasks/0026_494_26494658_qa_5/task.toml index 075cbf3e0cfe89687e64cbb740860afe5f72dae1..c18e5149b43da75857a42ac327868d1f57917eb4 100644 --- a/tasks/0026_494_26494658_qa_5/task.toml +++ b/tasks/0026_494_26494658_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_514_26514302_qa_2/environment/bootstrap.sh b/tasks/0026_514_26514302_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_514_26514302_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_514_26514302_qa_2/environment/pull_bucket.py b/tasks/0026_514_26514302_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_514_26514302_qa_2/environment/pull_bucket.py +++ b/tasks/0026_514_26514302_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_514_26514302_qa_2/task.toml b/tasks/0026_514_26514302_qa_2/task.toml index 6479dbb0e273106c8ed0816da7faa79e91248a98..1d17c55dfb27522182820661302126fa1b9b0bc2 100644 --- a/tasks/0026_514_26514302_qa_2/task.toml +++ b/tasks/0026_514_26514302_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_514_26514302_qa_4/environment/bootstrap.sh b/tasks/0026_514_26514302_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_514_26514302_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_514_26514302_qa_4/environment/pull_bucket.py b/tasks/0026_514_26514302_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_514_26514302_qa_4/environment/pull_bucket.py +++ b/tasks/0026_514_26514302_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_514_26514302_qa_4/task.toml b/tasks/0026_514_26514302_qa_4/task.toml index 14fb3f1f07a9e2c3790e6b3e9bc2a7d93eafd482..ced69a51b8537df257e7713d2a4bb42b58c17128 100644 --- a/tasks/0026_514_26514302_qa_4/task.toml +++ b/tasks/0026_514_26514302_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_528_26528881_qa_3/environment/bootstrap.sh b/tasks/0026_528_26528881_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_528_26528881_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_528_26528881_qa_3/environment/pull_bucket.py b/tasks/0026_528_26528881_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_528_26528881_qa_3/environment/pull_bucket.py +++ b/tasks/0026_528_26528881_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_528_26528881_qa_3/task.toml b/tasks/0026_528_26528881_qa_3/task.toml index 0a1e241fdbc2067474d99c9a876238239d72866a..1bed092ff11107073bd2da591ee4870295081018 100644 --- a/tasks/0026_528_26528881_qa_3/task.toml +++ b/tasks/0026_528_26528881_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_546_26546219_qa_2/environment/bootstrap.sh b/tasks/0026_546_26546219_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_546_26546219_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_546_26546219_qa_2/environment/pull_bucket.py b/tasks/0026_546_26546219_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_546_26546219_qa_2/environment/pull_bucket.py +++ b/tasks/0026_546_26546219_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_546_26546219_qa_2/task.toml b/tasks/0026_546_26546219_qa_2/task.toml index a8829656e568b883109879a986b7789bdc6bd036..0a2f9ba2db08ab3cd8a0182c0ede208a91697183 100644 --- a/tasks/0026_546_26546219_qa_2/task.toml +++ b/tasks/0026_546_26546219_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_546_26546219_qa_3/environment/bootstrap.sh b/tasks/0026_546_26546219_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_546_26546219_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_546_26546219_qa_3/environment/pull_bucket.py b/tasks/0026_546_26546219_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_546_26546219_qa_3/environment/pull_bucket.py +++ b/tasks/0026_546_26546219_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_546_26546219_qa_3/task.toml b/tasks/0026_546_26546219_qa_3/task.toml index d49c96b0d74c017bf883c967c89cbcf34cbbc44b..d8b2dcfa2c27e1d5b9277326de0d7dadb1c70912 100644 --- a/tasks/0026_546_26546219_qa_3/task.toml +++ b/tasks/0026_546_26546219_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_546_26546219_qa_5/environment/bootstrap.sh b/tasks/0026_546_26546219_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_546_26546219_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_546_26546219_qa_5/environment/pull_bucket.py b/tasks/0026_546_26546219_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_546_26546219_qa_5/environment/pull_bucket.py +++ b/tasks/0026_546_26546219_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_546_26546219_qa_5/task.toml b/tasks/0026_546_26546219_qa_5/task.toml index 493f723aed4ce2cdf90d008347224466053f6d85..0dee0dbb5bfcb8f3eabb3b9a1cf559a1ca4a767d 100644 --- a/tasks/0026_546_26546219_qa_5/task.toml +++ b/tasks/0026_546_26546219_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_551_26551206_qa_3/environment/bootstrap.sh b/tasks/0026_551_26551206_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_551_26551206_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_551_26551206_qa_3/environment/pull_bucket.py b/tasks/0026_551_26551206_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_551_26551206_qa_3/environment/pull_bucket.py +++ b/tasks/0026_551_26551206_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_551_26551206_qa_3/task.toml b/tasks/0026_551_26551206_qa_3/task.toml index 03bf943b201b419cc78f0b7704ddeb739a0eced8..053e18c20a26dd75dbe25280964c98b58cc0673a 100644 --- a/tasks/0026_551_26551206_qa_3/task.toml +++ b/tasks/0026_551_26551206_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_643_26643260_qa_1/environment/bootstrap.sh b/tasks/0026_643_26643260_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_643_26643260_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_643_26643260_qa_1/environment/pull_bucket.py b/tasks/0026_643_26643260_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_643_26643260_qa_1/environment/pull_bucket.py +++ b/tasks/0026_643_26643260_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_643_26643260_qa_1/task.toml b/tasks/0026_643_26643260_qa_1/task.toml index d983dedc73fcf8bad968f944702c5fba8912c567..2e152213f1b0de87dfb868092d2967615c48afe7 100644 --- a/tasks/0026_643_26643260_qa_1/task.toml +++ b/tasks/0026_643_26643260_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_643_26643260_qa_5/environment/bootstrap.sh b/tasks/0026_643_26643260_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_643_26643260_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_643_26643260_qa_5/environment/pull_bucket.py b/tasks/0026_643_26643260_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_643_26643260_qa_5/environment/pull_bucket.py +++ b/tasks/0026_643_26643260_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_643_26643260_qa_5/task.toml b/tasks/0026_643_26643260_qa_5/task.toml index 445637eaf0f5bb85cb5ff2000a8f0c2551683310..3422050c691561bb076496c29efa57aa66acec74 100644 --- a/tasks/0026_643_26643260_qa_5/task.toml +++ b/tasks/0026_643_26643260_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_651_26651353_qa_3/environment/bootstrap.sh b/tasks/0026_651_26651353_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_651_26651353_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_651_26651353_qa_3/environment/pull_bucket.py b/tasks/0026_651_26651353_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_651_26651353_qa_3/environment/pull_bucket.py +++ b/tasks/0026_651_26651353_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_651_26651353_qa_3/task.toml b/tasks/0026_651_26651353_qa_3/task.toml index 15266ce6c25c56b2346424948992ace6c8c42e83..ddb9e8e663819bd7281cd70196e995c4581b1c24 100644 --- a/tasks/0026_651_26651353_qa_3/task.toml +++ b/tasks/0026_651_26651353_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_818_26818249_qa_5/environment/bootstrap.sh b/tasks/0026_818_26818249_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_818_26818249_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_818_26818249_qa_5/environment/pull_bucket.py b/tasks/0026_818_26818249_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_818_26818249_qa_5/environment/pull_bucket.py +++ b/tasks/0026_818_26818249_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_818_26818249_qa_5/task.toml b/tasks/0026_818_26818249_qa_5/task.toml index 809ccb3296393f2d97bb8698b2b3a3593d4eb3eb..cb3cf0f09b39f40ddb9f939ee51a44cec2b4ec0a 100644 --- a/tasks/0026_818_26818249_qa_5/task.toml +++ b/tasks/0026_818_26818249_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_826_26826730_qa_1/environment/bootstrap.sh b/tasks/0026_826_26826730_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_826_26826730_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_826_26826730_qa_1/environment/pull_bucket.py b/tasks/0026_826_26826730_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_826_26826730_qa_1/environment/pull_bucket.py +++ b/tasks/0026_826_26826730_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_826_26826730_qa_1/task.toml b/tasks/0026_826_26826730_qa_1/task.toml index 0e4ecec458ae3a61343f68c1c84ce9c8e8a751b8..dd7ac76d44fe1d8bce357064482e45fbf90ccf04 100644 --- a/tasks/0026_826_26826730_qa_1/task.toml +++ b/tasks/0026_826_26826730_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_826_26826730_qa_2/environment/bootstrap.sh b/tasks/0026_826_26826730_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_826_26826730_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_826_26826730_qa_2/environment/pull_bucket.py b/tasks/0026_826_26826730_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_826_26826730_qa_2/environment/pull_bucket.py +++ b/tasks/0026_826_26826730_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_826_26826730_qa_2/task.toml b/tasks/0026_826_26826730_qa_2/task.toml index 39ea7698a5a51eea088641b06f130ad7aaa49227..894ab9d7af1844dccba114061c46902bee58351c 100644 --- a/tasks/0026_826_26826730_qa_2/task.toml +++ b/tasks/0026_826_26826730_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_826_26826730_qa_3/environment/bootstrap.sh b/tasks/0026_826_26826730_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_826_26826730_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_826_26826730_qa_3/environment/pull_bucket.py b/tasks/0026_826_26826730_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_826_26826730_qa_3/environment/pull_bucket.py +++ b/tasks/0026_826_26826730_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_826_26826730_qa_3/task.toml b/tasks/0026_826_26826730_qa_3/task.toml index 206ba9b57ec913f2d375a3dfe90ec85ec76660f3..96460077b1b903b6c1f858ab32b949c734d262e5 100644 --- a/tasks/0026_826_26826730_qa_3/task.toml +++ b/tasks/0026_826_26826730_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_836_26836336_qa_1/environment/bootstrap.sh b/tasks/0026_836_26836336_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_836_26836336_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_836_26836336_qa_1/environment/pull_bucket.py b/tasks/0026_836_26836336_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_836_26836336_qa_1/environment/pull_bucket.py +++ b/tasks/0026_836_26836336_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_836_26836336_qa_1/task.toml b/tasks/0026_836_26836336_qa_1/task.toml index f030acaa1b76988aa71abb0a4f49c8108fe1847c..a393b91bb7a6418a2447c0f5d78f17d916e69e7a 100644 --- a/tasks/0026_836_26836336_qa_1/task.toml +++ b/tasks/0026_836_26836336_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_836_26836336_qa_2/environment/bootstrap.sh b/tasks/0026_836_26836336_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_836_26836336_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_836_26836336_qa_2/environment/pull_bucket.py b/tasks/0026_836_26836336_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_836_26836336_qa_2/environment/pull_bucket.py +++ b/tasks/0026_836_26836336_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_836_26836336_qa_2/task.toml b/tasks/0026_836_26836336_qa_2/task.toml index 9fb82a32706333edd1213c30b790c35710ad2fdf..89b972d046684f2d1e20ad573b1ab5173876eebd 100644 --- a/tasks/0026_836_26836336_qa_2/task.toml +++ b/tasks/0026_836_26836336_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_878_26878814_qa_5/environment/bootstrap.sh b/tasks/0026_878_26878814_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_878_26878814_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_878_26878814_qa_5/environment/pull_bucket.py b/tasks/0026_878_26878814_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_878_26878814_qa_5/environment/pull_bucket.py +++ b/tasks/0026_878_26878814_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_878_26878814_qa_5/task.toml b/tasks/0026_878_26878814_qa_5/task.toml index b48e94457d3c7fe046b14e79691b38810da8a4f0..dd9d4dcd1e3844e529ff6b8cf161f0aa2fb06868 100644 --- a/tasks/0026_878_26878814_qa_5/task.toml +++ b/tasks/0026_878_26878814_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_887_26887570_qa_4/environment/bootstrap.sh b/tasks/0026_887_26887570_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_887_26887570_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_887_26887570_qa_4/environment/pull_bucket.py b/tasks/0026_887_26887570_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_887_26887570_qa_4/environment/pull_bucket.py +++ b/tasks/0026_887_26887570_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_887_26887570_qa_4/task.toml b/tasks/0026_887_26887570_qa_4/task.toml index be7622ec8a01a64aab77dc3e407d426f6af26fa7..cf2f84ce0f742470cb6994bf47a912f2d8799293 100644 --- a/tasks/0026_887_26887570_qa_4/task.toml +++ b/tasks/0026_887_26887570_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_895_26895005_qa_1/environment/bootstrap.sh b/tasks/0026_895_26895005_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_895_26895005_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_895_26895005_qa_1/environment/pull_bucket.py b/tasks/0026_895_26895005_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_895_26895005_qa_1/environment/pull_bucket.py +++ b/tasks/0026_895_26895005_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_895_26895005_qa_1/task.toml b/tasks/0026_895_26895005_qa_1/task.toml index c3137067cb4dbdc34f6f398779ee71511b3f3dd2..f9c4657a5a1cf729c56eb453abe6edef0a8dddc5 100644 --- a/tasks/0026_895_26895005_qa_1/task.toml +++ b/tasks/0026_895_26895005_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_920_26920486_qa_1/environment/bootstrap.sh b/tasks/0026_920_26920486_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_920_26920486_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_920_26920486_qa_1/environment/pull_bucket.py b/tasks/0026_920_26920486_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_920_26920486_qa_1/environment/pull_bucket.py +++ b/tasks/0026_920_26920486_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_920_26920486_qa_1/task.toml b/tasks/0026_920_26920486_qa_1/task.toml index 5bd61a92f6c94b4b8e5c225169b881a5bdabb5ff..7b9f12ed9306eb47978363c14da5d98b57ca747a 100644 --- a/tasks/0026_920_26920486_qa_1/task.toml +++ b/tasks/0026_920_26920486_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_947_26947069_qa_5/environment/bootstrap.sh b/tasks/0026_947_26947069_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_947_26947069_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_947_26947069_qa_5/environment/pull_bucket.py b/tasks/0026_947_26947069_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_947_26947069_qa_5/environment/pull_bucket.py +++ b/tasks/0026_947_26947069_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_947_26947069_qa_5/task.toml b/tasks/0026_947_26947069_qa_5/task.toml index 7cb547dac6d5f5c6b082227e81659b072e048f46..d2bdfedba16860fdd5f58e9778b0c293324c0c2a 100644 --- a/tasks/0026_947_26947069_qa_5/task.toml +++ b/tasks/0026_947_26947069_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_997_26997571_qa_2/environment/bootstrap.sh b/tasks/0026_997_26997571_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_997_26997571_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_997_26997571_qa_2/environment/pull_bucket.py b/tasks/0026_997_26997571_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_997_26997571_qa_2/environment/pull_bucket.py +++ b/tasks/0026_997_26997571_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_997_26997571_qa_2/task.toml b/tasks/0026_997_26997571_qa_2/task.toml index 761762e88924475b7b79eeec019a18a643556e1c..c157edd1cb808cbccc9b58fc93d1c91c7a29990c 100644 --- a/tasks/0026_997_26997571_qa_2/task.toml +++ b/tasks/0026_997_26997571_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_997_26997571_qa_4/environment/bootstrap.sh b/tasks/0026_997_26997571_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_997_26997571_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_997_26997571_qa_4/environment/pull_bucket.py b/tasks/0026_997_26997571_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_997_26997571_qa_4/environment/pull_bucket.py +++ b/tasks/0026_997_26997571_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_997_26997571_qa_4/task.toml b/tasks/0026_997_26997571_qa_4/task.toml index 11f00f7a855dbc9adf604828ea0f1e633684c0df..df0805dce7910b120b7f88d08b353358f27f3a09 100644 --- a/tasks/0026_997_26997571_qa_4/task.toml +++ b/tasks/0026_997_26997571_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0026_997_26997571_qa_5/environment/bootstrap.sh b/tasks/0026_997_26997571_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0026_997_26997571_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0026_997_26997571_qa_5/environment/pull_bucket.py b/tasks/0026_997_26997571_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0026_997_26997571_qa_5/environment/pull_bucket.py +++ b/tasks/0026_997_26997571_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0026_997_26997571_qa_5/task.toml b/tasks/0026_997_26997571_qa_5/task.toml index 2a9ca87e3efbc1fa18e9392bc01681a80971afbc..c0b802e9314588648f6f889ccce4343c9a78d077 100644 --- a/tasks/0026_997_26997571_qa_5/task.toml +++ b/tasks/0026_997_26997571_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_004_27004450_qa_2/environment/bootstrap.sh b/tasks/0027_004_27004450_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_004_27004450_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_004_27004450_qa_2/environment/pull_bucket.py b/tasks/0027_004_27004450_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_004_27004450_qa_2/environment/pull_bucket.py +++ b/tasks/0027_004_27004450_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_004_27004450_qa_2/task.toml b/tasks/0027_004_27004450_qa_2/task.toml index 8870e7dd2292bc1b5ba0f51d900a40e60f87216d..6537e9152f2d74aa02ecc2e0dae681ab4c395a8f 100644 --- a/tasks/0027_004_27004450_qa_2/task.toml +++ b/tasks/0027_004_27004450_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_089_27089896_qa_3/environment/bootstrap.sh b/tasks/0027_089_27089896_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_089_27089896_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_089_27089896_qa_3/environment/pull_bucket.py b/tasks/0027_089_27089896_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_089_27089896_qa_3/environment/pull_bucket.py +++ b/tasks/0027_089_27089896_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_089_27089896_qa_3/task.toml b/tasks/0027_089_27089896_qa_3/task.toml index 30a57c0a9d73b33baf8f4cad9813334c5c5481dc..3f03ba2a0835a2c51f5d97bd094131809599f1e1 100644 --- a/tasks/0027_089_27089896_qa_3/task.toml +++ b/tasks/0027_089_27089896_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_117_27117791_qa_2/environment/bootstrap.sh b/tasks/0027_117_27117791_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_117_27117791_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_117_27117791_qa_2/environment/pull_bucket.py b/tasks/0027_117_27117791_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_117_27117791_qa_2/environment/pull_bucket.py +++ b/tasks/0027_117_27117791_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_117_27117791_qa_2/task.toml b/tasks/0027_117_27117791_qa_2/task.toml index 605c548c45a174b766e84e205a229cfeedc0bab9..95d8de514ddf2ff1eedfd0527383e8c8a25d6aad 100644 --- a/tasks/0027_117_27117791_qa_2/task.toml +++ b/tasks/0027_117_27117791_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_151_27151900_qa_1/environment/bootstrap.sh b/tasks/0027_151_27151900_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_151_27151900_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_151_27151900_qa_1/environment/pull_bucket.py b/tasks/0027_151_27151900_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_151_27151900_qa_1/environment/pull_bucket.py +++ b/tasks/0027_151_27151900_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_151_27151900_qa_1/task.toml b/tasks/0027_151_27151900_qa_1/task.toml index b1597c90598743501da8d14e8fd2cd257ee01c2a..16481b6317d51625a7ff37ddf0ffe61d43a92ecd 100644 --- a/tasks/0027_151_27151900_qa_1/task.toml +++ b/tasks/0027_151_27151900_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_151_27151900_qa_5/environment/bootstrap.sh b/tasks/0027_151_27151900_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_151_27151900_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_151_27151900_qa_5/environment/pull_bucket.py b/tasks/0027_151_27151900_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_151_27151900_qa_5/environment/pull_bucket.py +++ b/tasks/0027_151_27151900_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_151_27151900_qa_5/task.toml b/tasks/0027_151_27151900_qa_5/task.toml index a243388c889234bcf3ea1df2285f9a2e40b30961..e562ec6d6033045668e7af705a50c155ba7dcd05 100644 --- a/tasks/0027_151_27151900_qa_5/task.toml +++ b/tasks/0027_151_27151900_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_179_27179583_qa_2/environment/bootstrap.sh b/tasks/0027_179_27179583_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_179_27179583_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_179_27179583_qa_2/environment/pull_bucket.py b/tasks/0027_179_27179583_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_179_27179583_qa_2/environment/pull_bucket.py +++ b/tasks/0027_179_27179583_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_179_27179583_qa_2/task.toml b/tasks/0027_179_27179583_qa_2/task.toml index 503008b263756b8e693e8f3bfd1a4324e94fa48d..bd53ac4ccdb223633c9ba75e1ba096300877383b 100644 --- a/tasks/0027_179_27179583_qa_2/task.toml +++ b/tasks/0027_179_27179583_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_179_27179583_qa_3/environment/bootstrap.sh b/tasks/0027_179_27179583_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_179_27179583_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_179_27179583_qa_3/environment/pull_bucket.py b/tasks/0027_179_27179583_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_179_27179583_qa_3/environment/pull_bucket.py +++ b/tasks/0027_179_27179583_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_179_27179583_qa_3/task.toml b/tasks/0027_179_27179583_qa_3/task.toml index be6dcd480dcfca268844eb501ae6278e393d68ea..b5454cedca83f486d0f55b550fa7ab66ae3ee8ac 100644 --- a/tasks/0027_179_27179583_qa_3/task.toml +++ b/tasks/0027_179_27179583_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_179_27179583_qa_4/environment/bootstrap.sh b/tasks/0027_179_27179583_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_179_27179583_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_179_27179583_qa_4/environment/pull_bucket.py b/tasks/0027_179_27179583_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_179_27179583_qa_4/environment/pull_bucket.py +++ b/tasks/0027_179_27179583_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_179_27179583_qa_4/task.toml b/tasks/0027_179_27179583_qa_4/task.toml index 682c2a42a7f0fd36bb5632f21200137f84c01442..af854ee4b9973fbac292984bf2689fdbe1a94efe 100644 --- a/tasks/0027_179_27179583_qa_4/task.toml +++ b/tasks/0027_179_27179583_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_223_27223315_qa_1/environment/bootstrap.sh b/tasks/0027_223_27223315_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_223_27223315_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_223_27223315_qa_1/environment/pull_bucket.py b/tasks/0027_223_27223315_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_223_27223315_qa_1/environment/pull_bucket.py +++ b/tasks/0027_223_27223315_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_223_27223315_qa_1/task.toml b/tasks/0027_223_27223315_qa_1/task.toml index 883d7a8d527c89510be7a6d0c453979c9e5ff8d2..cf3fce35175e3f05648a124d85f4588c036d95cd 100644 --- a/tasks/0027_223_27223315_qa_1/task.toml +++ b/tasks/0027_223_27223315_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_246_27246299_qa_4/environment/bootstrap.sh b/tasks/0027_246_27246299_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_246_27246299_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_246_27246299_qa_4/environment/pull_bucket.py b/tasks/0027_246_27246299_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_246_27246299_qa_4/environment/pull_bucket.py +++ b/tasks/0027_246_27246299_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_246_27246299_qa_4/task.toml b/tasks/0027_246_27246299_qa_4/task.toml index 3545a08651df25b6fa29dda223dc8bc9f569e944..e767f9efc2f7ecec5c12a5fbc7200d1229394def 100644 --- a/tasks/0027_246_27246299_qa_4/task.toml +++ b/tasks/0027_246_27246299_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_270_27270164_qa_2/environment/bootstrap.sh b/tasks/0027_270_27270164_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_270_27270164_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_270_27270164_qa_2/environment/pull_bucket.py b/tasks/0027_270_27270164_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_270_27270164_qa_2/environment/pull_bucket.py +++ b/tasks/0027_270_27270164_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_270_27270164_qa_2/task.toml b/tasks/0027_270_27270164_qa_2/task.toml index 3fe7fe70c9c2c92b73f32a838c2894f4fa27f756..45162988a14cb9aef6e838209108a082e29a1d57 100644 --- a/tasks/0027_270_27270164_qa_2/task.toml +++ b/tasks/0027_270_27270164_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_503_27503967_qa_5/environment/bootstrap.sh b/tasks/0027_503_27503967_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_503_27503967_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_503_27503967_qa_5/environment/pull_bucket.py b/tasks/0027_503_27503967_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_503_27503967_qa_5/environment/pull_bucket.py +++ b/tasks/0027_503_27503967_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_503_27503967_qa_5/task.toml b/tasks/0027_503_27503967_qa_5/task.toml index 1bd99ff0de05d821b84bbb5e7d36b7452846e71a..ea35f58730f897ac778f928527325909eb4597ca 100644 --- a/tasks/0027_503_27503967_qa_5/task.toml +++ b/tasks/0027_503_27503967_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_515_27515535_qa_5/environment/bootstrap.sh b/tasks/0027_515_27515535_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_515_27515535_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_515_27515535_qa_5/environment/pull_bucket.py b/tasks/0027_515_27515535_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_515_27515535_qa_5/environment/pull_bucket.py +++ b/tasks/0027_515_27515535_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_515_27515535_qa_5/task.toml b/tasks/0027_515_27515535_qa_5/task.toml index 6623c1556ee9dd31a8169f46d12ee8630f4fdd84..a42543c68969aaf6757ff199db49cbaa57a3689f 100644 --- a/tasks/0027_515_27515535_qa_5/task.toml +++ b/tasks/0027_515_27515535_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_583_27583327_qa_3/environment/bootstrap.sh b/tasks/0027_583_27583327_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_583_27583327_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_583_27583327_qa_3/environment/pull_bucket.py b/tasks/0027_583_27583327_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_583_27583327_qa_3/environment/pull_bucket.py +++ b/tasks/0027_583_27583327_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_583_27583327_qa_3/task.toml b/tasks/0027_583_27583327_qa_3/task.toml index 76fb2c9587f95ccb77493eed913ea54e2cb312cf..0ef741f839a092c0197179f981dc6a5fe55b0fad 100644 --- a/tasks/0027_583_27583327_qa_3/task.toml +++ b/tasks/0027_583_27583327_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_583_27583327_qa_4/environment/bootstrap.sh b/tasks/0027_583_27583327_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_583_27583327_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_583_27583327_qa_4/environment/pull_bucket.py b/tasks/0027_583_27583327_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_583_27583327_qa_4/environment/pull_bucket.py +++ b/tasks/0027_583_27583327_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_583_27583327_qa_4/task.toml b/tasks/0027_583_27583327_qa_4/task.toml index befcba8d44f3844b259d3438f468c71c3dbd859a..348cdc05c1f23bb292d4010e0a27befdcd15bbf1 100644 --- a/tasks/0027_583_27583327_qa_4/task.toml +++ b/tasks/0027_583_27583327_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_660_27660903_qa_2/environment/bootstrap.sh b/tasks/0027_660_27660903_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_660_27660903_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_660_27660903_qa_2/environment/pull_bucket.py b/tasks/0027_660_27660903_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_660_27660903_qa_2/environment/pull_bucket.py +++ b/tasks/0027_660_27660903_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_660_27660903_qa_2/task.toml b/tasks/0027_660_27660903_qa_2/task.toml index c2fde17c5e47f90e7245d69b0a8885cc960e86b3..d4a5329f0264c364a3f77bf22a3038b54f635108 100644 --- a/tasks/0027_660_27660903_qa_2/task.toml +++ b/tasks/0027_660_27660903_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_804_27804225_qa_2/environment/bootstrap.sh b/tasks/0027_804_27804225_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_804_27804225_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_804_27804225_qa_2/environment/pull_bucket.py b/tasks/0027_804_27804225_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_804_27804225_qa_2/environment/pull_bucket.py +++ b/tasks/0027_804_27804225_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_804_27804225_qa_2/task.toml b/tasks/0027_804_27804225_qa_2/task.toml index af5e538aab4f7c8bec5910a2374f7c7dbee11c48..c4a9a5a67d58691c127432067efb48a4819eb670 100644 --- a/tasks/0027_804_27804225_qa_2/task.toml +++ b/tasks/0027_804_27804225_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_893_27893972_qa_4/environment/bootstrap.sh b/tasks/0027_893_27893972_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_893_27893972_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_893_27893972_qa_4/environment/pull_bucket.py b/tasks/0027_893_27893972_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_893_27893972_qa_4/environment/pull_bucket.py +++ b/tasks/0027_893_27893972_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_893_27893972_qa_4/task.toml b/tasks/0027_893_27893972_qa_4/task.toml index 51465a48deb15c671a71241d8f31ad64e5b6515f..11ddf5cc376741b1cf17df309db5f5f9cb73405d 100644 --- a/tasks/0027_893_27893972_qa_4/task.toml +++ b/tasks/0027_893_27893972_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_986_27986516_qa_1/environment/bootstrap.sh b/tasks/0027_986_27986516_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_986_27986516_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_986_27986516_qa_1/environment/pull_bucket.py b/tasks/0027_986_27986516_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_986_27986516_qa_1/environment/pull_bucket.py +++ b/tasks/0027_986_27986516_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_986_27986516_qa_1/task.toml b/tasks/0027_986_27986516_qa_1/task.toml index 99e3cd48e34d3ec81f28c541625ee678e9975d24..4475900395d02133b4495ec39c90407a626a6a16 100644 --- a/tasks/0027_986_27986516_qa_1/task.toml +++ b/tasks/0027_986_27986516_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_992_27992214_qa_3/environment/bootstrap.sh b/tasks/0027_992_27992214_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_992_27992214_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_992_27992214_qa_3/environment/pull_bucket.py b/tasks/0027_992_27992214_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_992_27992214_qa_3/environment/pull_bucket.py +++ b/tasks/0027_992_27992214_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_992_27992214_qa_3/task.toml b/tasks/0027_992_27992214_qa_3/task.toml index 271ff4a4aaf9c9c01ce0163e8300f835e6ec5802..678092b82a86362daadb7860eb51b8cec2525278 100644 --- a/tasks/0027_992_27992214_qa_3/task.toml +++ b/tasks/0027_992_27992214_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0027_992_27992214_qa_5/environment/bootstrap.sh b/tasks/0027_992_27992214_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0027_992_27992214_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0027_992_27992214_qa_5/environment/pull_bucket.py b/tasks/0027_992_27992214_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0027_992_27992214_qa_5/environment/pull_bucket.py +++ b/tasks/0027_992_27992214_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0027_992_27992214_qa_5/task.toml b/tasks/0027_992_27992214_qa_5/task.toml index e6aecf6f01641439e91ee647abd3ac22a0d7f927..7dbecf3a5dc19fc90ad88b229dd8ffa76d70fa8f 100644 --- a/tasks/0027_992_27992214_qa_5/task.toml +++ b/tasks/0027_992_27992214_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_007_28007632_qa_1/environment/bootstrap.sh b/tasks/0028_007_28007632_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_007_28007632_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_007_28007632_qa_1/environment/pull_bucket.py b/tasks/0028_007_28007632_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_007_28007632_qa_1/environment/pull_bucket.py +++ b/tasks/0028_007_28007632_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_007_28007632_qa_1/task.toml b/tasks/0028_007_28007632_qa_1/task.toml index 9c319a472b725df032a8c38a67b6774b1f0c06eb..c3d46de410b5a39c39ae556249e58a70d68e07bf 100644 --- a/tasks/0028_007_28007632_qa_1/task.toml +++ b/tasks/0028_007_28007632_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_007_28007632_qa_3/environment/bootstrap.sh b/tasks/0028_007_28007632_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_007_28007632_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_007_28007632_qa_3/environment/pull_bucket.py b/tasks/0028_007_28007632_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_007_28007632_qa_3/environment/pull_bucket.py +++ b/tasks/0028_007_28007632_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_007_28007632_qa_3/task.toml b/tasks/0028_007_28007632_qa_3/task.toml index fbce64bdce9c99ed4b72e0820fc0b060da06fc6f..472285144ce183627d35ae1892bd12b3b975c04c 100644 --- a/tasks/0028_007_28007632_qa_3/task.toml +++ b/tasks/0028_007_28007632_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_007_28007632_qa_4/environment/bootstrap.sh b/tasks/0028_007_28007632_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_007_28007632_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_007_28007632_qa_4/environment/pull_bucket.py b/tasks/0028_007_28007632_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_007_28007632_qa_4/environment/pull_bucket.py +++ b/tasks/0028_007_28007632_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_007_28007632_qa_4/task.toml b/tasks/0028_007_28007632_qa_4/task.toml index 6f4684677ba444004b0b4a1ba7a7e82520538bbf..2365ca8d73e87cb09c0c8c4aa1ab85f750e98302 100644 --- a/tasks/0028_007_28007632_qa_4/task.toml +++ b/tasks/0028_007_28007632_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_054_28054736_qa_2/environment/bootstrap.sh b/tasks/0028_054_28054736_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_054_28054736_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_054_28054736_qa_2/environment/pull_bucket.py b/tasks/0028_054_28054736_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_054_28054736_qa_2/environment/pull_bucket.py +++ b/tasks/0028_054_28054736_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_054_28054736_qa_2/task.toml b/tasks/0028_054_28054736_qa_2/task.toml index b6407605d08d755e221cc4195427ab6f103aa22c..cb52b5de4cfb14af3010211533f703acca94d45d 100644 --- a/tasks/0028_054_28054736_qa_2/task.toml +++ b/tasks/0028_054_28054736_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_150_28150461_qa_1/environment/bootstrap.sh b/tasks/0028_150_28150461_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_150_28150461_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_150_28150461_qa_1/environment/pull_bucket.py b/tasks/0028_150_28150461_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_150_28150461_qa_1/environment/pull_bucket.py +++ b/tasks/0028_150_28150461_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_150_28150461_qa_1/task.toml b/tasks/0028_150_28150461_qa_1/task.toml index 89fb51e00be4d73fff17e12c427892a0e8986859..9f7796f022a06a9470e3d9f89b4e58e5e85b1009 100644 --- a/tasks/0028_150_28150461_qa_1/task.toml +++ b/tasks/0028_150_28150461_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_150_28150461_qa_3/environment/bootstrap.sh b/tasks/0028_150_28150461_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_150_28150461_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_150_28150461_qa_3/environment/pull_bucket.py b/tasks/0028_150_28150461_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_150_28150461_qa_3/environment/pull_bucket.py +++ b/tasks/0028_150_28150461_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_150_28150461_qa_3/task.toml b/tasks/0028_150_28150461_qa_3/task.toml index f985b4de20e1602ca7983dc202f4d2101ac6cd83..1f7f94b116a6c9be954d413c8ea542965999377a 100644 --- a/tasks/0028_150_28150461_qa_3/task.toml +++ b/tasks/0028_150_28150461_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_150_28150461_qa_4/environment/bootstrap.sh b/tasks/0028_150_28150461_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_150_28150461_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_150_28150461_qa_4/environment/pull_bucket.py b/tasks/0028_150_28150461_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_150_28150461_qa_4/environment/pull_bucket.py +++ b/tasks/0028_150_28150461_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_150_28150461_qa_4/task.toml b/tasks/0028_150_28150461_qa_4/task.toml index 9f5e77347bbdd8622974241f956e7aaf335b7d70..17ac800172091c67fd514195b3ac579d6e54e290 100644 --- a/tasks/0028_150_28150461_qa_4/task.toml +++ b/tasks/0028_150_28150461_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_183_28183894_qa_1/environment/bootstrap.sh b/tasks/0028_183_28183894_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_183_28183894_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_183_28183894_qa_1/environment/pull_bucket.py b/tasks/0028_183_28183894_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_183_28183894_qa_1/environment/pull_bucket.py +++ b/tasks/0028_183_28183894_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_183_28183894_qa_1/task.toml b/tasks/0028_183_28183894_qa_1/task.toml index ccb68ff862729be4bed25e4c5690e67e6b47990c..8fc6992e64cc71b665f8f84827b1cc226f2c6b9b 100644 --- a/tasks/0028_183_28183894_qa_1/task.toml +++ b/tasks/0028_183_28183894_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_198_28198239_qa_1/environment/bootstrap.sh b/tasks/0028_198_28198239_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_198_28198239_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_198_28198239_qa_1/environment/pull_bucket.py b/tasks/0028_198_28198239_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_198_28198239_qa_1/environment/pull_bucket.py +++ b/tasks/0028_198_28198239_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_198_28198239_qa_1/task.toml b/tasks/0028_198_28198239_qa_1/task.toml index 7a6befa99db83e82754ca320b8c77763a3b86445..4b7518ec223c7838c7990ebf7ce754cab03aaf72 100644 --- a/tasks/0028_198_28198239_qa_1/task.toml +++ b/tasks/0028_198_28198239_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_198_28198239_qa_3/environment/bootstrap.sh b/tasks/0028_198_28198239_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_198_28198239_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_198_28198239_qa_3/environment/pull_bucket.py b/tasks/0028_198_28198239_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_198_28198239_qa_3/environment/pull_bucket.py +++ b/tasks/0028_198_28198239_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_198_28198239_qa_3/task.toml b/tasks/0028_198_28198239_qa_3/task.toml index 2d3325b4142860519b2662695b399adf3960ce78..da06aee82d391d634fc8e6eb5468b4e1156c934e 100644 --- a/tasks/0028_198_28198239_qa_3/task.toml +++ b/tasks/0028_198_28198239_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_299_28299086_qa_3/environment/bootstrap.sh b/tasks/0028_299_28299086_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_299_28299086_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_299_28299086_qa_3/environment/pull_bucket.py b/tasks/0028_299_28299086_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_299_28299086_qa_3/environment/pull_bucket.py +++ b/tasks/0028_299_28299086_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_299_28299086_qa_3/task.toml b/tasks/0028_299_28299086_qa_3/task.toml index 71eabbbfff78b732b22e9f0ec078f477ebcb68d3..184dbbb0cfb93096594d7a08af4be4e3b2aea552 100644 --- a/tasks/0028_299_28299086_qa_3/task.toml +++ b/tasks/0028_299_28299086_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_299_28299086_qa_4/environment/bootstrap.sh b/tasks/0028_299_28299086_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_299_28299086_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_299_28299086_qa_4/environment/pull_bucket.py b/tasks/0028_299_28299086_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_299_28299086_qa_4/environment/pull_bucket.py +++ b/tasks/0028_299_28299086_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_299_28299086_qa_4/task.toml b/tasks/0028_299_28299086_qa_4/task.toml index 3d3a26b80ce723d8826573ae39bbeca45dad8a0c..43d75f8a4e2e503cda18e7d3693482b2d7ba7601 100644 --- a/tasks/0028_299_28299086_qa_4/task.toml +++ b/tasks/0028_299_28299086_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_443_28443310_qa_4/environment/bootstrap.sh b/tasks/0028_443_28443310_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_443_28443310_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_443_28443310_qa_4/environment/pull_bucket.py b/tasks/0028_443_28443310_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_443_28443310_qa_4/environment/pull_bucket.py +++ b/tasks/0028_443_28443310_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_443_28443310_qa_4/task.toml b/tasks/0028_443_28443310_qa_4/task.toml index a83c7f02314dc8bf8c0f352960e5b4a1aa0ebaae..b72ca1d27eb435ec1b46b3e78e8554a0c66eb041 100644 --- a/tasks/0028_443_28443310_qa_4/task.toml +++ b/tasks/0028_443_28443310_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_443_28443310_qa_5/environment/bootstrap.sh b/tasks/0028_443_28443310_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_443_28443310_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_443_28443310_qa_5/environment/pull_bucket.py b/tasks/0028_443_28443310_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_443_28443310_qa_5/environment/pull_bucket.py +++ b/tasks/0028_443_28443310_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_443_28443310_qa_5/task.toml b/tasks/0028_443_28443310_qa_5/task.toml index 41887322d6354f75d5e7c9db5144e33e25ce9b75..17b82f6b77bfda9c6035c18e49ca31ae0e18a176 100644 --- a/tasks/0028_443_28443310_qa_5/task.toml +++ b/tasks/0028_443_28443310_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_488_28488702_qa_1/environment/bootstrap.sh b/tasks/0028_488_28488702_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_488_28488702_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_488_28488702_qa_1/environment/pull_bucket.py b/tasks/0028_488_28488702_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_488_28488702_qa_1/environment/pull_bucket.py +++ b/tasks/0028_488_28488702_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_488_28488702_qa_1/task.toml b/tasks/0028_488_28488702_qa_1/task.toml index 4980e3ecbd196654533ec5fa3cb81e3afa39bfcd..791f538907c69e992cb02618f6916e0a5c5838f7 100644 --- a/tasks/0028_488_28488702_qa_1/task.toml +++ b/tasks/0028_488_28488702_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_492_28492741_qa_1/environment/bootstrap.sh b/tasks/0028_492_28492741_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_492_28492741_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_492_28492741_qa_1/environment/pull_bucket.py b/tasks/0028_492_28492741_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_492_28492741_qa_1/environment/pull_bucket.py +++ b/tasks/0028_492_28492741_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_492_28492741_qa_1/task.toml b/tasks/0028_492_28492741_qa_1/task.toml index c8864281e8883829ad8adfd58751d9bd06708799..93b90e4bb44c50911cc3239e38864271742c4925 100644 --- a/tasks/0028_492_28492741_qa_1/task.toml +++ b/tasks/0028_492_28492741_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_492_28492741_qa_5/environment/bootstrap.sh b/tasks/0028_492_28492741_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_492_28492741_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_492_28492741_qa_5/environment/pull_bucket.py b/tasks/0028_492_28492741_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_492_28492741_qa_5/environment/pull_bucket.py +++ b/tasks/0028_492_28492741_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_492_28492741_qa_5/task.toml b/tasks/0028_492_28492741_qa_5/task.toml index 64623341e5f0802ccb659d152916075bf664204b..bf3005e0fb717f80d67da0f81b23dfaa9c500a2e 100644 --- a/tasks/0028_492_28492741_qa_5/task.toml +++ b/tasks/0028_492_28492741_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_513_28513384_qa_1/environment/bootstrap.sh b/tasks/0028_513_28513384_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_513_28513384_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_513_28513384_qa_1/environment/pull_bucket.py b/tasks/0028_513_28513384_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_513_28513384_qa_1/environment/pull_bucket.py +++ b/tasks/0028_513_28513384_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_513_28513384_qa_1/task.toml b/tasks/0028_513_28513384_qa_1/task.toml index e8bb024918d5721c3ae402a5b1677b2473163abb..d3a75bd8d26a25024a8dc444954a0c5f3ba6a9ce 100644 --- a/tasks/0028_513_28513384_qa_1/task.toml +++ b/tasks/0028_513_28513384_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_513_28513384_qa_3/environment/bootstrap.sh b/tasks/0028_513_28513384_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_513_28513384_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_513_28513384_qa_3/environment/pull_bucket.py b/tasks/0028_513_28513384_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_513_28513384_qa_3/environment/pull_bucket.py +++ b/tasks/0028_513_28513384_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_513_28513384_qa_3/task.toml b/tasks/0028_513_28513384_qa_3/task.toml index 7471840e482a50f5ed0d81eecc2b24d0b2accac2..9570899e0487e6baa019b9b170fb7dc51d23afbe 100644 --- a/tasks/0028_513_28513384_qa_3/task.toml +++ b/tasks/0028_513_28513384_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_513_28513384_qa_4/environment/bootstrap.sh b/tasks/0028_513_28513384_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_513_28513384_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_513_28513384_qa_4/environment/pull_bucket.py b/tasks/0028_513_28513384_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_513_28513384_qa_4/environment/pull_bucket.py +++ b/tasks/0028_513_28513384_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_513_28513384_qa_4/task.toml b/tasks/0028_513_28513384_qa_4/task.toml index 30f1c3298181adfda0049968d13532157acf3148..18e67846e438742a42ca56709ef568b5c1ce7033 100644 --- a/tasks/0028_513_28513384_qa_4/task.toml +++ b/tasks/0028_513_28513384_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_521_28521768_qa_3/environment/bootstrap.sh b/tasks/0028_521_28521768_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_521_28521768_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_521_28521768_qa_3/environment/pull_bucket.py b/tasks/0028_521_28521768_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_521_28521768_qa_3/environment/pull_bucket.py +++ b/tasks/0028_521_28521768_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_521_28521768_qa_3/task.toml b/tasks/0028_521_28521768_qa_3/task.toml index 7ca5407446a378bed4be83a14e8bcb6c17e97b09..b0d28e40d67297a3804b9aa580872e76fcea159e 100644 --- a/tasks/0028_521_28521768_qa_3/task.toml +++ b/tasks/0028_521_28521768_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_571_28571042_qa_1/environment/bootstrap.sh b/tasks/0028_571_28571042_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_571_28571042_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_571_28571042_qa_1/environment/pull_bucket.py b/tasks/0028_571_28571042_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_571_28571042_qa_1/environment/pull_bucket.py +++ b/tasks/0028_571_28571042_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_571_28571042_qa_1/task.toml b/tasks/0028_571_28571042_qa_1/task.toml index fbde914f0db9f2444a3c35a67006227717d2fd17..c7c11f64cddcc09f47fb837abe312e9d0152fafa 100644 --- a/tasks/0028_571_28571042_qa_1/task.toml +++ b/tasks/0028_571_28571042_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_571_28571042_qa_4/environment/bootstrap.sh b/tasks/0028_571_28571042_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_571_28571042_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_571_28571042_qa_4/environment/pull_bucket.py b/tasks/0028_571_28571042_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_571_28571042_qa_4/environment/pull_bucket.py +++ b/tasks/0028_571_28571042_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_571_28571042_qa_4/task.toml b/tasks/0028_571_28571042_qa_4/task.toml index 19593747fb488b62068e212c28a8368b3f4debd8..16953cde4c44cc02315d3dfe88643a51f81cf493 100644 --- a/tasks/0028_571_28571042_qa_4/task.toml +++ b/tasks/0028_571_28571042_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_586_28586559_qa_4/environment/bootstrap.sh b/tasks/0028_586_28586559_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_586_28586559_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_586_28586559_qa_4/environment/pull_bucket.py b/tasks/0028_586_28586559_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_586_28586559_qa_4/environment/pull_bucket.py +++ b/tasks/0028_586_28586559_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_586_28586559_qa_4/task.toml b/tasks/0028_586_28586559_qa_4/task.toml index 68818f7b57f9989ae042446d0b920a12bfa14adc..7daa6e8f29f784dea698c195c5ccc24b8ff7eb86 100644 --- a/tasks/0028_586_28586559_qa_4/task.toml +++ b/tasks/0028_586_28586559_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_601_28601781_qa_4/environment/bootstrap.sh b/tasks/0028_601_28601781_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_601_28601781_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_601_28601781_qa_4/environment/pull_bucket.py b/tasks/0028_601_28601781_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_601_28601781_qa_4/environment/pull_bucket.py +++ b/tasks/0028_601_28601781_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_601_28601781_qa_4/task.toml b/tasks/0028_601_28601781_qa_4/task.toml index a2b793c978257b3f8be40840248065f9c61870d0..78ddd3397cb76dec4cb0480b75bbb26c8f54f85c 100644 --- a/tasks/0028_601_28601781_qa_4/task.toml +++ b/tasks/0028_601_28601781_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_685_28685202_qa_1/environment/bootstrap.sh b/tasks/0028_685_28685202_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_685_28685202_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_685_28685202_qa_1/environment/pull_bucket.py b/tasks/0028_685_28685202_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_685_28685202_qa_1/environment/pull_bucket.py +++ b/tasks/0028_685_28685202_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_685_28685202_qa_1/task.toml b/tasks/0028_685_28685202_qa_1/task.toml index e7d4da1e91024f34957a9ba9b48b6b2be88062b0..603a1451c18deaf9419f4607eab098fcd0ea56a0 100644 --- a/tasks/0028_685_28685202_qa_1/task.toml +++ b/tasks/0028_685_28685202_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_862_28862512_qa_4/environment/bootstrap.sh b/tasks/0028_862_28862512_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_862_28862512_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_862_28862512_qa_4/environment/pull_bucket.py b/tasks/0028_862_28862512_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_862_28862512_qa_4/environment/pull_bucket.py +++ b/tasks/0028_862_28862512_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_862_28862512_qa_4/task.toml b/tasks/0028_862_28862512_qa_4/task.toml index 9d40a68f2ea691a84e7c571262c28536205a9bfc..ed30a66d6164643755ec3eb2062858d5cace6432 100644 --- a/tasks/0028_862_28862512_qa_4/task.toml +++ b/tasks/0028_862_28862512_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_913_28913339_qa_4/environment/bootstrap.sh b/tasks/0028_913_28913339_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_913_28913339_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_913_28913339_qa_4/environment/pull_bucket.py b/tasks/0028_913_28913339_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_913_28913339_qa_4/environment/pull_bucket.py +++ b/tasks/0028_913_28913339_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_913_28913339_qa_4/task.toml b/tasks/0028_913_28913339_qa_4/task.toml index d16902f214d3a54e68aa4216d8153cdc7b745617..7dda4768d3e202f7a0e6983ab8956e7b48bb529b 100644 --- a/tasks/0028_913_28913339_qa_4/task.toml +++ b/tasks/0028_913_28913339_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_913_28913339_qa_5/environment/bootstrap.sh b/tasks/0028_913_28913339_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_913_28913339_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_913_28913339_qa_5/environment/pull_bucket.py b/tasks/0028_913_28913339_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_913_28913339_qa_5/environment/pull_bucket.py +++ b/tasks/0028_913_28913339_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_913_28913339_qa_5/task.toml b/tasks/0028_913_28913339_qa_5/task.toml index 1a6020b607e61a00f7c8b9fc408c1bc0303d5f95..65614097db8da7921b78d8c3beef297a6b8f90d6 100644 --- a/tasks/0028_913_28913339_qa_5/task.toml +++ b/tasks/0028_913_28913339_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_934_28934534_qa_4/environment/bootstrap.sh b/tasks/0028_934_28934534_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_934_28934534_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_934_28934534_qa_4/environment/pull_bucket.py b/tasks/0028_934_28934534_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_934_28934534_qa_4/environment/pull_bucket.py +++ b/tasks/0028_934_28934534_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_934_28934534_qa_4/task.toml b/tasks/0028_934_28934534_qa_4/task.toml index e034772a3f710215b5fd63321413884db5f71c3a..ba36bc54f359016aa77bc47a2b29e6415f23c172 100644 --- a/tasks/0028_934_28934534_qa_4/task.toml +++ b/tasks/0028_934_28934534_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0028_938_28938151_qa_5/environment/bootstrap.sh b/tasks/0028_938_28938151_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0028_938_28938151_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0028_938_28938151_qa_5/environment/pull_bucket.py b/tasks/0028_938_28938151_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0028_938_28938151_qa_5/environment/pull_bucket.py +++ b/tasks/0028_938_28938151_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0028_938_28938151_qa_5/task.toml b/tasks/0028_938_28938151_qa_5/task.toml index cd26e5fcc56d0f529301864e222edbac9d8a567b..3ef355565290512261fadb9cea052f49be26e48b 100644 --- a/tasks/0028_938_28938151_qa_5/task.toml +++ b/tasks/0028_938_28938151_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_108_29108182_qa_1/environment/bootstrap.sh b/tasks/0029_108_29108182_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_108_29108182_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_108_29108182_qa_1/environment/pull_bucket.py b/tasks/0029_108_29108182_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_108_29108182_qa_1/environment/pull_bucket.py +++ b/tasks/0029_108_29108182_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_108_29108182_qa_1/task.toml b/tasks/0029_108_29108182_qa_1/task.toml index 3232a118fbed47df885419b6cbff69a044d6c27d..10435bdc6d36393fdb943d9e1bc585917c1646d0 100644 --- a/tasks/0029_108_29108182_qa_1/task.toml +++ b/tasks/0029_108_29108182_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_136_29136731_qa_2/environment/bootstrap.sh b/tasks/0029_136_29136731_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_136_29136731_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_136_29136731_qa_2/environment/pull_bucket.py b/tasks/0029_136_29136731_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_136_29136731_qa_2/environment/pull_bucket.py +++ b/tasks/0029_136_29136731_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_136_29136731_qa_2/task.toml b/tasks/0029_136_29136731_qa_2/task.toml index a8437e17819e08becac61c1197c8fe4ed7651a9b..dd3d0be5e413c69ca8b0b79bd6b5a94043a08288 100644 --- a/tasks/0029_136_29136731_qa_2/task.toml +++ b/tasks/0029_136_29136731_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_184_29184728_qa_1/environment/bootstrap.sh b/tasks/0029_184_29184728_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_184_29184728_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_184_29184728_qa_1/environment/pull_bucket.py b/tasks/0029_184_29184728_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_184_29184728_qa_1/environment/pull_bucket.py +++ b/tasks/0029_184_29184728_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_184_29184728_qa_1/task.toml b/tasks/0029_184_29184728_qa_1/task.toml index ddb0badfcce2407ec2abd852dd9e267d6bb6d400..b44e8b90d1b7d006f08870ebd43500ba594145d4 100644 --- a/tasks/0029_184_29184728_qa_1/task.toml +++ b/tasks/0029_184_29184728_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_200_29200364_qa_1/environment/bootstrap.sh b/tasks/0029_200_29200364_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_200_29200364_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_200_29200364_qa_1/environment/pull_bucket.py b/tasks/0029_200_29200364_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_200_29200364_qa_1/environment/pull_bucket.py +++ b/tasks/0029_200_29200364_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_200_29200364_qa_1/task.toml b/tasks/0029_200_29200364_qa_1/task.toml index 1c0a929b00b9bbf29200add24cd25c91f809f75b..f74189a0d7e681c434ef0e19645f6a33d03d2375 100644 --- a/tasks/0029_200_29200364_qa_1/task.toml +++ b/tasks/0029_200_29200364_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_200_29200364_qa_2/environment/bootstrap.sh b/tasks/0029_200_29200364_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_200_29200364_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_200_29200364_qa_2/environment/pull_bucket.py b/tasks/0029_200_29200364_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_200_29200364_qa_2/environment/pull_bucket.py +++ b/tasks/0029_200_29200364_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_200_29200364_qa_2/task.toml b/tasks/0029_200_29200364_qa_2/task.toml index 5ea00139ded3778dc79370cd64654580cf63ef25..313cccfa217403752dde8b5cd0467b55005601b2 100644 --- a/tasks/0029_200_29200364_qa_2/task.toml +++ b/tasks/0029_200_29200364_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_200_29200364_qa_3/environment/bootstrap.sh b/tasks/0029_200_29200364_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_200_29200364_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_200_29200364_qa_3/environment/pull_bucket.py b/tasks/0029_200_29200364_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_200_29200364_qa_3/environment/pull_bucket.py +++ b/tasks/0029_200_29200364_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_200_29200364_qa_3/task.toml b/tasks/0029_200_29200364_qa_3/task.toml index 2e60a53ed9f208e44ad593de782b683cf900ba2d..e355c03177da0f15f01a2ed80f06ddf2b76279a1 100644 --- a/tasks/0029_200_29200364_qa_3/task.toml +++ b/tasks/0029_200_29200364_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_204_29204719_qa_1/environment/bootstrap.sh b/tasks/0029_204_29204719_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_204_29204719_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_204_29204719_qa_1/environment/pull_bucket.py b/tasks/0029_204_29204719_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_204_29204719_qa_1/environment/pull_bucket.py +++ b/tasks/0029_204_29204719_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_204_29204719_qa_1/task.toml b/tasks/0029_204_29204719_qa_1/task.toml index bbac5a2135ee2146a7985a638dbec27751ffcb9b..50e48d298494a452f01f4155b5b04958414c1cd6 100644 --- a/tasks/0029_204_29204719_qa_1/task.toml +++ b/tasks/0029_204_29204719_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_204_29204719_qa_2/environment/bootstrap.sh b/tasks/0029_204_29204719_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_204_29204719_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_204_29204719_qa_2/environment/pull_bucket.py b/tasks/0029_204_29204719_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_204_29204719_qa_2/environment/pull_bucket.py +++ b/tasks/0029_204_29204719_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_204_29204719_qa_2/task.toml b/tasks/0029_204_29204719_qa_2/task.toml index e5be28496c4124ab7db9be0803c2c64843a7bb30..6319d463d1e97787b82d879c13ec7921b9375b9a 100644 --- a/tasks/0029_204_29204719_qa_2/task.toml +++ b/tasks/0029_204_29204719_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_212_29212385_qa_2/environment/bootstrap.sh b/tasks/0029_212_29212385_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_212_29212385_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_212_29212385_qa_2/environment/pull_bucket.py b/tasks/0029_212_29212385_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_212_29212385_qa_2/environment/pull_bucket.py +++ b/tasks/0029_212_29212385_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_212_29212385_qa_2/task.toml b/tasks/0029_212_29212385_qa_2/task.toml index a4ee320674a2b80549f2c9266b5bbb76b6791584..f79b832869a4e459bed29c57bbb5166acfec8c22 100644 --- a/tasks/0029_212_29212385_qa_2/task.toml +++ b/tasks/0029_212_29212385_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_212_29212385_qa_5/environment/bootstrap.sh b/tasks/0029_212_29212385_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_212_29212385_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_212_29212385_qa_5/environment/pull_bucket.py b/tasks/0029_212_29212385_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_212_29212385_qa_5/environment/pull_bucket.py +++ b/tasks/0029_212_29212385_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_212_29212385_qa_5/task.toml b/tasks/0029_212_29212385_qa_5/task.toml index 4926d30f82a8b81215494906464d4f03c920cbca..88d839f85264755bb07237bad69265a14ce97c39 100644 --- a/tasks/0029_212_29212385_qa_5/task.toml +++ b/tasks/0029_212_29212385_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_245_29245024_qa_1/environment/bootstrap.sh b/tasks/0029_245_29245024_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_245_29245024_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_245_29245024_qa_1/environment/pull_bucket.py b/tasks/0029_245_29245024_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_245_29245024_qa_1/environment/pull_bucket.py +++ b/tasks/0029_245_29245024_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_245_29245024_qa_1/task.toml b/tasks/0029_245_29245024_qa_1/task.toml index af973e6cfae6c6a94bbfc73ccf9e46a112488d51..0aa953decab803251750e4208d3e2ba158412e44 100644 --- a/tasks/0029_245_29245024_qa_1/task.toml +++ b/tasks/0029_245_29245024_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_340_29340222_qa_5/environment/bootstrap.sh b/tasks/0029_340_29340222_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_340_29340222_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_340_29340222_qa_5/environment/pull_bucket.py b/tasks/0029_340_29340222_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_340_29340222_qa_5/environment/pull_bucket.py +++ b/tasks/0029_340_29340222_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_340_29340222_qa_5/task.toml b/tasks/0029_340_29340222_qa_5/task.toml index 20c3719f802a57086a7192301c7f1f46560587ac..a70068e095ad7df103ea8edf2133c2669ea9395c 100644 --- a/tasks/0029_340_29340222_qa_5/task.toml +++ b/tasks/0029_340_29340222_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_411_29411994_qa_3/environment/bootstrap.sh b/tasks/0029_411_29411994_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_411_29411994_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_411_29411994_qa_3/environment/pull_bucket.py b/tasks/0029_411_29411994_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_411_29411994_qa_3/environment/pull_bucket.py +++ b/tasks/0029_411_29411994_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_411_29411994_qa_3/task.toml b/tasks/0029_411_29411994_qa_3/task.toml index 64cd53d3d53ee83d134330c54563bc37cc750b95..654827fce08a37fab716a0542841792eb53fd467 100644 --- a/tasks/0029_411_29411994_qa_3/task.toml +++ b/tasks/0029_411_29411994_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_448_29448999_qa_3/environment/bootstrap.sh b/tasks/0029_448_29448999_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_448_29448999_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_448_29448999_qa_3/environment/pull_bucket.py b/tasks/0029_448_29448999_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_448_29448999_qa_3/environment/pull_bucket.py +++ b/tasks/0029_448_29448999_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_448_29448999_qa_3/task.toml b/tasks/0029_448_29448999_qa_3/task.toml index d8164f2e9765dcdeeaa83aa8246234cdd2f8296b..b069ee57fcf98358e3d4e8617be8557a8fbce56a 100644 --- a/tasks/0029_448_29448999_qa_3/task.toml +++ b/tasks/0029_448_29448999_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_448_29448999_qa_5/environment/bootstrap.sh b/tasks/0029_448_29448999_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_448_29448999_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_448_29448999_qa_5/environment/pull_bucket.py b/tasks/0029_448_29448999_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_448_29448999_qa_5/environment/pull_bucket.py +++ b/tasks/0029_448_29448999_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_448_29448999_qa_5/task.toml b/tasks/0029_448_29448999_qa_5/task.toml index 295cc29aadcf2d140b1b92e751c4dfc77c13e316..7a9c1866897cc0e6a28b59c894c44f9c389e8c1d 100644 --- a/tasks/0029_448_29448999_qa_5/task.toml +++ b/tasks/0029_448_29448999_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_449_29449296_qa_3/environment/bootstrap.sh b/tasks/0029_449_29449296_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_449_29449296_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_449_29449296_qa_3/environment/pull_bucket.py b/tasks/0029_449_29449296_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_449_29449296_qa_3/environment/pull_bucket.py +++ b/tasks/0029_449_29449296_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_449_29449296_qa_3/task.toml b/tasks/0029_449_29449296_qa_3/task.toml index 1877c87ba5b60aed912867a7af0b4aabe9bec453..383d1e630ee5e6b486d7443224c83699ae03422f 100644 --- a/tasks/0029_449_29449296_qa_3/task.toml +++ b/tasks/0029_449_29449296_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_467_29467495_qa_2/environment/bootstrap.sh b/tasks/0029_467_29467495_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_467_29467495_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_467_29467495_qa_2/environment/pull_bucket.py b/tasks/0029_467_29467495_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_467_29467495_qa_2/environment/pull_bucket.py +++ b/tasks/0029_467_29467495_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_467_29467495_qa_2/task.toml b/tasks/0029_467_29467495_qa_2/task.toml index 4b1212f3a681c9269431bc135e3b051fb9b00ba2..b95446aedc93dd7221ead76a0ce50f1f4ece7960 100644 --- a/tasks/0029_467_29467495_qa_2/task.toml +++ b/tasks/0029_467_29467495_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_536_29536756_qa_3/environment/bootstrap.sh b/tasks/0029_536_29536756_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_536_29536756_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_536_29536756_qa_3/environment/pull_bucket.py b/tasks/0029_536_29536756_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_536_29536756_qa_3/environment/pull_bucket.py +++ b/tasks/0029_536_29536756_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_536_29536756_qa_3/task.toml b/tasks/0029_536_29536756_qa_3/task.toml index df095117db79857e3d355e50cd2f2cf5a58443ec..ac81ff13d0b5b5ccc3c8b3f4e64e2bbbe1953c6e 100644 --- a/tasks/0029_536_29536756_qa_3/task.toml +++ b/tasks/0029_536_29536756_qa_3/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_558_29558970_qa_2/environment/bootstrap.sh b/tasks/0029_558_29558970_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_558_29558970_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_558_29558970_qa_2/environment/pull_bucket.py b/tasks/0029_558_29558970_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_558_29558970_qa_2/environment/pull_bucket.py +++ b/tasks/0029_558_29558970_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_558_29558970_qa_2/task.toml b/tasks/0029_558_29558970_qa_2/task.toml index c5a2da79c3f8648f7fcd33564154f443a0f8e2b9..333d305acdd3ecfae56be38e6c7b12b9dfad6b18 100644 --- a/tasks/0029_558_29558970_qa_2/task.toml +++ b/tasks/0029_558_29558970_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_630_29630344_qa_4/environment/bootstrap.sh b/tasks/0029_630_29630344_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_630_29630344_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_630_29630344_qa_4/environment/pull_bucket.py b/tasks/0029_630_29630344_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_630_29630344_qa_4/environment/pull_bucket.py +++ b/tasks/0029_630_29630344_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_630_29630344_qa_4/task.toml b/tasks/0029_630_29630344_qa_4/task.toml index f01daef3125490fc0443bebf861a697fa4921fdb..210f497d6a44ac8cfa6f179a0ba0b6074de090ae 100644 --- a/tasks/0029_630_29630344_qa_4/task.toml +++ b/tasks/0029_630_29630344_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_630_29630344_qa_5/environment/bootstrap.sh b/tasks/0029_630_29630344_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_630_29630344_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_630_29630344_qa_5/environment/pull_bucket.py b/tasks/0029_630_29630344_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_630_29630344_qa_5/environment/pull_bucket.py +++ b/tasks/0029_630_29630344_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_630_29630344_qa_5/task.toml b/tasks/0029_630_29630344_qa_5/task.toml index c83a5a66957902c2d5edddc865e7af4f0118408e..4c32c8a2a358cf41f0518b0bf6f620d7b33c3980 100644 --- a/tasks/0029_630_29630344_qa_5/task.toml +++ b/tasks/0029_630_29630344_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_650_29650445_qa_3/environment/bootstrap.sh b/tasks/0029_650_29650445_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_650_29650445_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_650_29650445_qa_3/environment/pull_bucket.py b/tasks/0029_650_29650445_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_650_29650445_qa_3/environment/pull_bucket.py +++ b/tasks/0029_650_29650445_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_650_29650445_qa_3/task.toml b/tasks/0029_650_29650445_qa_3/task.toml index 3485ce2440fb9e037733ee90c55a6e216cc01e5d..160b89416fd26c5b13d48f0b782f4deaff3d7b61 100644 --- a/tasks/0029_650_29650445_qa_3/task.toml +++ b/tasks/0029_650_29650445_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_784_29784165_qa_1/environment/bootstrap.sh b/tasks/0029_784_29784165_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_784_29784165_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_784_29784165_qa_1/environment/pull_bucket.py b/tasks/0029_784_29784165_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_784_29784165_qa_1/environment/pull_bucket.py +++ b/tasks/0029_784_29784165_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_784_29784165_qa_1/task.toml b/tasks/0029_784_29784165_qa_1/task.toml index f9ff0b3691df3dde5fe659c3ac102b4f6eb13e90..12b95de79c3cc7e4ce1c7fdbf54f844a0c0c2919 100644 --- a/tasks/0029_784_29784165_qa_1/task.toml +++ b/tasks/0029_784_29784165_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_902_29902659_qa_3/environment/bootstrap.sh b/tasks/0029_902_29902659_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_902_29902659_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_902_29902659_qa_3/environment/pull_bucket.py b/tasks/0029_902_29902659_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_902_29902659_qa_3/environment/pull_bucket.py +++ b/tasks/0029_902_29902659_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_902_29902659_qa_3/task.toml b/tasks/0029_902_29902659_qa_3/task.toml index 3625a66b912a97022149fb2159a9a29f7bbd3b19..ea6ccf5b7e4a1cc536adfca12d7831aa692f00df 100644 --- a/tasks/0029_902_29902659_qa_3/task.toml +++ b/tasks/0029_902_29902659_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_908_29908654_qa_2/environment/bootstrap.sh b/tasks/0029_908_29908654_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_908_29908654_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_908_29908654_qa_2/environment/pull_bucket.py b/tasks/0029_908_29908654_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_908_29908654_qa_2/environment/pull_bucket.py +++ b/tasks/0029_908_29908654_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_908_29908654_qa_2/task.toml b/tasks/0029_908_29908654_qa_2/task.toml index 4cd509975ffd95033850debefba86ecae3acd5dd..e3f4a1f74da7ca28935291d278ffaae6cc932e1a 100644 --- a/tasks/0029_908_29908654_qa_2/task.toml +++ b/tasks/0029_908_29908654_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0029_908_29908654_qa_4/environment/bootstrap.sh b/tasks/0029_908_29908654_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0029_908_29908654_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0029_908_29908654_qa_4/environment/pull_bucket.py b/tasks/0029_908_29908654_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0029_908_29908654_qa_4/environment/pull_bucket.py +++ b/tasks/0029_908_29908654_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0029_908_29908654_qa_4/task.toml b/tasks/0029_908_29908654_qa_4/task.toml index d4bf6049141141388e29cd20283678dde921dcbd..0af29daaba15e32a44a03d26042b0068dfbc0376 100644 --- a/tasks/0029_908_29908654_qa_4/task.toml +++ b/tasks/0029_908_29908654_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_006_30006119_qa_3/environment/bootstrap.sh b/tasks/0030_006_30006119_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_006_30006119_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_006_30006119_qa_3/environment/pull_bucket.py b/tasks/0030_006_30006119_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_006_30006119_qa_3/environment/pull_bucket.py +++ b/tasks/0030_006_30006119_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_006_30006119_qa_3/task.toml b/tasks/0030_006_30006119_qa_3/task.toml index 2788929b41f87d2407478f5feeb551244fe150df..05cbe7a7ce32f83e1f6a8e7a73d6de7ca8e8ff46 100644 --- a/tasks/0030_006_30006119_qa_3/task.toml +++ b/tasks/0030_006_30006119_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_144_30144601_qa_2/environment/bootstrap.sh b/tasks/0030_144_30144601_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_144_30144601_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_144_30144601_qa_2/environment/pull_bucket.py b/tasks/0030_144_30144601_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_144_30144601_qa_2/environment/pull_bucket.py +++ b/tasks/0030_144_30144601_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_144_30144601_qa_2/task.toml b/tasks/0030_144_30144601_qa_2/task.toml index eb29d5ab83b09f79eed50ea68a601a7112797946..36dd5b649356aa21b5aa7c14e9682a8dd2f257d1 100644 --- a/tasks/0030_144_30144601_qa_2/task.toml +++ b/tasks/0030_144_30144601_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_144_30144601_qa_5/environment/bootstrap.sh b/tasks/0030_144_30144601_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_144_30144601_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_144_30144601_qa_5/environment/pull_bucket.py b/tasks/0030_144_30144601_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_144_30144601_qa_5/environment/pull_bucket.py +++ b/tasks/0030_144_30144601_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_144_30144601_qa_5/task.toml b/tasks/0030_144_30144601_qa_5/task.toml index 91cfa8bab0b0e8dd23a82d353a1ec3be5dfe1835..4a8fc4f658719816654cb95c2f5e452a701395ba 100644 --- a/tasks/0030_144_30144601_qa_5/task.toml +++ b/tasks/0030_144_30144601_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_152_30152211_qa_2/environment/bootstrap.sh b/tasks/0030_152_30152211_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_152_30152211_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_152_30152211_qa_2/environment/pull_bucket.py b/tasks/0030_152_30152211_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_152_30152211_qa_2/environment/pull_bucket.py +++ b/tasks/0030_152_30152211_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_152_30152211_qa_2/task.toml b/tasks/0030_152_30152211_qa_2/task.toml index 05584007d90aef3d8dbe8aada34f503e64b89fea..65ac949e41a62bf0a66a8fb7661a4f80c636a11d 100644 --- a/tasks/0030_152_30152211_qa_2/task.toml +++ b/tasks/0030_152_30152211_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_284_30284375_qa_1/environment/bootstrap.sh b/tasks/0030_284_30284375_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_284_30284375_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_284_30284375_qa_1/environment/pull_bucket.py b/tasks/0030_284_30284375_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_284_30284375_qa_1/environment/pull_bucket.py +++ b/tasks/0030_284_30284375_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_284_30284375_qa_1/task.toml b/tasks/0030_284_30284375_qa_1/task.toml index ffc034f6275e9ad5749be166154be9e2da77589f..1b332f067ed1ae765f14b7a34b311c37c07f060f 100644 --- a/tasks/0030_284_30284375_qa_1/task.toml +++ b/tasks/0030_284_30284375_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_284_30284375_qa_3/environment/bootstrap.sh b/tasks/0030_284_30284375_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_284_30284375_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_284_30284375_qa_3/environment/pull_bucket.py b/tasks/0030_284_30284375_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_284_30284375_qa_3/environment/pull_bucket.py +++ b/tasks/0030_284_30284375_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_284_30284375_qa_3/task.toml b/tasks/0030_284_30284375_qa_3/task.toml index 978051f6558386cbe60726fec4b0f10767b034a8..2c8267b3d831b55a0a14b436af569ddff52d3bd5 100644 --- a/tasks/0030_284_30284375_qa_3/task.toml +++ b/tasks/0030_284_30284375_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_304_30304394_qa_5/environment/bootstrap.sh b/tasks/0030_304_30304394_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_304_30304394_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_304_30304394_qa_5/environment/pull_bucket.py b/tasks/0030_304_30304394_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_304_30304394_qa_5/environment/pull_bucket.py +++ b/tasks/0030_304_30304394_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_304_30304394_qa_5/task.toml b/tasks/0030_304_30304394_qa_5/task.toml index f12827011b757ac2ddfa2b80c7ec60113f8669f8..35ea928984aa0d320f6ddd5c7f294c633bf8c501 100644 --- a/tasks/0030_304_30304394_qa_5/task.toml +++ b/tasks/0030_304_30304394_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_348_30348412_qa_2/environment/bootstrap.sh b/tasks/0030_348_30348412_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_348_30348412_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_348_30348412_qa_2/environment/pull_bucket.py b/tasks/0030_348_30348412_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_348_30348412_qa_2/environment/pull_bucket.py +++ b/tasks/0030_348_30348412_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_348_30348412_qa_2/task.toml b/tasks/0030_348_30348412_qa_2/task.toml index dac026d85e8fa83bf8bd6643a9f8f332ab6a62ea..69e552b610031ede994d1b465bc2d848242b6bb2 100644 --- a/tasks/0030_348_30348412_qa_2/task.toml +++ b/tasks/0030_348_30348412_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_471_30471502_qa_1/environment/bootstrap.sh b/tasks/0030_471_30471502_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_471_30471502_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_471_30471502_qa_1/environment/pull_bucket.py b/tasks/0030_471_30471502_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_471_30471502_qa_1/environment/pull_bucket.py +++ b/tasks/0030_471_30471502_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_471_30471502_qa_1/task.toml b/tasks/0030_471_30471502_qa_1/task.toml index 68a61b2f016b7f8dc44a42588702e8e38abe8f30..9915a5ddfca5916591b552ce8b11077db9c781c3 100644 --- a/tasks/0030_471_30471502_qa_1/task.toml +++ b/tasks/0030_471_30471502_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_471_30471502_qa_3/environment/bootstrap.sh b/tasks/0030_471_30471502_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_471_30471502_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_471_30471502_qa_3/environment/pull_bucket.py b/tasks/0030_471_30471502_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_471_30471502_qa_3/environment/pull_bucket.py +++ b/tasks/0030_471_30471502_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_471_30471502_qa_3/task.toml b/tasks/0030_471_30471502_qa_3/task.toml index 8c320a9974b4591fa715bb5c6b5599ff17e57106..912db76acdebe222740c578eddfb3bfb262b5d12 100644 --- a/tasks/0030_471_30471502_qa_3/task.toml +++ b/tasks/0030_471_30471502_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_544_30544921_qa_1/environment/bootstrap.sh b/tasks/0030_544_30544921_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_544_30544921_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_544_30544921_qa_1/environment/pull_bucket.py b/tasks/0030_544_30544921_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_544_30544921_qa_1/environment/pull_bucket.py +++ b/tasks/0030_544_30544921_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_544_30544921_qa_1/task.toml b/tasks/0030_544_30544921_qa_1/task.toml index 47eb390bde52f17833cdf37468c0abeab9a1fa58..1b739e1f4e0ec675adcb3c245d651543b04a74b4 100644 --- a/tasks/0030_544_30544921_qa_1/task.toml +++ b/tasks/0030_544_30544921_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_588_30588724_qa_4/environment/bootstrap.sh b/tasks/0030_588_30588724_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_588_30588724_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_588_30588724_qa_4/environment/pull_bucket.py b/tasks/0030_588_30588724_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_588_30588724_qa_4/environment/pull_bucket.py +++ b/tasks/0030_588_30588724_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_588_30588724_qa_4/task.toml b/tasks/0030_588_30588724_qa_4/task.toml index 04d6885d8f31c38dd59582cde3f1db03875360ba..b424217cf437163bf2441abc8b60a0ddfd5e82c7 100644 --- a/tasks/0030_588_30588724_qa_4/task.toml +++ b/tasks/0030_588_30588724_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_688_30688656_qa_2/environment/bootstrap.sh b/tasks/0030_688_30688656_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_688_30688656_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_688_30688656_qa_2/environment/pull_bucket.py b/tasks/0030_688_30688656_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_688_30688656_qa_2/environment/pull_bucket.py +++ b/tasks/0030_688_30688656_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_688_30688656_qa_2/task.toml b/tasks/0030_688_30688656_qa_2/task.toml index e2cbb1d72b32c3a1083c34fb57ae6d6a4aeba732..e0d86fcba30cba5a1bf19f13378ac33ab3606048 100644 --- a/tasks/0030_688_30688656_qa_2/task.toml +++ b/tasks/0030_688_30688656_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_688_30688656_qa_3/environment/bootstrap.sh b/tasks/0030_688_30688656_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_688_30688656_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_688_30688656_qa_3/environment/pull_bucket.py b/tasks/0030_688_30688656_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_688_30688656_qa_3/environment/pull_bucket.py +++ b/tasks/0030_688_30688656_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_688_30688656_qa_3/task.toml b/tasks/0030_688_30688656_qa_3/task.toml index d569c823153df05beb4bbbd99249657eb595d137..1810e60457daadbe4c9165417cc8c639848dbdb0 100644 --- a/tasks/0030_688_30688656_qa_3/task.toml +++ b/tasks/0030_688_30688656_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_751_30751961_qa_1/environment/bootstrap.sh b/tasks/0030_751_30751961_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_751_30751961_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_751_30751961_qa_1/environment/pull_bucket.py b/tasks/0030_751_30751961_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_751_30751961_qa_1/environment/pull_bucket.py +++ b/tasks/0030_751_30751961_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_751_30751961_qa_1/task.toml b/tasks/0030_751_30751961_qa_1/task.toml index 9d3e915793f2e30048363ee1041aeb4004855e86..87065935d0d6bb01a92478b01f00c8f37f579ebe 100644 --- a/tasks/0030_751_30751961_qa_1/task.toml +++ b/tasks/0030_751_30751961_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_791_30791695_qa_4/environment/bootstrap.sh b/tasks/0030_791_30791695_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_791_30791695_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_791_30791695_qa_4/environment/pull_bucket.py b/tasks/0030_791_30791695_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_791_30791695_qa_4/environment/pull_bucket.py +++ b/tasks/0030_791_30791695_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_791_30791695_qa_4/task.toml b/tasks/0030_791_30791695_qa_4/task.toml index 3532c6ea9bc4f6299453204aaf220b51ae997a74..6ede214038e92fd94db975a50f92d060e7a13698 100644 --- a/tasks/0030_791_30791695_qa_4/task.toml +++ b/tasks/0030_791_30791695_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_804_30804903_qa_1/environment/bootstrap.sh b/tasks/0030_804_30804903_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_804_30804903_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_804_30804903_qa_1/environment/pull_bucket.py b/tasks/0030_804_30804903_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_804_30804903_qa_1/environment/pull_bucket.py +++ b/tasks/0030_804_30804903_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_804_30804903_qa_1/task.toml b/tasks/0030_804_30804903_qa_1/task.toml index 6086c726611cb88b9d0ce8ecb8484cdc501280e4..c8d4dd4ede9e91cb00e8598e37106a1ceff3fd01 100644 --- a/tasks/0030_804_30804903_qa_1/task.toml +++ b/tasks/0030_804_30804903_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_817_30817038_qa_2/environment/bootstrap.sh b/tasks/0030_817_30817038_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_817_30817038_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_817_30817038_qa_2/environment/pull_bucket.py b/tasks/0030_817_30817038_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_817_30817038_qa_2/environment/pull_bucket.py +++ b/tasks/0030_817_30817038_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_817_30817038_qa_2/task.toml b/tasks/0030_817_30817038_qa_2/task.toml index 774bf06b6148376ec0a011ca8052257c39e84cf1..c95d35f3158ef007c4fb17084e8220db82d222af 100644 --- a/tasks/0030_817_30817038_qa_2/task.toml +++ b/tasks/0030_817_30817038_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_856_30856788_qa_1/environment/bootstrap.sh b/tasks/0030_856_30856788_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_856_30856788_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_856_30856788_qa_1/environment/pull_bucket.py b/tasks/0030_856_30856788_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_856_30856788_qa_1/environment/pull_bucket.py +++ b/tasks/0030_856_30856788_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_856_30856788_qa_1/task.toml b/tasks/0030_856_30856788_qa_1/task.toml index 19a0261e09549a9f9e9b6c14619f9b5734b3137c..20aa2bd73b72c5864f247952fe30f793b6ee7ef9 100644 --- a/tasks/0030_856_30856788_qa_1/task.toml +++ b/tasks/0030_856_30856788_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_858_30858491_qa_3/environment/bootstrap.sh b/tasks/0030_858_30858491_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_858_30858491_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_858_30858491_qa_3/environment/pull_bucket.py b/tasks/0030_858_30858491_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_858_30858491_qa_3/environment/pull_bucket.py +++ b/tasks/0030_858_30858491_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_858_30858491_qa_3/task.toml b/tasks/0030_858_30858491_qa_3/task.toml index 636570702f04ee3de89dc42679aab3768a7b3d18..d48bd0628bc163f41ac33b9fcf9ed0ba2966a444 100644 --- a/tasks/0030_858_30858491_qa_3/task.toml +++ b/tasks/0030_858_30858491_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_890_30890976_qa_1/environment/bootstrap.sh b/tasks/0030_890_30890976_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_890_30890976_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_890_30890976_qa_1/environment/pull_bucket.py b/tasks/0030_890_30890976_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_890_30890976_qa_1/environment/pull_bucket.py +++ b/tasks/0030_890_30890976_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_890_30890976_qa_1/task.toml b/tasks/0030_890_30890976_qa_1/task.toml index 9f484da172287e57eee821b878e4cad43812a84e..1d9538b45125c200a09f6b0128b9d81c7494487a 100644 --- a/tasks/0030_890_30890976_qa_1/task.toml +++ b/tasks/0030_890_30890976_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_890_30890976_qa_2/environment/bootstrap.sh b/tasks/0030_890_30890976_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_890_30890976_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_890_30890976_qa_2/environment/pull_bucket.py b/tasks/0030_890_30890976_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_890_30890976_qa_2/environment/pull_bucket.py +++ b/tasks/0030_890_30890976_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_890_30890976_qa_2/task.toml b/tasks/0030_890_30890976_qa_2/task.toml index 56c3853c0d98c3f8717accd4c4fbfab49dd560e9..89a9300d4a253194c693bac5708c3570217decb0 100644 --- a/tasks/0030_890_30890976_qa_2/task.toml +++ b/tasks/0030_890_30890976_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_890_30890976_qa_4/environment/bootstrap.sh b/tasks/0030_890_30890976_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_890_30890976_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_890_30890976_qa_4/environment/pull_bucket.py b/tasks/0030_890_30890976_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_890_30890976_qa_4/environment/pull_bucket.py +++ b/tasks/0030_890_30890976_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_890_30890976_qa_4/task.toml b/tasks/0030_890_30890976_qa_4/task.toml index 12abafb6d5f23db2c716c6ccbe9bac54dee476fa..41a9592465b6b890b770ec2bf9efb3b76819eb2b 100644 --- a/tasks/0030_890_30890976_qa_4/task.toml +++ b/tasks/0030_890_30890976_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_890_30890976_qa_5/environment/bootstrap.sh b/tasks/0030_890_30890976_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_890_30890976_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_890_30890976_qa_5/environment/pull_bucket.py b/tasks/0030_890_30890976_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_890_30890976_qa_5/environment/pull_bucket.py +++ b/tasks/0030_890_30890976_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_890_30890976_qa_5/task.toml b/tasks/0030_890_30890976_qa_5/task.toml index f698fa91c1c9d63a4e2f0fea15713e20e13e2dc2..ac5ad04761b473a5209645c9392467752cc0d586 100644 --- a/tasks/0030_890_30890976_qa_5/task.toml +++ b/tasks/0030_890_30890976_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_894_30894225_qa_2/environment/bootstrap.sh b/tasks/0030_894_30894225_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_894_30894225_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_894_30894225_qa_2/environment/pull_bucket.py b/tasks/0030_894_30894225_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_894_30894225_qa_2/environment/pull_bucket.py +++ b/tasks/0030_894_30894225_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_894_30894225_qa_2/task.toml b/tasks/0030_894_30894225_qa_2/task.toml index dd49b163108d1bb3d39a40a0b7bed7a347b4e271..87c7b842391589c9fac1a30fe60c2d08cdabdb25 100644 --- a/tasks/0030_894_30894225_qa_2/task.toml +++ b/tasks/0030_894_30894225_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_894_30894225_qa_3/environment/bootstrap.sh b/tasks/0030_894_30894225_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_894_30894225_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_894_30894225_qa_3/environment/pull_bucket.py b/tasks/0030_894_30894225_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_894_30894225_qa_3/environment/pull_bucket.py +++ b/tasks/0030_894_30894225_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_894_30894225_qa_3/task.toml b/tasks/0030_894_30894225_qa_3/task.toml index 2d84d972f3401bf7c488d4e14ad8ae952702b845..0c15bcabf08429a3b8934076c1cc42e8d060b02c 100644 --- a/tasks/0030_894_30894225_qa_3/task.toml +++ b/tasks/0030_894_30894225_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_991_30991339_qa_2/environment/bootstrap.sh b/tasks/0030_991_30991339_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_991_30991339_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_991_30991339_qa_2/environment/pull_bucket.py b/tasks/0030_991_30991339_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_991_30991339_qa_2/environment/pull_bucket.py +++ b/tasks/0030_991_30991339_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_991_30991339_qa_2/task.toml b/tasks/0030_991_30991339_qa_2/task.toml index ab9fd0afceb488e8d519ee9b18ce14d1def536bd..180abd571cb49cbaf8273198868baf79ef448bd7 100644 --- a/tasks/0030_991_30991339_qa_2/task.toml +++ b/tasks/0030_991_30991339_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_991_30991339_qa_3/environment/bootstrap.sh b/tasks/0030_991_30991339_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_991_30991339_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_991_30991339_qa_3/environment/pull_bucket.py b/tasks/0030_991_30991339_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_991_30991339_qa_3/environment/pull_bucket.py +++ b/tasks/0030_991_30991339_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_991_30991339_qa_3/task.toml b/tasks/0030_991_30991339_qa_3/task.toml index c420a6b751730f45ec4b004066f5bc86526f9599..2a79c344816d63f2e8a827519b723a7ba4f4a7ce 100644 --- a/tasks/0030_991_30991339_qa_3/task.toml +++ b/tasks/0030_991_30991339_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0030_991_30991339_qa_4/environment/bootstrap.sh b/tasks/0030_991_30991339_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0030_991_30991339_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0030_991_30991339_qa_4/environment/pull_bucket.py b/tasks/0030_991_30991339_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0030_991_30991339_qa_4/environment/pull_bucket.py +++ b/tasks/0030_991_30991339_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0030_991_30991339_qa_4/task.toml b/tasks/0030_991_30991339_qa_4/task.toml index 81e84061425416529f62df7c05e66b694808724f..8feb0f8870875f2440c24107b23b4211c8a22aa8 100644 --- a/tasks/0030_991_30991339_qa_4/task.toml +++ b/tasks/0030_991_30991339_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_033_31033882_qa_1/environment/bootstrap.sh b/tasks/0031_033_31033882_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_033_31033882_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_033_31033882_qa_1/environment/pull_bucket.py b/tasks/0031_033_31033882_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_033_31033882_qa_1/environment/pull_bucket.py +++ b/tasks/0031_033_31033882_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_033_31033882_qa_1/task.toml b/tasks/0031_033_31033882_qa_1/task.toml index 9e7c40be29e250804538a96c2eb9990a3a425db3..855a13ceadd281080e5dbd02d7610816bdc844b4 100644 --- a/tasks/0031_033_31033882_qa_1/task.toml +++ b/tasks/0031_033_31033882_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_057_31057767_qa_5/environment/bootstrap.sh b/tasks/0031_057_31057767_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_057_31057767_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_057_31057767_qa_5/environment/pull_bucket.py b/tasks/0031_057_31057767_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_057_31057767_qa_5/environment/pull_bucket.py +++ b/tasks/0031_057_31057767_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_057_31057767_qa_5/task.toml b/tasks/0031_057_31057767_qa_5/task.toml index e9553e196b3e7dbbdd3b059969a29ecaeb79c512..9789cbb71d681288c2268ca434555e56e6f4e82c 100644 --- a/tasks/0031_057_31057767_qa_5/task.toml +++ b/tasks/0031_057_31057767_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_074_31074287_qa_3/environment/bootstrap.sh b/tasks/0031_074_31074287_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_074_31074287_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_074_31074287_qa_3/environment/pull_bucket.py b/tasks/0031_074_31074287_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_074_31074287_qa_3/environment/pull_bucket.py +++ b/tasks/0031_074_31074287_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_074_31074287_qa_3/task.toml b/tasks/0031_074_31074287_qa_3/task.toml index bfe2d60adc0589c98670c3fbcb190a250acabe08..ef71d5431fd2fe96a225e60c96c08d0f9e182461 100644 --- a/tasks/0031_074_31074287_qa_3/task.toml +++ b/tasks/0031_074_31074287_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_089_31089222_qa_2/environment/bootstrap.sh b/tasks/0031_089_31089222_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_089_31089222_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_089_31089222_qa_2/environment/pull_bucket.py b/tasks/0031_089_31089222_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_089_31089222_qa_2/environment/pull_bucket.py +++ b/tasks/0031_089_31089222_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_089_31089222_qa_2/task.toml b/tasks/0031_089_31089222_qa_2/task.toml index 3c26d7fea1838eadb02141876b7e47ff53a8901e..e75a4333a507189f033f8dbe177a6c5e63f2df4d 100644 --- a/tasks/0031_089_31089222_qa_2/task.toml +++ b/tasks/0031_089_31089222_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_106_31106192_qa_2/environment/bootstrap.sh b/tasks/0031_106_31106192_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_106_31106192_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_106_31106192_qa_2/environment/pull_bucket.py b/tasks/0031_106_31106192_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_106_31106192_qa_2/environment/pull_bucket.py +++ b/tasks/0031_106_31106192_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_106_31106192_qa_2/task.toml b/tasks/0031_106_31106192_qa_2/task.toml index 67c4d852e5180b9343628278a6d9febfbab4d0c2..b50d0e257e453319baa755d51b0c2f1783755057 100644 --- a/tasks/0031_106_31106192_qa_2/task.toml +++ b/tasks/0031_106_31106192_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_106_31106192_qa_5/environment/bootstrap.sh b/tasks/0031_106_31106192_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_106_31106192_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_106_31106192_qa_5/environment/pull_bucket.py b/tasks/0031_106_31106192_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_106_31106192_qa_5/environment/pull_bucket.py +++ b/tasks/0031_106_31106192_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_106_31106192_qa_5/task.toml b/tasks/0031_106_31106192_qa_5/task.toml index 64059cbb84c00d6547e578e2757cc8ed7d44a8db..46e261f2b4c2eca3a395f8e168b9418ce726d9ab 100644 --- a/tasks/0031_106_31106192_qa_5/task.toml +++ b/tasks/0031_106_31106192_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_128_31128554_qa_1/environment/bootstrap.sh b/tasks/0031_128_31128554_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_128_31128554_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_128_31128554_qa_1/environment/pull_bucket.py b/tasks/0031_128_31128554_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_128_31128554_qa_1/environment/pull_bucket.py +++ b/tasks/0031_128_31128554_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_128_31128554_qa_1/task.toml b/tasks/0031_128_31128554_qa_1/task.toml index d8a74786f7a80e76c3d3505e713984b20893b9b9..d77b3bf624242b397eb35660b76ddb1a4148cf4a 100644 --- a/tasks/0031_128_31128554_qa_1/task.toml +++ b/tasks/0031_128_31128554_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_128_31128554_qa_2/environment/bootstrap.sh b/tasks/0031_128_31128554_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_128_31128554_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_128_31128554_qa_2/environment/pull_bucket.py b/tasks/0031_128_31128554_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_128_31128554_qa_2/environment/pull_bucket.py +++ b/tasks/0031_128_31128554_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_128_31128554_qa_2/task.toml b/tasks/0031_128_31128554_qa_2/task.toml index cf71e9009144e36570a535d519964bd639169f0e..f6380103dee7a5484067db3b0940272210904415 100644 --- a/tasks/0031_128_31128554_qa_2/task.toml +++ b/tasks/0031_128_31128554_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_128_31128554_qa_3/environment/bootstrap.sh b/tasks/0031_128_31128554_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_128_31128554_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_128_31128554_qa_3/environment/pull_bucket.py b/tasks/0031_128_31128554_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_128_31128554_qa_3/environment/pull_bucket.py +++ b/tasks/0031_128_31128554_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_128_31128554_qa_3/task.toml b/tasks/0031_128_31128554_qa_3/task.toml index 861cd9e8e9fbe10f98c65b0f0f2850d57da40a52..32d7851e768f3f3fb35f924db33fd25eae1767a8 100644 --- a/tasks/0031_128_31128554_qa_3/task.toml +++ b/tasks/0031_128_31128554_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_128_31128554_qa_5/environment/bootstrap.sh b/tasks/0031_128_31128554_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_128_31128554_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_128_31128554_qa_5/environment/pull_bucket.py b/tasks/0031_128_31128554_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_128_31128554_qa_5/environment/pull_bucket.py +++ b/tasks/0031_128_31128554_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_128_31128554_qa_5/task.toml b/tasks/0031_128_31128554_qa_5/task.toml index d99f0d04ef1b9c25081cfeb6714c375965ac44bf..70a326442d7dd2e22798740bdbf8bd3fa73db97f 100644 --- a/tasks/0031_128_31128554_qa_5/task.toml +++ b/tasks/0031_128_31128554_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_326_31326046_qa_5/environment/bootstrap.sh b/tasks/0031_326_31326046_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_326_31326046_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_326_31326046_qa_5/environment/pull_bucket.py b/tasks/0031_326_31326046_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_326_31326046_qa_5/environment/pull_bucket.py +++ b/tasks/0031_326_31326046_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_326_31326046_qa_5/task.toml b/tasks/0031_326_31326046_qa_5/task.toml index cbd198b8b43977fb63ef29992edd1f09136f445c..5d2e12c21833ee75eafeab76b4340499190a3146 100644 --- a/tasks/0031_326_31326046_qa_5/task.toml +++ b/tasks/0031_326_31326046_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_326_31326436_qa_3/environment/bootstrap.sh b/tasks/0031_326_31326436_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_326_31326436_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_326_31326436_qa_3/environment/pull_bucket.py b/tasks/0031_326_31326436_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_326_31326436_qa_3/environment/pull_bucket.py +++ b/tasks/0031_326_31326436_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_326_31326436_qa_3/task.toml b/tasks/0031_326_31326436_qa_3/task.toml index 89afa8f0fb6e8a81ec144a7d9f7da80b743f42ca..fa985644bfc93a7524d9f3d47eeadb1e045b7c37 100644 --- a/tasks/0031_326_31326436_qa_3/task.toml +++ b/tasks/0031_326_31326436_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_374_31374028_qa_1/environment/bootstrap.sh b/tasks/0031_374_31374028_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_374_31374028_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_374_31374028_qa_1/environment/pull_bucket.py b/tasks/0031_374_31374028_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_374_31374028_qa_1/environment/pull_bucket.py +++ b/tasks/0031_374_31374028_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_374_31374028_qa_1/task.toml b/tasks/0031_374_31374028_qa_1/task.toml index b20c47afea7fa79b7ddb5c5fe5874f6def24a175..2c9474e28dc33b60d789d3d8a067bd76e9305e16 100644 --- a/tasks/0031_374_31374028_qa_1/task.toml +++ b/tasks/0031_374_31374028_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_374_31374028_qa_4/environment/bootstrap.sh b/tasks/0031_374_31374028_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_374_31374028_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_374_31374028_qa_4/environment/pull_bucket.py b/tasks/0031_374_31374028_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_374_31374028_qa_4/environment/pull_bucket.py +++ b/tasks/0031_374_31374028_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_374_31374028_qa_4/task.toml b/tasks/0031_374_31374028_qa_4/task.toml index 0d9f4a277e84ecfdf267dfbc234e9ef0b8d9bb39..214d5a1b077578fbe34ebf8d8f08fd6dadb884c4 100644 --- a/tasks/0031_374_31374028_qa_4/task.toml +++ b/tasks/0031_374_31374028_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_395_31395077_qa_1/environment/bootstrap.sh b/tasks/0031_395_31395077_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_395_31395077_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_395_31395077_qa_1/environment/pull_bucket.py b/tasks/0031_395_31395077_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_395_31395077_qa_1/environment/pull_bucket.py +++ b/tasks/0031_395_31395077_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_395_31395077_qa_1/task.toml b/tasks/0031_395_31395077_qa_1/task.toml index e3e1bac8a486e0f216194f8cf0e5d24b8511041d..e4635ae49f406c9d2d52bab58562555dafa02c00 100644 --- a/tasks/0031_395_31395077_qa_1/task.toml +++ b/tasks/0031_395_31395077_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_402_31402162_qa_4/environment/bootstrap.sh b/tasks/0031_402_31402162_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_402_31402162_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_402_31402162_qa_4/environment/pull_bucket.py b/tasks/0031_402_31402162_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_402_31402162_qa_4/environment/pull_bucket.py +++ b/tasks/0031_402_31402162_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_402_31402162_qa_4/task.toml b/tasks/0031_402_31402162_qa_4/task.toml index f0eb40c8662597d1995fa5fc248a65bf7b53c329..192e5355db6ebab107a36d6d2cae089dffc55b40 100644 --- a/tasks/0031_402_31402162_qa_4/task.toml +++ b/tasks/0031_402_31402162_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_434_31434625_qa_1/environment/bootstrap.sh b/tasks/0031_434_31434625_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_434_31434625_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_434_31434625_qa_1/environment/pull_bucket.py b/tasks/0031_434_31434625_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_434_31434625_qa_1/environment/pull_bucket.py +++ b/tasks/0031_434_31434625_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_434_31434625_qa_1/task.toml b/tasks/0031_434_31434625_qa_1/task.toml index d185b1112eba48fbdfcb5711b1c08ce32819b72c..9310c2773e0bbe352cea215b6effe8bae0b103e3 100644 --- a/tasks/0031_434_31434625_qa_1/task.toml +++ b/tasks/0031_434_31434625_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_523_31523942_qa_1/environment/bootstrap.sh b/tasks/0031_523_31523942_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_523_31523942_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_523_31523942_qa_1/environment/pull_bucket.py b/tasks/0031_523_31523942_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_523_31523942_qa_1/environment/pull_bucket.py +++ b/tasks/0031_523_31523942_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_523_31523942_qa_1/task.toml b/tasks/0031_523_31523942_qa_1/task.toml index 2bcc6874ef6c1441d3ad0eff2397e66f06e7c332..3a7ffbfcd8adbb40bb3307f2af14af23b2d1e673 100644 --- a/tasks/0031_523_31523942_qa_1/task.toml +++ b/tasks/0031_523_31523942_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_523_31523942_qa_3/environment/bootstrap.sh b/tasks/0031_523_31523942_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_523_31523942_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_523_31523942_qa_3/environment/pull_bucket.py b/tasks/0031_523_31523942_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_523_31523942_qa_3/environment/pull_bucket.py +++ b/tasks/0031_523_31523942_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_523_31523942_qa_3/task.toml b/tasks/0031_523_31523942_qa_3/task.toml index 13829d1b216859f32a7a4c9f69b495de1ff349fa..73748ab4e8cb05e6b39d08c789e080547f1e3097 100644 --- a/tasks/0031_523_31523942_qa_3/task.toml +++ b/tasks/0031_523_31523942_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_523_31523942_qa_4/environment/bootstrap.sh b/tasks/0031_523_31523942_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_523_31523942_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_523_31523942_qa_4/environment/pull_bucket.py b/tasks/0031_523_31523942_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_523_31523942_qa_4/environment/pull_bucket.py +++ b/tasks/0031_523_31523942_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_523_31523942_qa_4/task.toml b/tasks/0031_523_31523942_qa_4/task.toml index 3329f44223f736e91d7b7504061b961cbaca84d1..ee09c5844b7a1d7515fb392f2f7f71729b4ceb81 100644 --- a/tasks/0031_523_31523942_qa_4/task.toml +++ b/tasks/0031_523_31523942_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_566_31566788_qa_1/environment/bootstrap.sh b/tasks/0031_566_31566788_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_566_31566788_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_566_31566788_qa_1/environment/pull_bucket.py b/tasks/0031_566_31566788_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_566_31566788_qa_1/environment/pull_bucket.py +++ b/tasks/0031_566_31566788_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_566_31566788_qa_1/task.toml b/tasks/0031_566_31566788_qa_1/task.toml index 8c572bd71b2f351609248165f15899fb01b20908..88826b3b8df02da4565b59c827fc670c0b761337 100644 --- a/tasks/0031_566_31566788_qa_1/task.toml +++ b/tasks/0031_566_31566788_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_566_31566788_qa_5/environment/bootstrap.sh b/tasks/0031_566_31566788_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_566_31566788_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_566_31566788_qa_5/environment/pull_bucket.py b/tasks/0031_566_31566788_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_566_31566788_qa_5/environment/pull_bucket.py +++ b/tasks/0031_566_31566788_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_566_31566788_qa_5/task.toml b/tasks/0031_566_31566788_qa_5/task.toml index 93c2f1f56cd90b787e257b6733c33500b9224ac1..64c3d519690c79b14dd8cffbc9c25d051221c6b9 100644 --- a/tasks/0031_566_31566788_qa_5/task.toml +++ b/tasks/0031_566_31566788_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_576_31576713_qa_1/environment/bootstrap.sh b/tasks/0031_576_31576713_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_576_31576713_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_576_31576713_qa_1/environment/pull_bucket.py b/tasks/0031_576_31576713_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_576_31576713_qa_1/environment/pull_bucket.py +++ b/tasks/0031_576_31576713_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_576_31576713_qa_1/task.toml b/tasks/0031_576_31576713_qa_1/task.toml index 14f1c3808b0c74940c6dc3067fceafd03af57b4f..442d56f62752768a90859f2be471126ed11efd34 100644 --- a/tasks/0031_576_31576713_qa_1/task.toml +++ b/tasks/0031_576_31576713_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_600_31600148_qa_2/environment/bootstrap.sh b/tasks/0031_600_31600148_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_600_31600148_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_600_31600148_qa_2/environment/pull_bucket.py b/tasks/0031_600_31600148_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_600_31600148_qa_2/environment/pull_bucket.py +++ b/tasks/0031_600_31600148_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_600_31600148_qa_2/task.toml b/tasks/0031_600_31600148_qa_2/task.toml index 985cc1357edd6938d2a7e01869ab7d07d4e3ffda..3c8252f47f07f01c231fd4315cda3225d5466252 100644 --- a/tasks/0031_600_31600148_qa_2/task.toml +++ b/tasks/0031_600_31600148_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_625_31625575_qa_3/environment/bootstrap.sh b/tasks/0031_625_31625575_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_625_31625575_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_625_31625575_qa_3/environment/pull_bucket.py b/tasks/0031_625_31625575_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_625_31625575_qa_3/environment/pull_bucket.py +++ b/tasks/0031_625_31625575_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_625_31625575_qa_3/task.toml b/tasks/0031_625_31625575_qa_3/task.toml index 0686b653fcf456073694a4e291f8b486aaa98ce1..b7fd6445e1f2b929e97f96caf471dced8fa596c3 100644 --- a/tasks/0031_625_31625575_qa_3/task.toml +++ b/tasks/0031_625_31625575_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_625_31625575_qa_5/environment/bootstrap.sh b/tasks/0031_625_31625575_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_625_31625575_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_625_31625575_qa_5/environment/pull_bucket.py b/tasks/0031_625_31625575_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_625_31625575_qa_5/environment/pull_bucket.py +++ b/tasks/0031_625_31625575_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_625_31625575_qa_5/task.toml b/tasks/0031_625_31625575_qa_5/task.toml index a67d8f57148d4b922ffe07b2af2182c5604fbb97..f2b0bd3c47edba344647f33a17a9393c96dc496f 100644 --- a/tasks/0031_625_31625575_qa_5/task.toml +++ b/tasks/0031_625_31625575_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_700_31700793_qa_5/environment/bootstrap.sh b/tasks/0031_700_31700793_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_700_31700793_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_700_31700793_qa_5/environment/pull_bucket.py b/tasks/0031_700_31700793_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_700_31700793_qa_5/environment/pull_bucket.py +++ b/tasks/0031_700_31700793_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_700_31700793_qa_5/task.toml b/tasks/0031_700_31700793_qa_5/task.toml index 96a2baf068a48fc821a43cca57c11bfdc949f384..ca7e172d9cc7ad1d03c07af362333b209afc9c83 100644 --- a/tasks/0031_700_31700793_qa_5/task.toml +++ b/tasks/0031_700_31700793_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_757_31757076_qa_1/environment/bootstrap.sh b/tasks/0031_757_31757076_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_757_31757076_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_757_31757076_qa_1/environment/pull_bucket.py b/tasks/0031_757_31757076_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_757_31757076_qa_1/environment/pull_bucket.py +++ b/tasks/0031_757_31757076_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_757_31757076_qa_1/task.toml b/tasks/0031_757_31757076_qa_1/task.toml index a59447b3e89873698399fd5d4e49c15c35c54855..b4e9ba0185b21f10b4f85b93b28d3364fac50752 100644 --- a/tasks/0031_757_31757076_qa_1/task.toml +++ b/tasks/0031_757_31757076_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_757_31757076_qa_3/environment/bootstrap.sh b/tasks/0031_757_31757076_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_757_31757076_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_757_31757076_qa_3/environment/pull_bucket.py b/tasks/0031_757_31757076_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_757_31757076_qa_3/environment/pull_bucket.py +++ b/tasks/0031_757_31757076_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_757_31757076_qa_3/task.toml b/tasks/0031_757_31757076_qa_3/task.toml index 8e31b63199fe0c9aa8f0545d05397449e1711298..bd0431a90ce33b772af009edcad8484d7725d9af 100644 --- a/tasks/0031_757_31757076_qa_3/task.toml +++ b/tasks/0031_757_31757076_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_776_31776194_qa_2/environment/bootstrap.sh b/tasks/0031_776_31776194_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_776_31776194_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_776_31776194_qa_2/environment/pull_bucket.py b/tasks/0031_776_31776194_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_776_31776194_qa_2/environment/pull_bucket.py +++ b/tasks/0031_776_31776194_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_776_31776194_qa_2/task.toml b/tasks/0031_776_31776194_qa_2/task.toml index 2b9ded62330437859bb1226516e5cc52dea26874..4729804b8ee2565843d93ec8861e8067a695998b 100644 --- a/tasks/0031_776_31776194_qa_2/task.toml +++ b/tasks/0031_776_31776194_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_780_31780833_qa_2/environment/bootstrap.sh b/tasks/0031_780_31780833_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_780_31780833_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_780_31780833_qa_2/environment/pull_bucket.py b/tasks/0031_780_31780833_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_780_31780833_qa_2/environment/pull_bucket.py +++ b/tasks/0031_780_31780833_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_780_31780833_qa_2/task.toml b/tasks/0031_780_31780833_qa_2/task.toml index d34f1327b00b6fa81ea45a146568247be7251394..1d5722ea293042b0d6421889644a7fdfd39064e9 100644 --- a/tasks/0031_780_31780833_qa_2/task.toml +++ b/tasks/0031_780_31780833_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_780_31780833_qa_3/environment/bootstrap.sh b/tasks/0031_780_31780833_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_780_31780833_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_780_31780833_qa_3/environment/pull_bucket.py b/tasks/0031_780_31780833_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_780_31780833_qa_3/environment/pull_bucket.py +++ b/tasks/0031_780_31780833_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_780_31780833_qa_3/task.toml b/tasks/0031_780_31780833_qa_3/task.toml index 9eadd429d0ddc28b47825eef3caeb7757486dea5..ff2beb6db4f826a063106db685074fd7fd613eec 100644 --- a/tasks/0031_780_31780833_qa_3/task.toml +++ b/tasks/0031_780_31780833_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_780_31780833_qa_4/environment/bootstrap.sh b/tasks/0031_780_31780833_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_780_31780833_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_780_31780833_qa_4/environment/pull_bucket.py b/tasks/0031_780_31780833_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_780_31780833_qa_4/environment/pull_bucket.py +++ b/tasks/0031_780_31780833_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_780_31780833_qa_4/task.toml b/tasks/0031_780_31780833_qa_4/task.toml index dbff7e5baa952dc55812e3a703b471894bb3bad1..15d27c1698c0dbebe2de7004ca06b7e5aff09593 100644 --- a/tasks/0031_780_31780833_qa_4/task.toml +++ b/tasks/0031_780_31780833_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_829_31829521_qa_1/environment/bootstrap.sh b/tasks/0031_829_31829521_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_829_31829521_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_829_31829521_qa_1/environment/pull_bucket.py b/tasks/0031_829_31829521_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_829_31829521_qa_1/environment/pull_bucket.py +++ b/tasks/0031_829_31829521_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_829_31829521_qa_1/task.toml b/tasks/0031_829_31829521_qa_1/task.toml index 73b1e960ca534f7116d9dd0b06ec8543cc77d197..1ff7904b9de9985b188ca824249dae7051622bce 100644 --- a/tasks/0031_829_31829521_qa_1/task.toml +++ b/tasks/0031_829_31829521_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_829_31829521_qa_2/environment/bootstrap.sh b/tasks/0031_829_31829521_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_829_31829521_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_829_31829521_qa_2/environment/pull_bucket.py b/tasks/0031_829_31829521_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_829_31829521_qa_2/environment/pull_bucket.py +++ b/tasks/0031_829_31829521_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_829_31829521_qa_2/task.toml b/tasks/0031_829_31829521_qa_2/task.toml index e9ccbc9f14507402a5f903580bab5f167cec76a9..8879bec7c1c494724bdf6c06dd1299938dfc6c5e 100644 --- a/tasks/0031_829_31829521_qa_2/task.toml +++ b/tasks/0031_829_31829521_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_829_31829521_qa_4/environment/bootstrap.sh b/tasks/0031_829_31829521_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_829_31829521_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_829_31829521_qa_4/environment/pull_bucket.py b/tasks/0031_829_31829521_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_829_31829521_qa_4/environment/pull_bucket.py +++ b/tasks/0031_829_31829521_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_829_31829521_qa_4/task.toml b/tasks/0031_829_31829521_qa_4/task.toml index 2eab52104f54508506babf367290e7f8a01ae94f..09b6a5c3625d2386e057475a403732d458306103 100644 --- a/tasks/0031_829_31829521_qa_4/task.toml +++ b/tasks/0031_829_31829521_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_829_31829521_qa_5/environment/bootstrap.sh b/tasks/0031_829_31829521_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_829_31829521_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_829_31829521_qa_5/environment/pull_bucket.py b/tasks/0031_829_31829521_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_829_31829521_qa_5/environment/pull_bucket.py +++ b/tasks/0031_829_31829521_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_829_31829521_qa_5/task.toml b/tasks/0031_829_31829521_qa_5/task.toml index cd7784fc01a2a589fb7c15217fbb65b282c0e6c0..2c4bb51acfa44a0e6f687cfb9bb034e538921d5e 100644 --- a/tasks/0031_829_31829521_qa_5/task.toml +++ b/tasks/0031_829_31829521_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_852_31852116_qa_2/environment/bootstrap.sh b/tasks/0031_852_31852116_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_852_31852116_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_852_31852116_qa_2/environment/pull_bucket.py b/tasks/0031_852_31852116_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_852_31852116_qa_2/environment/pull_bucket.py +++ b/tasks/0031_852_31852116_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_852_31852116_qa_2/task.toml b/tasks/0031_852_31852116_qa_2/task.toml index 5fc43738055a9a2e280ccaa8b7884a023b4d3d96..c47150e74542ed7a971bece740166a915713c02d 100644 --- a/tasks/0031_852_31852116_qa_2/task.toml +++ b/tasks/0031_852_31852116_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_872_31872499_qa_4/environment/bootstrap.sh b/tasks/0031_872_31872499_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_872_31872499_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_872_31872499_qa_4/environment/pull_bucket.py b/tasks/0031_872_31872499_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_872_31872499_qa_4/environment/pull_bucket.py +++ b/tasks/0031_872_31872499_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_872_31872499_qa_4/task.toml b/tasks/0031_872_31872499_qa_4/task.toml index 35246203e508f78b6837b54cba8946efa988060a..798da774962cb1b4b4f506da17331607cc24820e 100644 --- a/tasks/0031_872_31872499_qa_4/task.toml +++ b/tasks/0031_872_31872499_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_872_31872884_qa_1/environment/bootstrap.sh b/tasks/0031_872_31872884_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_872_31872884_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_872_31872884_qa_1/environment/pull_bucket.py b/tasks/0031_872_31872884_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_872_31872884_qa_1/environment/pull_bucket.py +++ b/tasks/0031_872_31872884_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_872_31872884_qa_1/task.toml b/tasks/0031_872_31872884_qa_1/task.toml index 52e70fedc41675a11481d07b0750a3c1aa826a50..010b85d781141f7d44cd938fdd48a26aa8274ecc 100644 --- a/tasks/0031_872_31872884_qa_1/task.toml +++ b/tasks/0031_872_31872884_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_889_31889886_qa_2/environment/bootstrap.sh b/tasks/0031_889_31889886_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_889_31889886_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_889_31889886_qa_2/environment/pull_bucket.py b/tasks/0031_889_31889886_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_889_31889886_qa_2/environment/pull_bucket.py +++ b/tasks/0031_889_31889886_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_889_31889886_qa_2/task.toml b/tasks/0031_889_31889886_qa_2/task.toml index a782b708929c45dbfd8e4d10d7b2f84c4fddf614..833852e3a0892bb3fedd2e367181e813e8233fd0 100644 --- a/tasks/0031_889_31889886_qa_2/task.toml +++ b/tasks/0031_889_31889886_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_906_31906980_qa_1/environment/bootstrap.sh b/tasks/0031_906_31906980_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_906_31906980_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_906_31906980_qa_1/environment/pull_bucket.py b/tasks/0031_906_31906980_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_906_31906980_qa_1/environment/pull_bucket.py +++ b/tasks/0031_906_31906980_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_906_31906980_qa_1/task.toml b/tasks/0031_906_31906980_qa_1/task.toml index ea3ab4d9fb3d164ab72d1463ba5182ad54554527..e5dddd71a40edd70ee4b4dc4b90c294b55ce4640 100644 --- a/tasks/0031_906_31906980_qa_1/task.toml +++ b/tasks/0031_906_31906980_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_908_31908862_qa_5/environment/bootstrap.sh b/tasks/0031_908_31908862_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_908_31908862_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_908_31908862_qa_5/environment/pull_bucket.py b/tasks/0031_908_31908862_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_908_31908862_qa_5/environment/pull_bucket.py +++ b/tasks/0031_908_31908862_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_908_31908862_qa_5/task.toml b/tasks/0031_908_31908862_qa_5/task.toml index 2500268234629cc5164650cca4dd23e78558cc97..f02cb60419309364a0ed0e2a6fd3fd0e49b88f32 100644 --- a/tasks/0031_908_31908862_qa_5/task.toml +++ b/tasks/0031_908_31908862_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_927_31927038_qa_4/environment/bootstrap.sh b/tasks/0031_927_31927038_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_927_31927038_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_927_31927038_qa_4/environment/pull_bucket.py b/tasks/0031_927_31927038_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_927_31927038_qa_4/environment/pull_bucket.py +++ b/tasks/0031_927_31927038_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_927_31927038_qa_4/task.toml b/tasks/0031_927_31927038_qa_4/task.toml index aaec6c892f7c87ed011088ba5700b255b13e975b..51ea0d3f93422fb2c8e30315ad701b46ff32f380 100644 --- a/tasks/0031_927_31927038_qa_4/task.toml +++ b/tasks/0031_927_31927038_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_927_31927038_qa_5/environment/bootstrap.sh b/tasks/0031_927_31927038_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_927_31927038_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_927_31927038_qa_5/environment/pull_bucket.py b/tasks/0031_927_31927038_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_927_31927038_qa_5/environment/pull_bucket.py +++ b/tasks/0031_927_31927038_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_927_31927038_qa_5/task.toml b/tasks/0031_927_31927038_qa_5/task.toml index 518cdd3f6e2208903137ad699e0d5e2aea534a56..8523ccabc9cf59231708d7c6cefef9d200caed99 100644 --- a/tasks/0031_927_31927038_qa_5/task.toml +++ b/tasks/0031_927_31927038_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_931_31931380_qa_5/environment/bootstrap.sh b/tasks/0031_931_31931380_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_931_31931380_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_931_31931380_qa_5/environment/pull_bucket.py b/tasks/0031_931_31931380_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_931_31931380_qa_5/environment/pull_bucket.py +++ b/tasks/0031_931_31931380_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_931_31931380_qa_5/task.toml b/tasks/0031_931_31931380_qa_5/task.toml index 8c3577d336b33e89ebbba526954e98466a28e1c5..fbed45bd4da96b19ee8a55b310717de335fdb7c2 100644 --- a/tasks/0031_931_31931380_qa_5/task.toml +++ b/tasks/0031_931_31931380_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_950_31950412_qa_5/environment/bootstrap.sh b/tasks/0031_950_31950412_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_950_31950412_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_950_31950412_qa_5/environment/pull_bucket.py b/tasks/0031_950_31950412_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_950_31950412_qa_5/environment/pull_bucket.py +++ b/tasks/0031_950_31950412_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_950_31950412_qa_5/task.toml b/tasks/0031_950_31950412_qa_5/task.toml index 96c5294fb9eb2368333107e1eb17652421917f22..24ac26ad373accf2f21d8808eca7a086996ca1d9 100644 --- a/tasks/0031_950_31950412_qa_5/task.toml +++ b/tasks/0031_950_31950412_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_951_31951515_qa_3/environment/bootstrap.sh b/tasks/0031_951_31951515_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_951_31951515_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_951_31951515_qa_3/environment/pull_bucket.py b/tasks/0031_951_31951515_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_951_31951515_qa_3/environment/pull_bucket.py +++ b/tasks/0031_951_31951515_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_951_31951515_qa_3/task.toml b/tasks/0031_951_31951515_qa_3/task.toml index f9933e5f3e885771dbab5052a6dc46aba2cc6ffd..192f2e52563e52cd5e3b64deaa27fd1c039acef4 100644 --- a/tasks/0031_951_31951515_qa_3/task.toml +++ b/tasks/0031_951_31951515_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_954_31954480_qa_3/environment/bootstrap.sh b/tasks/0031_954_31954480_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_954_31954480_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_954_31954480_qa_3/environment/pull_bucket.py b/tasks/0031_954_31954480_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_954_31954480_qa_3/environment/pull_bucket.py +++ b/tasks/0031_954_31954480_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_954_31954480_qa_3/task.toml b/tasks/0031_954_31954480_qa_3/task.toml index f6089bf169561608387371289190aab21b3b7a01..c92c6c8614b8dfbcd9a34d4928ac442ea458ccb6 100644 --- a/tasks/0031_954_31954480_qa_3/task.toml +++ b/tasks/0031_954_31954480_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_954_31954480_qa_5/environment/bootstrap.sh b/tasks/0031_954_31954480_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_954_31954480_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_954_31954480_qa_5/environment/pull_bucket.py b/tasks/0031_954_31954480_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_954_31954480_qa_5/environment/pull_bucket.py +++ b/tasks/0031_954_31954480_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_954_31954480_qa_5/task.toml b/tasks/0031_954_31954480_qa_5/task.toml index 8d42e1a7bc24cfd9d4d3fde95bda859d05a514d1..6aba9627925433d060c36932dee681ea077e1a39 100644 --- a/tasks/0031_954_31954480_qa_5/task.toml +++ b/tasks/0031_954_31954480_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_954_31954799_qa_2/environment/bootstrap.sh b/tasks/0031_954_31954799_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_954_31954799_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_954_31954799_qa_2/environment/pull_bucket.py b/tasks/0031_954_31954799_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_954_31954799_qa_2/environment/pull_bucket.py +++ b/tasks/0031_954_31954799_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_954_31954799_qa_2/task.toml b/tasks/0031_954_31954799_qa_2/task.toml index dbfb1a782df3d167aa48747831eecb938f52dede..daaebcaf4bfde952dbea67695d1c4a318b34e243 100644 --- a/tasks/0031_954_31954799_qa_2/task.toml +++ b/tasks/0031_954_31954799_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_987_31987709_qa_1/environment/bootstrap.sh b/tasks/0031_987_31987709_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_987_31987709_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_987_31987709_qa_1/environment/pull_bucket.py b/tasks/0031_987_31987709_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_987_31987709_qa_1/environment/pull_bucket.py +++ b/tasks/0031_987_31987709_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_987_31987709_qa_1/task.toml b/tasks/0031_987_31987709_qa_1/task.toml index 9fc0d19835cd7b6e94df8d1577f03ee673057e2c..0dac937a7e615e09900e5c7e5ba30cb11818b35a 100644 --- a/tasks/0031_987_31987709_qa_1/task.toml +++ b/tasks/0031_987_31987709_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0031_987_31987709_qa_5/environment/bootstrap.sh b/tasks/0031_987_31987709_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0031_987_31987709_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0031_987_31987709_qa_5/environment/pull_bucket.py b/tasks/0031_987_31987709_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0031_987_31987709_qa_5/environment/pull_bucket.py +++ b/tasks/0031_987_31987709_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0031_987_31987709_qa_5/task.toml b/tasks/0031_987_31987709_qa_5/task.toml index 9dd4de1a2e7b1adf027dc25a502538575145bea0..10d9bf0373d88054d373533c8c6e139c77b52beb 100644 --- a/tasks/0031_987_31987709_qa_5/task.toml +++ b/tasks/0031_987_31987709_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_014_32014924_qa_3/environment/bootstrap.sh b/tasks/0032_014_32014924_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_014_32014924_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_014_32014924_qa_3/environment/pull_bucket.py b/tasks/0032_014_32014924_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_014_32014924_qa_3/environment/pull_bucket.py +++ b/tasks/0032_014_32014924_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_014_32014924_qa_3/task.toml b/tasks/0032_014_32014924_qa_3/task.toml index 97b496b797238d0b7a37369859756b7a6c6f7298..09f1537c510f0582ee38df74c9238f85380548d3 100644 --- a/tasks/0032_014_32014924_qa_3/task.toml +++ b/tasks/0032_014_32014924_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_044_32044463_qa_1/environment/bootstrap.sh b/tasks/0032_044_32044463_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_044_32044463_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_044_32044463_qa_1/environment/pull_bucket.py b/tasks/0032_044_32044463_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_044_32044463_qa_1/environment/pull_bucket.py +++ b/tasks/0032_044_32044463_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_044_32044463_qa_1/task.toml b/tasks/0032_044_32044463_qa_1/task.toml index 2418ef328717e4a34d630950606947127685db7e..54ebc71829e970fc0c8b01a5b958dd3351e53ac1 100644 --- a/tasks/0032_044_32044463_qa_1/task.toml +++ b/tasks/0032_044_32044463_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_054_32054124_qa_5/environment/bootstrap.sh b/tasks/0032_054_32054124_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_054_32054124_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_054_32054124_qa_5/environment/pull_bucket.py b/tasks/0032_054_32054124_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_054_32054124_qa_5/environment/pull_bucket.py +++ b/tasks/0032_054_32054124_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_054_32054124_qa_5/task.toml b/tasks/0032_054_32054124_qa_5/task.toml index 0a016bdddc978806a7f3805f1d3f24651cf15ebf..9c5b470f7367bd0cfaeb325c2bcc1e73977b2c42 100644 --- a/tasks/0032_054_32054124_qa_5/task.toml +++ b/tasks/0032_054_32054124_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_057_32057827_qa_4/environment/bootstrap.sh b/tasks/0032_057_32057827_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_057_32057827_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_057_32057827_qa_4/environment/pull_bucket.py b/tasks/0032_057_32057827_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_057_32057827_qa_4/environment/pull_bucket.py +++ b/tasks/0032_057_32057827_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_057_32057827_qa_4/task.toml b/tasks/0032_057_32057827_qa_4/task.toml index 0ac877cfbade1b66fea262602a45f8d2b6108fce..9cc1bb7948f6d9676a2cee02909a1bb04bf6f9da 100644 --- a/tasks/0032_057_32057827_qa_4/task.toml +++ b/tasks/0032_057_32057827_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_069_32069437_qa_1/environment/bootstrap.sh b/tasks/0032_069_32069437_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_069_32069437_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_069_32069437_qa_1/environment/pull_bucket.py b/tasks/0032_069_32069437_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_069_32069437_qa_1/environment/pull_bucket.py +++ b/tasks/0032_069_32069437_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_069_32069437_qa_1/task.toml b/tasks/0032_069_32069437_qa_1/task.toml index 34582b014eb436bad6ef386972c2e7dfd0254375..694e7aa4dbde0a365ff663ad170a19de96c1fd00 100644 --- a/tasks/0032_069_32069437_qa_1/task.toml +++ b/tasks/0032_069_32069437_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_069_32069437_qa_5/environment/bootstrap.sh b/tasks/0032_069_32069437_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_069_32069437_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_069_32069437_qa_5/environment/pull_bucket.py b/tasks/0032_069_32069437_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_069_32069437_qa_5/environment/pull_bucket.py +++ b/tasks/0032_069_32069437_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_069_32069437_qa_5/task.toml b/tasks/0032_069_32069437_qa_5/task.toml index 10e0c3970845f28e1d5e0415ea07cd6a23e71377..9cbcb138a0d34f90d10c83a5ad0e63021e4316cf 100644 --- a/tasks/0032_069_32069437_qa_5/task.toml +++ b/tasks/0032_069_32069437_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_071_32071401_qa_3/environment/bootstrap.sh b/tasks/0032_071_32071401_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_071_32071401_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_071_32071401_qa_3/environment/pull_bucket.py b/tasks/0032_071_32071401_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_071_32071401_qa_3/environment/pull_bucket.py +++ b/tasks/0032_071_32071401_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_071_32071401_qa_3/task.toml b/tasks/0032_071_32071401_qa_3/task.toml index 7a63dbd9de94819a4476f5364c11d5fd58e4ac83..f71db69aa8ceb393f9263d61a67f17c64788e2b1 100644 --- a/tasks/0032_071_32071401_qa_3/task.toml +++ b/tasks/0032_071_32071401_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_071_32071401_qa_5/environment/bootstrap.sh b/tasks/0032_071_32071401_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_071_32071401_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_071_32071401_qa_5/environment/pull_bucket.py b/tasks/0032_071_32071401_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_071_32071401_qa_5/environment/pull_bucket.py +++ b/tasks/0032_071_32071401_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_071_32071401_qa_5/task.toml b/tasks/0032_071_32071401_qa_5/task.toml index def4260dbb4aafdf33c368c557fea1da2ac0d329..3f8b5f1926e52d93e101445d95a8be7edda8bc2f 100644 --- a/tasks/0032_071_32071401_qa_5/task.toml +++ b/tasks/0032_071_32071401_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_092_32092871_qa_2/environment/bootstrap.sh b/tasks/0032_092_32092871_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_092_32092871_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_092_32092871_qa_2/environment/pull_bucket.py b/tasks/0032_092_32092871_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_092_32092871_qa_2/environment/pull_bucket.py +++ b/tasks/0032_092_32092871_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_092_32092871_qa_2/task.toml b/tasks/0032_092_32092871_qa_2/task.toml index a15d09d94f8121de36cae8d890cd2496a4dc9490..b4f1f6d0f828d7d8d3ac118729890fe364e9a2d6 100644 --- a/tasks/0032_092_32092871_qa_2/task.toml +++ b/tasks/0032_092_32092871_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_093_32093418_qa_4/environment/bootstrap.sh b/tasks/0032_093_32093418_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_093_32093418_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_093_32093418_qa_4/environment/pull_bucket.py b/tasks/0032_093_32093418_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_093_32093418_qa_4/environment/pull_bucket.py +++ b/tasks/0032_093_32093418_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_093_32093418_qa_4/task.toml b/tasks/0032_093_32093418_qa_4/task.toml index c172d30b230bafd973dadac35204ff709d3e9a67..96ad223b3cc484ec460b4e4b64c9abffffbb3c7f 100644 --- a/tasks/0032_093_32093418_qa_4/task.toml +++ b/tasks/0032_093_32093418_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_101_32101676_qa_1/environment/bootstrap.sh b/tasks/0032_101_32101676_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_101_32101676_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_101_32101676_qa_1/environment/pull_bucket.py b/tasks/0032_101_32101676_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_101_32101676_qa_1/environment/pull_bucket.py +++ b/tasks/0032_101_32101676_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_101_32101676_qa_1/task.toml b/tasks/0032_101_32101676_qa_1/task.toml index 8b7e5a79215a91c3743d177c2aefd621770fa447..c3208dc1d40173450deccc61e13c126d01eb1f7b 100644 --- a/tasks/0032_101_32101676_qa_1/task.toml +++ b/tasks/0032_101_32101676_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_101_32101676_qa_2/environment/bootstrap.sh b/tasks/0032_101_32101676_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_101_32101676_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_101_32101676_qa_2/environment/pull_bucket.py b/tasks/0032_101_32101676_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_101_32101676_qa_2/environment/pull_bucket.py +++ b/tasks/0032_101_32101676_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_101_32101676_qa_2/task.toml b/tasks/0032_101_32101676_qa_2/task.toml index c4758a4417ca606483b004c90448037aa34df438..85d39dc7ab52d7cd90d2611433e0d763db4ca06a 100644 --- a/tasks/0032_101_32101676_qa_2/task.toml +++ b/tasks/0032_101_32101676_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_103_32103943_qa_4/environment/bootstrap.sh b/tasks/0032_103_32103943_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_103_32103943_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_103_32103943_qa_4/environment/pull_bucket.py b/tasks/0032_103_32103943_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_103_32103943_qa_4/environment/pull_bucket.py +++ b/tasks/0032_103_32103943_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_103_32103943_qa_4/task.toml b/tasks/0032_103_32103943_qa_4/task.toml index af6dccbb47a6572202d139fcf1865c15cb2c1409..dd2343de0fb762d2cd320641c3477d460256efe7 100644 --- a/tasks/0032_103_32103943_qa_4/task.toml +++ b/tasks/0032_103_32103943_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_178_32178295_qa_2/environment/bootstrap.sh b/tasks/0032_178_32178295_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_178_32178295_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_178_32178295_qa_2/environment/pull_bucket.py b/tasks/0032_178_32178295_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_178_32178295_qa_2/environment/pull_bucket.py +++ b/tasks/0032_178_32178295_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_178_32178295_qa_2/task.toml b/tasks/0032_178_32178295_qa_2/task.toml index 572eb03cc808a478a99c9c0b8b7ab3f50ed70c49..4f6ca7f71f077a1728c896a678a6c4fafbe0df81 100644 --- a/tasks/0032_178_32178295_qa_2/task.toml +++ b/tasks/0032_178_32178295_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_205_32205594_qa_1/environment/bootstrap.sh b/tasks/0032_205_32205594_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_205_32205594_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_205_32205594_qa_1/environment/pull_bucket.py b/tasks/0032_205_32205594_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_205_32205594_qa_1/environment/pull_bucket.py +++ b/tasks/0032_205_32205594_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_205_32205594_qa_1/task.toml b/tasks/0032_205_32205594_qa_1/task.toml index 3572818820e2da45563be4d32692b7cfa81d0b1b..ac510dd73ede7f1f4a434597dd4fc4bf5c7a6967 100644 --- a/tasks/0032_205_32205594_qa_1/task.toml +++ b/tasks/0032_205_32205594_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_205_32205594_qa_3/environment/bootstrap.sh b/tasks/0032_205_32205594_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_205_32205594_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_205_32205594_qa_3/environment/pull_bucket.py b/tasks/0032_205_32205594_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_205_32205594_qa_3/environment/pull_bucket.py +++ b/tasks/0032_205_32205594_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_205_32205594_qa_3/task.toml b/tasks/0032_205_32205594_qa_3/task.toml index 7de6635f7ed885bc1d35466552e7d67300fc1ba5..78c619229abe909d3c8c9a62e15f798ba2c95eb2 100644 --- a/tasks/0032_205_32205594_qa_3/task.toml +++ b/tasks/0032_205_32205594_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_205_32205594_qa_4/environment/bootstrap.sh b/tasks/0032_205_32205594_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_205_32205594_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_205_32205594_qa_4/environment/pull_bucket.py b/tasks/0032_205_32205594_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_205_32205594_qa_4/environment/pull_bucket.py +++ b/tasks/0032_205_32205594_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_205_32205594_qa_4/task.toml b/tasks/0032_205_32205594_qa_4/task.toml index de256d208f6f56e92965374a5b69a9ff91ea8326..f5232498eed78d2dfc2c5e09f6fadc042ef3c8ab 100644 --- a/tasks/0032_205_32205594_qa_4/task.toml +++ b/tasks/0032_205_32205594_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_211_32211559_qa_1/environment/bootstrap.sh b/tasks/0032_211_32211559_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_211_32211559_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_211_32211559_qa_1/environment/pull_bucket.py b/tasks/0032_211_32211559_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_211_32211559_qa_1/environment/pull_bucket.py +++ b/tasks/0032_211_32211559_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_211_32211559_qa_1/task.toml b/tasks/0032_211_32211559_qa_1/task.toml index 6e83c622f4f0acda0296af235fd3dc59cdca7fff..7ce01a0302e7241cd5f90529f0e3fdfa0ee4fee2 100644 --- a/tasks/0032_211_32211559_qa_1/task.toml +++ b/tasks/0032_211_32211559_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_211_32211559_qa_5/environment/bootstrap.sh b/tasks/0032_211_32211559_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_211_32211559_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_211_32211559_qa_5/environment/pull_bucket.py b/tasks/0032_211_32211559_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_211_32211559_qa_5/environment/pull_bucket.py +++ b/tasks/0032_211_32211559_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_211_32211559_qa_5/task.toml b/tasks/0032_211_32211559_qa_5/task.toml index 1734993bd021185829abefba4b503d978426b67c..d6897ed5dc0d87b9a0736d6b6f0885461bd49ae1 100644 --- a/tasks/0032_211_32211559_qa_5/task.toml +++ b/tasks/0032_211_32211559_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_216_32216997_qa_2/environment/bootstrap.sh b/tasks/0032_216_32216997_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_216_32216997_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_216_32216997_qa_2/environment/pull_bucket.py b/tasks/0032_216_32216997_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_216_32216997_qa_2/environment/pull_bucket.py +++ b/tasks/0032_216_32216997_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_216_32216997_qa_2/task.toml b/tasks/0032_216_32216997_qa_2/task.toml index 9ae7c7e679536670d76b097a5ff10a2351b9ce37..4b17add201233727f21abe3fa380f579c5f59838 100644 --- a/tasks/0032_216_32216997_qa_2/task.toml +++ b/tasks/0032_216_32216997_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_222_32222371_qa_1/environment/bootstrap.sh b/tasks/0032_222_32222371_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_222_32222371_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_222_32222371_qa_1/environment/pull_bucket.py b/tasks/0032_222_32222371_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_222_32222371_qa_1/environment/pull_bucket.py +++ b/tasks/0032_222_32222371_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_222_32222371_qa_1/task.toml b/tasks/0032_222_32222371_qa_1/task.toml index d802f1ee13903c226decb3a592b60d77b9052140..8c411f0ff46c8c8cdf6bc89466113dea64fae6e5 100644 --- a/tasks/0032_222_32222371_qa_1/task.toml +++ b/tasks/0032_222_32222371_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_281_32281132_qa_4/environment/bootstrap.sh b/tasks/0032_281_32281132_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_281_32281132_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_281_32281132_qa_4/environment/pull_bucket.py b/tasks/0032_281_32281132_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_281_32281132_qa_4/environment/pull_bucket.py +++ b/tasks/0032_281_32281132_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_281_32281132_qa_4/task.toml b/tasks/0032_281_32281132_qa_4/task.toml index 00a0bed04e1a62f26083ca8ccc6decf84db7b57d..012c2864f4ef0cf9ff72d111f8f9fb88b08c8422 100644 --- a/tasks/0032_281_32281132_qa_4/task.toml +++ b/tasks/0032_281_32281132_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_281_32281132_qa_5/environment/bootstrap.sh b/tasks/0032_281_32281132_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_281_32281132_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_281_32281132_qa_5/environment/pull_bucket.py b/tasks/0032_281_32281132_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_281_32281132_qa_5/environment/pull_bucket.py +++ b/tasks/0032_281_32281132_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_281_32281132_qa_5/task.toml b/tasks/0032_281_32281132_qa_5/task.toml index 113561f9d0e0a54c92244fd9596a9ec2fd9fface..26b09f835f8eef343b33adfeb9b0a213f7fd4511 100644 --- a/tasks/0032_281_32281132_qa_5/task.toml +++ b/tasks/0032_281_32281132_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_310_32310373_qa_3/environment/bootstrap.sh b/tasks/0032_310_32310373_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_310_32310373_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_310_32310373_qa_3/environment/pull_bucket.py b/tasks/0032_310_32310373_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_310_32310373_qa_3/environment/pull_bucket.py +++ b/tasks/0032_310_32310373_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_310_32310373_qa_3/task.toml b/tasks/0032_310_32310373_qa_3/task.toml index 5b019061d5f0ed866d3fd55e0897ec7cbe4c49d4..d0cae2540a9e655e86f086f99987b586695d2739 100644 --- a/tasks/0032_310_32310373_qa_3/task.toml +++ b/tasks/0032_310_32310373_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_310_32310373_qa_5/environment/bootstrap.sh b/tasks/0032_310_32310373_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_310_32310373_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_310_32310373_qa_5/environment/pull_bucket.py b/tasks/0032_310_32310373_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_310_32310373_qa_5/environment/pull_bucket.py +++ b/tasks/0032_310_32310373_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_310_32310373_qa_5/task.toml b/tasks/0032_310_32310373_qa_5/task.toml index f6f368df8ba539ca49048331dd30dd6b9a040153..3f44c7bb95f1715566998a236c2ed073e6885d6e 100644 --- a/tasks/0032_310_32310373_qa_5/task.toml +++ b/tasks/0032_310_32310373_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_314_32314190_qa_3/environment/bootstrap.sh b/tasks/0032_314_32314190_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_314_32314190_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_314_32314190_qa_3/environment/pull_bucket.py b/tasks/0032_314_32314190_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_314_32314190_qa_3/environment/pull_bucket.py +++ b/tasks/0032_314_32314190_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_314_32314190_qa_3/task.toml b/tasks/0032_314_32314190_qa_3/task.toml index f5f85d54b1a4eddf003afb2bfe4a0598bd49cc03..e35d4191dd330ac81f9613ae4e97b52259ffffd7 100644 --- a/tasks/0032_314_32314190_qa_3/task.toml +++ b/tasks/0032_314_32314190_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_314_32314190_qa_4/environment/bootstrap.sh b/tasks/0032_314_32314190_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_314_32314190_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_314_32314190_qa_4/environment/pull_bucket.py b/tasks/0032_314_32314190_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_314_32314190_qa_4/environment/pull_bucket.py +++ b/tasks/0032_314_32314190_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_314_32314190_qa_4/task.toml b/tasks/0032_314_32314190_qa_4/task.toml index b6f1efcf753aa36f7f44b65a482c1e5bf9f0fd81..27f903d0d1cafd38f577b87596b9c120cec8e269 100644 --- a/tasks/0032_314_32314190_qa_4/task.toml +++ b/tasks/0032_314_32314190_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_317_32317961_qa_1/environment/bootstrap.sh b/tasks/0032_317_32317961_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_317_32317961_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_317_32317961_qa_1/environment/pull_bucket.py b/tasks/0032_317_32317961_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_317_32317961_qa_1/environment/pull_bucket.py +++ b/tasks/0032_317_32317961_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_317_32317961_qa_1/task.toml b/tasks/0032_317_32317961_qa_1/task.toml index 75fccd7cce2f3c08f789b77328ae58e0b241eedb..5083926399da7d962856495091f886c16aa64903 100644 --- a/tasks/0032_317_32317961_qa_1/task.toml +++ b/tasks/0032_317_32317961_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_317_32317961_qa_2/environment/bootstrap.sh b/tasks/0032_317_32317961_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_317_32317961_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_317_32317961_qa_2/environment/pull_bucket.py b/tasks/0032_317_32317961_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_317_32317961_qa_2/environment/pull_bucket.py +++ b/tasks/0032_317_32317961_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_317_32317961_qa_2/task.toml b/tasks/0032_317_32317961_qa_2/task.toml index 8cf250a09d029dfeae882467ea9661f33875ceb0..1abb2699c50d63f17f484537655187a5bb43d5cc 100644 --- a/tasks/0032_317_32317961_qa_2/task.toml +++ b/tasks/0032_317_32317961_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_337_32337163_qa_5/environment/bootstrap.sh b/tasks/0032_337_32337163_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_337_32337163_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_337_32337163_qa_5/environment/pull_bucket.py b/tasks/0032_337_32337163_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_337_32337163_qa_5/environment/pull_bucket.py +++ b/tasks/0032_337_32337163_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_337_32337163_qa_5/task.toml b/tasks/0032_337_32337163_qa_5/task.toml index eec3a277689b0bd7d845fb76dc129d4f9cb45251..7cc32bd771025ccfc8d17fbc3735eda8c49406e8 100644 --- a/tasks/0032_337_32337163_qa_5/task.toml +++ b/tasks/0032_337_32337163_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_337_32337518_qa_4/environment/bootstrap.sh b/tasks/0032_337_32337518_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_337_32337518_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_337_32337518_qa_4/environment/pull_bucket.py b/tasks/0032_337_32337518_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_337_32337518_qa_4/environment/pull_bucket.py +++ b/tasks/0032_337_32337518_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_337_32337518_qa_4/task.toml b/tasks/0032_337_32337518_qa_4/task.toml index c5882585082309319cf77a7ac8f77a1542ff8ad0..16f9707831b513c67ca5562063c2b5c4364f94e1 100644 --- a/tasks/0032_337_32337518_qa_4/task.toml +++ b/tasks/0032_337_32337518_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_340_32340135_qa_5/environment/bootstrap.sh b/tasks/0032_340_32340135_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_340_32340135_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_340_32340135_qa_5/environment/pull_bucket.py b/tasks/0032_340_32340135_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_340_32340135_qa_5/environment/pull_bucket.py +++ b/tasks/0032_340_32340135_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_340_32340135_qa_5/task.toml b/tasks/0032_340_32340135_qa_5/task.toml index 6008c4dca53048b6d87643990b5c23597e5c4e7d..8f5485a0f6c340b3f4635b7f530725771440a858 100644 --- a/tasks/0032_340_32340135_qa_5/task.toml +++ b/tasks/0032_340_32340135_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_340_32340712_qa_1/environment/bootstrap.sh b/tasks/0032_340_32340712_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_340_32340712_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_340_32340712_qa_1/environment/pull_bucket.py b/tasks/0032_340_32340712_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_340_32340712_qa_1/environment/pull_bucket.py +++ b/tasks/0032_340_32340712_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_340_32340712_qa_1/task.toml b/tasks/0032_340_32340712_qa_1/task.toml index c113842bc0b1c14b26442e6015058a26ecb48464..1d71950a38e1d84f93cf52c8152f10e8dfaae264 100644 --- a/tasks/0032_340_32340712_qa_1/task.toml +++ b/tasks/0032_340_32340712_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_350_32350811_qa_5/environment/bootstrap.sh b/tasks/0032_350_32350811_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_350_32350811_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_350_32350811_qa_5/environment/pull_bucket.py b/tasks/0032_350_32350811_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_350_32350811_qa_5/environment/pull_bucket.py +++ b/tasks/0032_350_32350811_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_350_32350811_qa_5/task.toml b/tasks/0032_350_32350811_qa_5/task.toml index 45f892ca4cc6fb75879159135461ae7ab1a2a817..d646c13707e5a84ec5a23ebe7fb91c8d7a672588 100644 --- a/tasks/0032_350_32350811_qa_5/task.toml +++ b/tasks/0032_350_32350811_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_386_32386426_qa_2/environment/bootstrap.sh b/tasks/0032_386_32386426_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_386_32386426_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_386_32386426_qa_2/environment/pull_bucket.py b/tasks/0032_386_32386426_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_386_32386426_qa_2/environment/pull_bucket.py +++ b/tasks/0032_386_32386426_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_386_32386426_qa_2/task.toml b/tasks/0032_386_32386426_qa_2/task.toml index cb24f7d1479c396317537b477bd4e1fb6a624a9e..dc2eb30404021a0d7ec363e1253f8eceb636ceac 100644 --- a/tasks/0032_386_32386426_qa_2/task.toml +++ b/tasks/0032_386_32386426_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_386_32386426_qa_3/environment/bootstrap.sh b/tasks/0032_386_32386426_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_386_32386426_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_386_32386426_qa_3/environment/pull_bucket.py b/tasks/0032_386_32386426_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_386_32386426_qa_3/environment/pull_bucket.py +++ b/tasks/0032_386_32386426_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_386_32386426_qa_3/task.toml b/tasks/0032_386_32386426_qa_3/task.toml index 1d64a6ca21095a21c80bf3342c033159e0adb038..a4ac7d3d087e56fbd0f6631c5eace211c47d1f78 100644 --- a/tasks/0032_386_32386426_qa_3/task.toml +++ b/tasks/0032_386_32386426_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_431_32431999_qa_1/environment/bootstrap.sh b/tasks/0032_431_32431999_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_431_32431999_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_431_32431999_qa_1/environment/pull_bucket.py b/tasks/0032_431_32431999_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_431_32431999_qa_1/environment/pull_bucket.py +++ b/tasks/0032_431_32431999_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_431_32431999_qa_1/task.toml b/tasks/0032_431_32431999_qa_1/task.toml index 3601bd19b3dab70f0cbd9e5f6081262353bd5bd1..7171f63fedfdbae9d0f3482aee3faeb3e9085235 100644 --- a/tasks/0032_431_32431999_qa_1/task.toml +++ b/tasks/0032_431_32431999_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_431_32431999_qa_2/environment/bootstrap.sh b/tasks/0032_431_32431999_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_431_32431999_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_431_32431999_qa_2/environment/pull_bucket.py b/tasks/0032_431_32431999_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_431_32431999_qa_2/environment/pull_bucket.py +++ b/tasks/0032_431_32431999_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_431_32431999_qa_2/task.toml b/tasks/0032_431_32431999_qa_2/task.toml index 806480867a99660f726ab33eecf97f5a565d4d78..f4b5efda495e620d4cb0a7c7292110fb798303fe 100644 --- a/tasks/0032_431_32431999_qa_2/task.toml +++ b/tasks/0032_431_32431999_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_431_32431999_qa_5/environment/bootstrap.sh b/tasks/0032_431_32431999_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_431_32431999_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_431_32431999_qa_5/environment/pull_bucket.py b/tasks/0032_431_32431999_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_431_32431999_qa_5/environment/pull_bucket.py +++ b/tasks/0032_431_32431999_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_431_32431999_qa_5/task.toml b/tasks/0032_431_32431999_qa_5/task.toml index 6741c71bfe8ca66f72936efa83573dcb86829529..63d97c4690a1bb5985d428d3ada56ed20ab7265b 100644 --- a/tasks/0032_431_32431999_qa_5/task.toml +++ b/tasks/0032_431_32431999_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_442_32442771_qa_3/environment/bootstrap.sh b/tasks/0032_442_32442771_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_442_32442771_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_442_32442771_qa_3/environment/pull_bucket.py b/tasks/0032_442_32442771_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_442_32442771_qa_3/environment/pull_bucket.py +++ b/tasks/0032_442_32442771_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_442_32442771_qa_3/task.toml b/tasks/0032_442_32442771_qa_3/task.toml index a5551e4d9d3569f25487cf6b73c50db26557a625..1a4435cc74da47e8eb440afab8be7f49ea9c7951 100644 --- a/tasks/0032_442_32442771_qa_3/task.toml +++ b/tasks/0032_442_32442771_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_458_32458821_qa_4/environment/bootstrap.sh b/tasks/0032_458_32458821_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_458_32458821_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_458_32458821_qa_4/environment/pull_bucket.py b/tasks/0032_458_32458821_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_458_32458821_qa_4/environment/pull_bucket.py +++ b/tasks/0032_458_32458821_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_458_32458821_qa_4/task.toml b/tasks/0032_458_32458821_qa_4/task.toml index a389aaba21adcb736ebea50fca2d8df668c84a66..6860471fd35380b96d749fd58a387e3b87158b43 100644 --- a/tasks/0032_458_32458821_qa_4/task.toml +++ b/tasks/0032_458_32458821_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_458_32458821_qa_5/environment/bootstrap.sh b/tasks/0032_458_32458821_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_458_32458821_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_458_32458821_qa_5/environment/pull_bucket.py b/tasks/0032_458_32458821_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_458_32458821_qa_5/environment/pull_bucket.py +++ b/tasks/0032_458_32458821_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_458_32458821_qa_5/task.toml b/tasks/0032_458_32458821_qa_5/task.toml index b9b18d21f6f18cb5c4f994ba2fcf4878b61994e6..9b19238a9c019c973e2a70dbfec9a31abca41ace 100644 --- a/tasks/0032_458_32458821_qa_5/task.toml +++ b/tasks/0032_458_32458821_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_488_32488845_qa_3/environment/bootstrap.sh b/tasks/0032_488_32488845_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_488_32488845_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_488_32488845_qa_3/environment/pull_bucket.py b/tasks/0032_488_32488845_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_488_32488845_qa_3/environment/pull_bucket.py +++ b/tasks/0032_488_32488845_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_488_32488845_qa_3/task.toml b/tasks/0032_488_32488845_qa_3/task.toml index c938d6faa67dc08a819a7ebf683e2f9fcffc809b..8df84880bf9d6d6c9718e950934907d98a315d01 100644 --- a/tasks/0032_488_32488845_qa_3/task.toml +++ b/tasks/0032_488_32488845_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_515_32515991_qa_5/environment/bootstrap.sh b/tasks/0032_515_32515991_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_515_32515991_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_515_32515991_qa_5/environment/pull_bucket.py b/tasks/0032_515_32515991_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_515_32515991_qa_5/environment/pull_bucket.py +++ b/tasks/0032_515_32515991_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_515_32515991_qa_5/task.toml b/tasks/0032_515_32515991_qa_5/task.toml index 2bb0bc39fd2eb5520a99f60a027e964747eb6539..4df2753729f525ccd57dd001ad8cc0ee9b5c6cc7 100644 --- a/tasks/0032_515_32515991_qa_5/task.toml +++ b/tasks/0032_515_32515991_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_535_32535593_qa_1/environment/bootstrap.sh b/tasks/0032_535_32535593_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_535_32535593_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_535_32535593_qa_1/environment/pull_bucket.py b/tasks/0032_535_32535593_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_535_32535593_qa_1/environment/pull_bucket.py +++ b/tasks/0032_535_32535593_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_535_32535593_qa_1/task.toml b/tasks/0032_535_32535593_qa_1/task.toml index 967a89ac86d44eec16028ce95c92d01d5e529120..5a2fdb175ca3a21016b1f6610135c1f1095b7686 100644 --- a/tasks/0032_535_32535593_qa_1/task.toml +++ b/tasks/0032_535_32535593_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_553_32553847_qa_1/environment/bootstrap.sh b/tasks/0032_553_32553847_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_553_32553847_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_553_32553847_qa_1/environment/pull_bucket.py b/tasks/0032_553_32553847_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_553_32553847_qa_1/environment/pull_bucket.py +++ b/tasks/0032_553_32553847_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_553_32553847_qa_1/task.toml b/tasks/0032_553_32553847_qa_1/task.toml index 67636c4df79f0111c07e6c7ebc0d9894b50d93b6..320d66e75b5b14919dabce10b40c7e0774be33aa 100644 --- a/tasks/0032_553_32553847_qa_1/task.toml +++ b/tasks/0032_553_32553847_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_553_32553847_qa_3/environment/bootstrap.sh b/tasks/0032_553_32553847_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_553_32553847_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_553_32553847_qa_3/environment/pull_bucket.py b/tasks/0032_553_32553847_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_553_32553847_qa_3/environment/pull_bucket.py +++ b/tasks/0032_553_32553847_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_553_32553847_qa_3/task.toml b/tasks/0032_553_32553847_qa_3/task.toml index eb8e23f07973a0216e9e0a375d2de1808160aace..56a3671a3aa488dc781d6aba9ed1455280b94238 100644 --- a/tasks/0032_553_32553847_qa_3/task.toml +++ b/tasks/0032_553_32553847_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_553_32553847_qa_5/environment/bootstrap.sh b/tasks/0032_553_32553847_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_553_32553847_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_553_32553847_qa_5/environment/pull_bucket.py b/tasks/0032_553_32553847_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_553_32553847_qa_5/environment/pull_bucket.py +++ b/tasks/0032_553_32553847_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_553_32553847_qa_5/task.toml b/tasks/0032_553_32553847_qa_5/task.toml index bd2cdd3fec6328dd35c55f6bdc4e341022d4c3b7..9784b79e5e787306f7773b4149a81f7dce4d4e76 100644 --- a/tasks/0032_553_32553847_qa_5/task.toml +++ b/tasks/0032_553_32553847_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_573_32573322_qa_2/environment/bootstrap.sh b/tasks/0032_573_32573322_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_573_32573322_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_573_32573322_qa_2/environment/pull_bucket.py b/tasks/0032_573_32573322_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_573_32573322_qa_2/environment/pull_bucket.py +++ b/tasks/0032_573_32573322_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_573_32573322_qa_2/task.toml b/tasks/0032_573_32573322_qa_2/task.toml index 9e298d4a8fcb9a89599fa328ce4c3d8104cd5c1d..9dcc73a8eb24adff047fd45308c012295f06fa86 100644 --- a/tasks/0032_573_32573322_qa_2/task.toml +++ b/tasks/0032_573_32573322_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_583_32583396_qa_2/environment/bootstrap.sh b/tasks/0032_583_32583396_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_583_32583396_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_583_32583396_qa_2/environment/pull_bucket.py b/tasks/0032_583_32583396_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_583_32583396_qa_2/environment/pull_bucket.py +++ b/tasks/0032_583_32583396_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_583_32583396_qa_2/task.toml b/tasks/0032_583_32583396_qa_2/task.toml index 96447ced8484f714b341ff5d7436e91a0a7411b3..2b8968e9163399527b6d978bdc553175f879cb65 100644 --- a/tasks/0032_583_32583396_qa_2/task.toml +++ b/tasks/0032_583_32583396_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_614_32614408_qa_1/environment/bootstrap.sh b/tasks/0032_614_32614408_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_614_32614408_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_614_32614408_qa_1/environment/pull_bucket.py b/tasks/0032_614_32614408_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_614_32614408_qa_1/environment/pull_bucket.py +++ b/tasks/0032_614_32614408_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_614_32614408_qa_1/task.toml b/tasks/0032_614_32614408_qa_1/task.toml index 466b872cf298ad4a95742414a2aac0e822f2e6a8..3e7eb3409b2be0ef0900321ed925f8d62eff2f21 100644 --- a/tasks/0032_614_32614408_qa_1/task.toml +++ b/tasks/0032_614_32614408_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_631_32631784_qa_4/environment/bootstrap.sh b/tasks/0032_631_32631784_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_631_32631784_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_631_32631784_qa_4/environment/pull_bucket.py b/tasks/0032_631_32631784_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_631_32631784_qa_4/environment/pull_bucket.py +++ b/tasks/0032_631_32631784_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_631_32631784_qa_4/task.toml b/tasks/0032_631_32631784_qa_4/task.toml index b68dae1ac4c2f22c04e82d6721aa39e78eab8751..5255a0c615e9431938dd758d4e0f0f0b1ee587e3 100644 --- a/tasks/0032_631_32631784_qa_4/task.toml +++ b/tasks/0032_631_32631784_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_680_32680563_qa_2/environment/bootstrap.sh b/tasks/0032_680_32680563_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_680_32680563_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_680_32680563_qa_2/environment/pull_bucket.py b/tasks/0032_680_32680563_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_680_32680563_qa_2/environment/pull_bucket.py +++ b/tasks/0032_680_32680563_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_680_32680563_qa_2/task.toml b/tasks/0032_680_32680563_qa_2/task.toml index dde066d72581120fd352154e6607cb99efd1d839..c057babe9f1b99a92ceb8aad8bc18606533b9a56 100644 --- a/tasks/0032_680_32680563_qa_2/task.toml +++ b/tasks/0032_680_32680563_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_686_32686448_qa_1/environment/bootstrap.sh b/tasks/0032_686_32686448_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_686_32686448_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_686_32686448_qa_1/environment/pull_bucket.py b/tasks/0032_686_32686448_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_686_32686448_qa_1/environment/pull_bucket.py +++ b/tasks/0032_686_32686448_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_686_32686448_qa_1/task.toml b/tasks/0032_686_32686448_qa_1/task.toml index 6ac9f3ce6d307514d725e5550db90e670426969d..ad0d76c9420c48ecde4e1d7e95709fccf2b5eae5 100644 --- a/tasks/0032_686_32686448_qa_1/task.toml +++ b/tasks/0032_686_32686448_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_686_32686448_qa_2/environment/bootstrap.sh b/tasks/0032_686_32686448_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_686_32686448_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_686_32686448_qa_2/environment/pull_bucket.py b/tasks/0032_686_32686448_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_686_32686448_qa_2/environment/pull_bucket.py +++ b/tasks/0032_686_32686448_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_686_32686448_qa_2/task.toml b/tasks/0032_686_32686448_qa_2/task.toml index fd0813e11d9b0b3ca960b6651d9db2b55ea8e433..218d1c1a14e6a6c3711bd56bf66cfe25447b671b 100644 --- a/tasks/0032_686_32686448_qa_2/task.toml +++ b/tasks/0032_686_32686448_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_686_32686448_qa_4/environment/bootstrap.sh b/tasks/0032_686_32686448_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_686_32686448_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_686_32686448_qa_4/environment/pull_bucket.py b/tasks/0032_686_32686448_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_686_32686448_qa_4/environment/pull_bucket.py +++ b/tasks/0032_686_32686448_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_686_32686448_qa_4/task.toml b/tasks/0032_686_32686448_qa_4/task.toml index 6d800af0a1c428e73226da1a26587087e96ecdea..3e9af6110ab0e743ad38cebd4e62f7472df8e1c4 100644 --- a/tasks/0032_686_32686448_qa_4/task.toml +++ b/tasks/0032_686_32686448_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_699_32699731_qa_4/environment/bootstrap.sh b/tasks/0032_699_32699731_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_699_32699731_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_699_32699731_qa_4/environment/pull_bucket.py b/tasks/0032_699_32699731_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_699_32699731_qa_4/environment/pull_bucket.py +++ b/tasks/0032_699_32699731_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_699_32699731_qa_4/task.toml b/tasks/0032_699_32699731_qa_4/task.toml index 0b55868c7591d18af56d0edabf984e24f06d2b78..3de258079f1e8198ba22cf68efb698921a799998 100644 --- a/tasks/0032_699_32699731_qa_4/task.toml +++ b/tasks/0032_699_32699731_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_714_32714901_qa_2/environment/bootstrap.sh b/tasks/0032_714_32714901_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_714_32714901_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_714_32714901_qa_2/environment/pull_bucket.py b/tasks/0032_714_32714901_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_714_32714901_qa_2/environment/pull_bucket.py +++ b/tasks/0032_714_32714901_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_714_32714901_qa_2/task.toml b/tasks/0032_714_32714901_qa_2/task.toml index 73cdd0d9e015016c0a7dc26bd8d2e20afd61a183..d16b45f672790b667d7db677751e5661ebf8aec4 100644 --- a/tasks/0032_714_32714901_qa_2/task.toml +++ b/tasks/0032_714_32714901_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_714_32714901_qa_3/environment/bootstrap.sh b/tasks/0032_714_32714901_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_714_32714901_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_714_32714901_qa_3/environment/pull_bucket.py b/tasks/0032_714_32714901_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_714_32714901_qa_3/environment/pull_bucket.py +++ b/tasks/0032_714_32714901_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_714_32714901_qa_3/task.toml b/tasks/0032_714_32714901_qa_3/task.toml index 1f66e18831b80d54e965614f9907ab1af2375c2a..0f97014caaa650e94e9bc32c481e95df82762520 100644 --- a/tasks/0032_714_32714901_qa_3/task.toml +++ b/tasks/0032_714_32714901_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_734_32734784_qa_3/environment/bootstrap.sh b/tasks/0032_734_32734784_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_734_32734784_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_734_32734784_qa_3/environment/pull_bucket.py b/tasks/0032_734_32734784_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_734_32734784_qa_3/environment/pull_bucket.py +++ b/tasks/0032_734_32734784_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_734_32734784_qa_3/task.toml b/tasks/0032_734_32734784_qa_3/task.toml index efd040f9064ad1c222bcde66c164e976d392eebc..cea496c2ac23cf4af3455c2dd9cfb1f830c47751 100644 --- a/tasks/0032_734_32734784_qa_3/task.toml +++ b/tasks/0032_734_32734784_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_769_32769596_qa_1/environment/bootstrap.sh b/tasks/0032_769_32769596_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_769_32769596_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_769_32769596_qa_1/environment/pull_bucket.py b/tasks/0032_769_32769596_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_769_32769596_qa_1/environment/pull_bucket.py +++ b/tasks/0032_769_32769596_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_769_32769596_qa_1/task.toml b/tasks/0032_769_32769596_qa_1/task.toml index 6aa5defcea1c7a880679715416cb23a5e5e4339d..a20a9ee267de0040433039647f2eb883b5523033 100644 --- a/tasks/0032_769_32769596_qa_1/task.toml +++ b/tasks/0032_769_32769596_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_769_32769596_qa_3/environment/bootstrap.sh b/tasks/0032_769_32769596_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_769_32769596_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_769_32769596_qa_3/environment/pull_bucket.py b/tasks/0032_769_32769596_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_769_32769596_qa_3/environment/pull_bucket.py +++ b/tasks/0032_769_32769596_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_769_32769596_qa_3/task.toml b/tasks/0032_769_32769596_qa_3/task.toml index 179a6e240e4c71a2db6fe01362db8d2c4f5edb28..9d2e623a6478a44a78558cfe77b6f7e7a3d03106 100644 --- a/tasks/0032_769_32769596_qa_3/task.toml +++ b/tasks/0032_769_32769596_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_782_32782251_qa_1/environment/bootstrap.sh b/tasks/0032_782_32782251_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_782_32782251_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_782_32782251_qa_1/environment/pull_bucket.py b/tasks/0032_782_32782251_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_782_32782251_qa_1/environment/pull_bucket.py +++ b/tasks/0032_782_32782251_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_782_32782251_qa_1/task.toml b/tasks/0032_782_32782251_qa_1/task.toml index 21d9cc3e81637390cc7c3a3824ed1dc03352aa8a..209d49e406149f9ffdc3bfb389d7f15157a41c17 100644 --- a/tasks/0032_782_32782251_qa_1/task.toml +++ b/tasks/0032_782_32782251_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_842_32842401_qa_1/environment/bootstrap.sh b/tasks/0032_842_32842401_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_842_32842401_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_842_32842401_qa_1/environment/pull_bucket.py b/tasks/0032_842_32842401_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_842_32842401_qa_1/environment/pull_bucket.py +++ b/tasks/0032_842_32842401_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_842_32842401_qa_1/task.toml b/tasks/0032_842_32842401_qa_1/task.toml index a2a310830dc4c7652868d64c22780c8e1aaed6c3..33b0a273e72e2c7709e4c8aeef32f96d02095777 100644 --- a/tasks/0032_842_32842401_qa_1/task.toml +++ b/tasks/0032_842_32842401_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_842_32842401_qa_5/environment/bootstrap.sh b/tasks/0032_842_32842401_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_842_32842401_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_842_32842401_qa_5/environment/pull_bucket.py b/tasks/0032_842_32842401_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_842_32842401_qa_5/environment/pull_bucket.py +++ b/tasks/0032_842_32842401_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_842_32842401_qa_5/task.toml b/tasks/0032_842_32842401_qa_5/task.toml index f27efb257353c27082260c9da24f5df1e30860f5..36ec08c804a4067c4ae9918f0e14d85c0e265bc1 100644 --- a/tasks/0032_842_32842401_qa_5/task.toml +++ b/tasks/0032_842_32842401_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_867_32867580_qa_1/environment/bootstrap.sh b/tasks/0032_867_32867580_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_867_32867580_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_867_32867580_qa_1/environment/pull_bucket.py b/tasks/0032_867_32867580_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_867_32867580_qa_1/environment/pull_bucket.py +++ b/tasks/0032_867_32867580_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_867_32867580_qa_1/task.toml b/tasks/0032_867_32867580_qa_1/task.toml index 58acacfb9aa7ac78bb1e49c22961709e052c30ac..7204ea1ecaa9c46c606784e2551a19626c0391c0 100644 --- a/tasks/0032_867_32867580_qa_1/task.toml +++ b/tasks/0032_867_32867580_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_867_32867580_qa_4/environment/bootstrap.sh b/tasks/0032_867_32867580_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_867_32867580_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_867_32867580_qa_4/environment/pull_bucket.py b/tasks/0032_867_32867580_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_867_32867580_qa_4/environment/pull_bucket.py +++ b/tasks/0032_867_32867580_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_867_32867580_qa_4/task.toml b/tasks/0032_867_32867580_qa_4/task.toml index f977c54534395262b30d2ec92a7827c295eb1a82..224f8ada6900a3c370b8e8c821e9a390a98385b0 100644 --- a/tasks/0032_867_32867580_qa_4/task.toml +++ b/tasks/0032_867_32867580_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_867_32867580_qa_5/environment/bootstrap.sh b/tasks/0032_867_32867580_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_867_32867580_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_867_32867580_qa_5/environment/pull_bucket.py b/tasks/0032_867_32867580_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_867_32867580_qa_5/environment/pull_bucket.py +++ b/tasks/0032_867_32867580_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_867_32867580_qa_5/task.toml b/tasks/0032_867_32867580_qa_5/task.toml index 5d175ca0ea0c164d931e109d1a495f5ec00f2a34..cf1f08d1576f3a86cb10c13ce91969ba6c2a113d 100644 --- a/tasks/0032_867_32867580_qa_5/task.toml +++ b/tasks/0032_867_32867580_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_945_32945624_qa_2/environment/bootstrap.sh b/tasks/0032_945_32945624_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_945_32945624_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_945_32945624_qa_2/environment/pull_bucket.py b/tasks/0032_945_32945624_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_945_32945624_qa_2/environment/pull_bucket.py +++ b/tasks/0032_945_32945624_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_945_32945624_qa_2/task.toml b/tasks/0032_945_32945624_qa_2/task.toml index 299f5f483eb6c64b3829dd7b06ed71fda831a8b1..8f3768de18a67adeabc63e2bba4c9e2144f470df 100644 --- a/tasks/0032_945_32945624_qa_2/task.toml +++ b/tasks/0032_945_32945624_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0032_988_32988907_qa_4/environment/bootstrap.sh b/tasks/0032_988_32988907_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0032_988_32988907_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0032_988_32988907_qa_4/environment/pull_bucket.py b/tasks/0032_988_32988907_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0032_988_32988907_qa_4/environment/pull_bucket.py +++ b/tasks/0032_988_32988907_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0032_988_32988907_qa_4/task.toml b/tasks/0032_988_32988907_qa_4/task.toml index 4d7026b0ac4495484621649df76feda1b470c493..d2cdb2efe3c482098466e9606ca42b63a5aa010c 100644 --- a/tasks/0032_988_32988907_qa_4/task.toml +++ b/tasks/0032_988_32988907_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_057_33057679_qa_1/environment/bootstrap.sh b/tasks/0033_057_33057679_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_057_33057679_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_057_33057679_qa_1/environment/pull_bucket.py b/tasks/0033_057_33057679_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_057_33057679_qa_1/environment/pull_bucket.py +++ b/tasks/0033_057_33057679_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_057_33057679_qa_1/task.toml b/tasks/0033_057_33057679_qa_1/task.toml index d305792e2e9614f716f795b12aae23969b7ddc7f..16145793d960b80b7e7a9e15eca895c393a857d8 100644 --- a/tasks/0033_057_33057679_qa_1/task.toml +++ b/tasks/0033_057_33057679_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_061_33061669_qa_1/environment/bootstrap.sh b/tasks/0033_061_33061669_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_061_33061669_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_061_33061669_qa_1/environment/pull_bucket.py b/tasks/0033_061_33061669_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_061_33061669_qa_1/environment/pull_bucket.py +++ b/tasks/0033_061_33061669_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_061_33061669_qa_1/task.toml b/tasks/0033_061_33061669_qa_1/task.toml index bae4b826eea12a9d723db422b4a18f075a8d7c6f..2bd9d48576f9d9e1a61d998dbcd97298673fa333 100644 --- a/tasks/0033_061_33061669_qa_1/task.toml +++ b/tasks/0033_061_33061669_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_076_33076783_qa_3/environment/bootstrap.sh b/tasks/0033_076_33076783_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_076_33076783_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_076_33076783_qa_3/environment/pull_bucket.py b/tasks/0033_076_33076783_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_076_33076783_qa_3/environment/pull_bucket.py +++ b/tasks/0033_076_33076783_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_076_33076783_qa_3/task.toml b/tasks/0033_076_33076783_qa_3/task.toml index 7afbf933d8baf385cb066fdcc30637677a585c91..8d8bd5e8d9c818883df2c486e0c491ab9d2b8f28 100644 --- a/tasks/0033_076_33076783_qa_3/task.toml +++ b/tasks/0033_076_33076783_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_076_33076783_qa_4/environment/bootstrap.sh b/tasks/0033_076_33076783_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_076_33076783_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_076_33076783_qa_4/environment/pull_bucket.py b/tasks/0033_076_33076783_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_076_33076783_qa_4/environment/pull_bucket.py +++ b/tasks/0033_076_33076783_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_076_33076783_qa_4/task.toml b/tasks/0033_076_33076783_qa_4/task.toml index 62e97663e5b48bad9321320af8cd6ac51f265fa4..5bf1f99ca6b0e158247932b5d4dc1c45d6e0f5e0 100644 --- a/tasks/0033_076_33076783_qa_4/task.toml +++ b/tasks/0033_076_33076783_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_076_33076783_qa_5/environment/bootstrap.sh b/tasks/0033_076_33076783_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_076_33076783_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_076_33076783_qa_5/environment/pull_bucket.py b/tasks/0033_076_33076783_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_076_33076783_qa_5/environment/pull_bucket.py +++ b/tasks/0033_076_33076783_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_076_33076783_qa_5/task.toml b/tasks/0033_076_33076783_qa_5/task.toml index 7622e167d8daa49359dff2cf88d74faa378ad465..c4e6d616c02255aa900aa5307ad808b159c6822c 100644 --- a/tasks/0033_076_33076783_qa_5/task.toml +++ b/tasks/0033_076_33076783_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_083_33083379_qa_3/environment/bootstrap.sh b/tasks/0033_083_33083379_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_083_33083379_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_083_33083379_qa_3/environment/pull_bucket.py b/tasks/0033_083_33083379_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_083_33083379_qa_3/environment/pull_bucket.py +++ b/tasks/0033_083_33083379_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_083_33083379_qa_3/task.toml b/tasks/0033_083_33083379_qa_3/task.toml index 13c0d30f21cc4f52271bfcb399b32be83b9551fb..1780b3c71748035c0676895c29c5a76b5a43e77d 100644 --- a/tasks/0033_083_33083379_qa_3/task.toml +++ b/tasks/0033_083_33083379_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_083_33083379_qa_4/environment/bootstrap.sh b/tasks/0033_083_33083379_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_083_33083379_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_083_33083379_qa_4/environment/pull_bucket.py b/tasks/0033_083_33083379_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_083_33083379_qa_4/environment/pull_bucket.py +++ b/tasks/0033_083_33083379_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_083_33083379_qa_4/task.toml b/tasks/0033_083_33083379_qa_4/task.toml index 63e0fbae9c4f662653aef2c997df30a22e981357..8789cc7d266dfa17618aeb10fb11607de190bdb7 100644 --- a/tasks/0033_083_33083379_qa_4/task.toml +++ b/tasks/0033_083_33083379_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_142_33142865_qa_4/environment/bootstrap.sh b/tasks/0033_142_33142865_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_142_33142865_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_142_33142865_qa_4/environment/pull_bucket.py b/tasks/0033_142_33142865_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_142_33142865_qa_4/environment/pull_bucket.py +++ b/tasks/0033_142_33142865_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_142_33142865_qa_4/task.toml b/tasks/0033_142_33142865_qa_4/task.toml index c5d4a1da7ece935f2329b84d1b74eb5077e6511b..0d7002731cc1dcb0f7e27fed63a1709f4905c4cb 100644 --- a/tasks/0033_142_33142865_qa_4/task.toml +++ b/tasks/0033_142_33142865_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_183_33183014_qa_4/environment/bootstrap.sh b/tasks/0033_183_33183014_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_183_33183014_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_183_33183014_qa_4/environment/pull_bucket.py b/tasks/0033_183_33183014_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_183_33183014_qa_4/environment/pull_bucket.py +++ b/tasks/0033_183_33183014_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_183_33183014_qa_4/task.toml b/tasks/0033_183_33183014_qa_4/task.toml index 97bddd08a6e72aaa4fba23f580355f017b40292b..6d4868979e8d0c5f22996e948464c7640f249a0b 100644 --- a/tasks/0033_183_33183014_qa_4/task.toml +++ b/tasks/0033_183_33183014_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_183_33183014_qa_5/environment/bootstrap.sh b/tasks/0033_183_33183014_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_183_33183014_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_183_33183014_qa_5/environment/pull_bucket.py b/tasks/0033_183_33183014_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_183_33183014_qa_5/environment/pull_bucket.py +++ b/tasks/0033_183_33183014_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_183_33183014_qa_5/task.toml b/tasks/0033_183_33183014_qa_5/task.toml index 837009bc08ce070bba9c8e279f6277a8656eb2ce..bd8877511819a1a69b0a521c3151200a89a7cc45 100644 --- a/tasks/0033_183_33183014_qa_5/task.toml +++ b/tasks/0033_183_33183014_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_198_33198049_qa_4/environment/bootstrap.sh b/tasks/0033_198_33198049_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_198_33198049_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_198_33198049_qa_4/environment/pull_bucket.py b/tasks/0033_198_33198049_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_198_33198049_qa_4/environment/pull_bucket.py +++ b/tasks/0033_198_33198049_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_198_33198049_qa_4/task.toml b/tasks/0033_198_33198049_qa_4/task.toml index 9ded44877bdbc912a1457467fb421761a8f3c99c..7f744ebecae5bbcdef7ceefd971901b76ab7ba48 100644 --- a/tasks/0033_198_33198049_qa_4/task.toml +++ b/tasks/0033_198_33198049_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_273_33273125_qa_1/environment/bootstrap.sh b/tasks/0033_273_33273125_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_273_33273125_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_273_33273125_qa_1/environment/pull_bucket.py b/tasks/0033_273_33273125_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_273_33273125_qa_1/environment/pull_bucket.py +++ b/tasks/0033_273_33273125_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_273_33273125_qa_1/task.toml b/tasks/0033_273_33273125_qa_1/task.toml index 0cf7e97308bad3fc8b03549920717bc924be730c..392383d9604b3a492d6708493b9d7ee29bae1a38 100644 --- a/tasks/0033_273_33273125_qa_1/task.toml +++ b/tasks/0033_273_33273125_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_273_33273125_qa_3/environment/bootstrap.sh b/tasks/0033_273_33273125_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_273_33273125_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_273_33273125_qa_3/environment/pull_bucket.py b/tasks/0033_273_33273125_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_273_33273125_qa_3/environment/pull_bucket.py +++ b/tasks/0033_273_33273125_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_273_33273125_qa_3/task.toml b/tasks/0033_273_33273125_qa_3/task.toml index 9265d5ecb8d7b91b385f01daea4754ed3f8e2495..ec74f887066eb5a6d6f40a78c2fa8058950b089e 100644 --- a/tasks/0033_273_33273125_qa_3/task.toml +++ b/tasks/0033_273_33273125_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_273_33273125_qa_5/environment/bootstrap.sh b/tasks/0033_273_33273125_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_273_33273125_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_273_33273125_qa_5/environment/pull_bucket.py b/tasks/0033_273_33273125_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_273_33273125_qa_5/environment/pull_bucket.py +++ b/tasks/0033_273_33273125_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_273_33273125_qa_5/task.toml b/tasks/0033_273_33273125_qa_5/task.toml index cf23f0414f4960fc10a64989049386ff32a695ba..935170089d0f81101bee449e2155f736dfa858c0 100644 --- a/tasks/0033_273_33273125_qa_5/task.toml +++ b/tasks/0033_273_33273125_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_290_33290847_qa_1/environment/bootstrap.sh b/tasks/0033_290_33290847_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_290_33290847_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_290_33290847_qa_1/environment/pull_bucket.py b/tasks/0033_290_33290847_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_290_33290847_qa_1/environment/pull_bucket.py +++ b/tasks/0033_290_33290847_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_290_33290847_qa_1/task.toml b/tasks/0033_290_33290847_qa_1/task.toml index 2e9155252eb949aea620e680bbec1409ae51480f..9752dce4d619d46bc199427b51a499ff2ad0b99a 100644 --- a/tasks/0033_290_33290847_qa_1/task.toml +++ b/tasks/0033_290_33290847_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_303_33303111_qa_3/environment/bootstrap.sh b/tasks/0033_303_33303111_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_303_33303111_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_303_33303111_qa_3/environment/pull_bucket.py b/tasks/0033_303_33303111_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_303_33303111_qa_3/environment/pull_bucket.py +++ b/tasks/0033_303_33303111_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_303_33303111_qa_3/task.toml b/tasks/0033_303_33303111_qa_3/task.toml index ae4750245598ad45bfff6de37736d6aa5d907529..d79ff12b6cdd7a0d331e492807881662cdaccf2a 100644 --- a/tasks/0033_303_33303111_qa_3/task.toml +++ b/tasks/0033_303_33303111_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_308_33308132_qa_3/environment/bootstrap.sh b/tasks/0033_308_33308132_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_308_33308132_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_308_33308132_qa_3/environment/pull_bucket.py b/tasks/0033_308_33308132_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_308_33308132_qa_3/environment/pull_bucket.py +++ b/tasks/0033_308_33308132_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_308_33308132_qa_3/task.toml b/tasks/0033_308_33308132_qa_3/task.toml index dc26f1e7a2dc2a3b00f6c6c713a92542afdc04d8..f85e031e599358fe73942741d6e0e1cb00a3043e 100644 --- a/tasks/0033_308_33308132_qa_3/task.toml +++ b/tasks/0033_308_33308132_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_326_33326125_qa_3/environment/bootstrap.sh b/tasks/0033_326_33326125_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_326_33326125_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_326_33326125_qa_3/environment/pull_bucket.py b/tasks/0033_326_33326125_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_326_33326125_qa_3/environment/pull_bucket.py +++ b/tasks/0033_326_33326125_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_326_33326125_qa_3/task.toml b/tasks/0033_326_33326125_qa_3/task.toml index 41641d08491c119d7903c0cd9385966f31cf0f5c..21df49f8c92073092b3ac03578e253f047eca3a0 100644 --- a/tasks/0033_326_33326125_qa_3/task.toml +++ b/tasks/0033_326_33326125_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_326_33326125_qa_4/environment/bootstrap.sh b/tasks/0033_326_33326125_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_326_33326125_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_326_33326125_qa_4/environment/pull_bucket.py b/tasks/0033_326_33326125_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_326_33326125_qa_4/environment/pull_bucket.py +++ b/tasks/0033_326_33326125_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_326_33326125_qa_4/task.toml b/tasks/0033_326_33326125_qa_4/task.toml index 5ec2f60589da83bf462d35c8c57045bf66bd6c14..c49a160c798e5527504b0ee411d8168aadc966e9 100644 --- a/tasks/0033_326_33326125_qa_4/task.toml +++ b/tasks/0033_326_33326125_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_420_33420599_qa_1/environment/bootstrap.sh b/tasks/0033_420_33420599_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_420_33420599_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_420_33420599_qa_1/environment/pull_bucket.py b/tasks/0033_420_33420599_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_420_33420599_qa_1/environment/pull_bucket.py +++ b/tasks/0033_420_33420599_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_420_33420599_qa_1/task.toml b/tasks/0033_420_33420599_qa_1/task.toml index b8d0527627fd83c6d4f7d547e6a49d8c3bfd35d6..0f0506f52d0a6957a3fe0b87bd99b15ae651f452 100644 --- a/tasks/0033_420_33420599_qa_1/task.toml +++ b/tasks/0033_420_33420599_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_420_33420599_qa_5/environment/bootstrap.sh b/tasks/0033_420_33420599_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_420_33420599_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_420_33420599_qa_5/environment/pull_bucket.py b/tasks/0033_420_33420599_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_420_33420599_qa_5/environment/pull_bucket.py +++ b/tasks/0033_420_33420599_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_420_33420599_qa_5/task.toml b/tasks/0033_420_33420599_qa_5/task.toml index edf09cc2534a379b0552c3b25735f58540e001f9..5cd1c17f73272cac894f070dabc915075a1bf66d 100644 --- a/tasks/0033_420_33420599_qa_5/task.toml +++ b/tasks/0033_420_33420599_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_423_33423582_qa_4/environment/bootstrap.sh b/tasks/0033_423_33423582_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_423_33423582_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_423_33423582_qa_4/environment/pull_bucket.py b/tasks/0033_423_33423582_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_423_33423582_qa_4/environment/pull_bucket.py +++ b/tasks/0033_423_33423582_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_423_33423582_qa_4/task.toml b/tasks/0033_423_33423582_qa_4/task.toml index 7b3b5a5d871b9490841c6eaaadf2d14badd10aaa..7a578cc99a892257af75ac3e0ab135682e3f1dd5 100644 --- a/tasks/0033_423_33423582_qa_4/task.toml +++ b/tasks/0033_423_33423582_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_448_33448868_qa_2/environment/bootstrap.sh b/tasks/0033_448_33448868_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_448_33448868_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_448_33448868_qa_2/environment/pull_bucket.py b/tasks/0033_448_33448868_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_448_33448868_qa_2/environment/pull_bucket.py +++ b/tasks/0033_448_33448868_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_448_33448868_qa_2/task.toml b/tasks/0033_448_33448868_qa_2/task.toml index 7b32740c2df48d616c15638b67253b3128ce89cd..e6a2b1a5b4d8e2261d771cb8fd10ccc3ab71245f 100644 --- a/tasks/0033_448_33448868_qa_2/task.toml +++ b/tasks/0033_448_33448868_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_509_33509634_qa_1/environment/bootstrap.sh b/tasks/0033_509_33509634_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_509_33509634_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_509_33509634_qa_1/environment/pull_bucket.py b/tasks/0033_509_33509634_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_509_33509634_qa_1/environment/pull_bucket.py +++ b/tasks/0033_509_33509634_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_509_33509634_qa_1/task.toml b/tasks/0033_509_33509634_qa_1/task.toml index 3a0392653521a14f7ef3b84c95d6536d76e7d578..532d79ac139261f05e2c923d97930182ee089d28 100644 --- a/tasks/0033_509_33509634_qa_1/task.toml +++ b/tasks/0033_509_33509634_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_509_33509634_qa_4/environment/bootstrap.sh b/tasks/0033_509_33509634_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_509_33509634_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_509_33509634_qa_4/environment/pull_bucket.py b/tasks/0033_509_33509634_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_509_33509634_qa_4/environment/pull_bucket.py +++ b/tasks/0033_509_33509634_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_509_33509634_qa_4/task.toml b/tasks/0033_509_33509634_qa_4/task.toml index 9438b149fa7ca321aa4e95e9b2b9e3da87cafba9..edfa1d0b225354bc41c2c17d0e6dd2963f9875e3 100644 --- a/tasks/0033_509_33509634_qa_4/task.toml +++ b/tasks/0033_509_33509634_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_558_33558610_qa_3/environment/bootstrap.sh b/tasks/0033_558_33558610_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_558_33558610_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_558_33558610_qa_3/environment/pull_bucket.py b/tasks/0033_558_33558610_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_558_33558610_qa_3/environment/pull_bucket.py +++ b/tasks/0033_558_33558610_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_558_33558610_qa_3/task.toml b/tasks/0033_558_33558610_qa_3/task.toml index e0171504b744ab0a7f0667b19bc38820746560ba..98458dbd2d5ac2db298403447ec302ec7c3536bf 100644 --- a/tasks/0033_558_33558610_qa_3/task.toml +++ b/tasks/0033_558_33558610_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_589_33589892_qa_1/environment/bootstrap.sh b/tasks/0033_589_33589892_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_589_33589892_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_589_33589892_qa_1/environment/pull_bucket.py b/tasks/0033_589_33589892_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_589_33589892_qa_1/environment/pull_bucket.py +++ b/tasks/0033_589_33589892_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_589_33589892_qa_1/task.toml b/tasks/0033_589_33589892_qa_1/task.toml index 07a9474a7e424226fdd52704e638f35e74ee01eb..4acffa0614def644f40311e67128c11522d011f6 100644 --- a/tasks/0033_589_33589892_qa_1/task.toml +++ b/tasks/0033_589_33589892_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_589_33589892_qa_4/environment/bootstrap.sh b/tasks/0033_589_33589892_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_589_33589892_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_589_33589892_qa_4/environment/pull_bucket.py b/tasks/0033_589_33589892_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_589_33589892_qa_4/environment/pull_bucket.py +++ b/tasks/0033_589_33589892_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_589_33589892_qa_4/task.toml b/tasks/0033_589_33589892_qa_4/task.toml index 7ad54b0b9b90fdd2e1c6dfa7ce868d2a587c4a08..e497422bc0408c761732b213403c3b60db9ea925 100644 --- a/tasks/0033_589_33589892_qa_4/task.toml +++ b/tasks/0033_589_33589892_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_652_33652373_qa_2/environment/bootstrap.sh b/tasks/0033_652_33652373_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_652_33652373_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_652_33652373_qa_2/environment/pull_bucket.py b/tasks/0033_652_33652373_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_652_33652373_qa_2/environment/pull_bucket.py +++ b/tasks/0033_652_33652373_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_652_33652373_qa_2/task.toml b/tasks/0033_652_33652373_qa_2/task.toml index bdb4701c8f0cacaf13e73d41855e70c6a6d42c24..af9b1cdd892b6b4ec4f0be1a111500a7d710f9e9 100644 --- a/tasks/0033_652_33652373_qa_2/task.toml +++ b/tasks/0033_652_33652373_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_652_33652373_qa_3/environment/bootstrap.sh b/tasks/0033_652_33652373_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_652_33652373_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_652_33652373_qa_3/environment/pull_bucket.py b/tasks/0033_652_33652373_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_652_33652373_qa_3/environment/pull_bucket.py +++ b/tasks/0033_652_33652373_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_652_33652373_qa_3/task.toml b/tasks/0033_652_33652373_qa_3/task.toml index 51f6f4844e50eb5c97d3f7d678be955cd2f94f56..00b871a5baf2e216fe32c2fc7c781c3079d68ba3 100644 --- a/tasks/0033_652_33652373_qa_3/task.toml +++ b/tasks/0033_652_33652373_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_668_33668266_qa_2/environment/bootstrap.sh b/tasks/0033_668_33668266_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_668_33668266_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_668_33668266_qa_2/environment/pull_bucket.py b/tasks/0033_668_33668266_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_668_33668266_qa_2/environment/pull_bucket.py +++ b/tasks/0033_668_33668266_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_668_33668266_qa_2/task.toml b/tasks/0033_668_33668266_qa_2/task.toml index d85541676740220c10993a18cf122c9616e81ce5..66fd9f820d01074d6cbcd15e348b30c86c9236b9 100644 --- a/tasks/0033_668_33668266_qa_2/task.toml +++ b/tasks/0033_668_33668266_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_668_33668266_qa_3/environment/bootstrap.sh b/tasks/0033_668_33668266_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_668_33668266_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_668_33668266_qa_3/environment/pull_bucket.py b/tasks/0033_668_33668266_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_668_33668266_qa_3/environment/pull_bucket.py +++ b/tasks/0033_668_33668266_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_668_33668266_qa_3/task.toml b/tasks/0033_668_33668266_qa_3/task.toml index b809249d25337ab45ba296712e33252c8597fbc3..30db2e57e699419ffa355e7e1ac6bc1ec772e45a 100644 --- a/tasks/0033_668_33668266_qa_3/task.toml +++ b/tasks/0033_668_33668266_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_684_33684962_qa_2/environment/bootstrap.sh b/tasks/0033_684_33684962_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_684_33684962_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_684_33684962_qa_2/environment/pull_bucket.py b/tasks/0033_684_33684962_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_684_33684962_qa_2/environment/pull_bucket.py +++ b/tasks/0033_684_33684962_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_684_33684962_qa_2/task.toml b/tasks/0033_684_33684962_qa_2/task.toml index dee736edfbfb39680d1c43133de6d4764e9e310b..8ec28ab28561d8ee198a56294e0f7bddbbe3fbe9 100644 --- a/tasks/0033_684_33684962_qa_2/task.toml +++ b/tasks/0033_684_33684962_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_684_33684962_qa_3/environment/bootstrap.sh b/tasks/0033_684_33684962_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_684_33684962_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_684_33684962_qa_3/environment/pull_bucket.py b/tasks/0033_684_33684962_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_684_33684962_qa_3/environment/pull_bucket.py +++ b/tasks/0033_684_33684962_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_684_33684962_qa_3/task.toml b/tasks/0033_684_33684962_qa_3/task.toml index e45095cb6953f95d46f593a7344f4b216c2ebee6..deedb99faf48e34ebb06c52039472d016280144a 100644 --- a/tasks/0033_684_33684962_qa_3/task.toml +++ b/tasks/0033_684_33684962_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_684_33684962_qa_5/environment/bootstrap.sh b/tasks/0033_684_33684962_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_684_33684962_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_684_33684962_qa_5/environment/pull_bucket.py b/tasks/0033_684_33684962_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_684_33684962_qa_5/environment/pull_bucket.py +++ b/tasks/0033_684_33684962_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_684_33684962_qa_5/task.toml b/tasks/0033_684_33684962_qa_5/task.toml index 963fed7d63f4a04514104e1f0d16dcca62261028..11956e9e26b03d3b042588d61ba2f3d4eb52948b 100644 --- a/tasks/0033_684_33684962_qa_5/task.toml +++ b/tasks/0033_684_33684962_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_697_33697266_qa_2/environment/bootstrap.sh b/tasks/0033_697_33697266_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_697_33697266_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_697_33697266_qa_2/environment/pull_bucket.py b/tasks/0033_697_33697266_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_697_33697266_qa_2/environment/pull_bucket.py +++ b/tasks/0033_697_33697266_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_697_33697266_qa_2/task.toml b/tasks/0033_697_33697266_qa_2/task.toml index 569926f5ffc53e9ec40a5526b5b96a2e48a28d50..7a7c99584dd1a0a4b6db1c15472402c1c37346d7 100644 --- a/tasks/0033_697_33697266_qa_2/task.toml +++ b/tasks/0033_697_33697266_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_700_33700089_qa_1/environment/bootstrap.sh b/tasks/0033_700_33700089_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_700_33700089_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_700_33700089_qa_1/environment/pull_bucket.py b/tasks/0033_700_33700089_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_700_33700089_qa_1/environment/pull_bucket.py +++ b/tasks/0033_700_33700089_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_700_33700089_qa_1/task.toml b/tasks/0033_700_33700089_qa_1/task.toml index d0f390a05b51b53e77d2322a98dddb82612a39f9..5c07144cfbf6987fcfb51f9ecc57fe9433c21ad0 100644 --- a/tasks/0033_700_33700089_qa_1/task.toml +++ b/tasks/0033_700_33700089_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_703_33703584_qa_3/environment/bootstrap.sh b/tasks/0033_703_33703584_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_703_33703584_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_703_33703584_qa_3/environment/pull_bucket.py b/tasks/0033_703_33703584_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_703_33703584_qa_3/environment/pull_bucket.py +++ b/tasks/0033_703_33703584_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_703_33703584_qa_3/task.toml b/tasks/0033_703_33703584_qa_3/task.toml index 9734788c765485e4ff2feefb932da77627bb63b8..860dd4876f15257177be76a5d3398f099b7045bd 100644 --- a/tasks/0033_703_33703584_qa_3/task.toml +++ b/tasks/0033_703_33703584_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_703_33703584_qa_5/environment/bootstrap.sh b/tasks/0033_703_33703584_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_703_33703584_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_703_33703584_qa_5/environment/pull_bucket.py b/tasks/0033_703_33703584_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_703_33703584_qa_5/environment/pull_bucket.py +++ b/tasks/0033_703_33703584_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_703_33703584_qa_5/task.toml b/tasks/0033_703_33703584_qa_5/task.toml index d4229a4331ec16c938064181970efd04ace22faf..3efad431b568e1399662828db19cd3c2180bb777 100644 --- a/tasks/0033_703_33703584_qa_5/task.toml +++ b/tasks/0033_703_33703584_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_717_33717801_qa_3/environment/bootstrap.sh b/tasks/0033_717_33717801_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_717_33717801_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_717_33717801_qa_3/environment/pull_bucket.py b/tasks/0033_717_33717801_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_717_33717801_qa_3/environment/pull_bucket.py +++ b/tasks/0033_717_33717801_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_717_33717801_qa_3/task.toml b/tasks/0033_717_33717801_qa_3/task.toml index c8ee6ddc3e28e358f0b0c91df8bc469f15b55143..b8b018a008894a3076c30cb5ed1e414619daf549 100644 --- a/tasks/0033_717_33717801_qa_3/task.toml +++ b/tasks/0033_717_33717801_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_717_33717801_qa_5/environment/bootstrap.sh b/tasks/0033_717_33717801_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_717_33717801_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_717_33717801_qa_5/environment/pull_bucket.py b/tasks/0033_717_33717801_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_717_33717801_qa_5/environment/pull_bucket.py +++ b/tasks/0033_717_33717801_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_717_33717801_qa_5/task.toml b/tasks/0033_717_33717801_qa_5/task.toml index bd0682379b4006e288e617522fa506be856f1f1b..3ef70c38706c043f0f2acf08f7e6e032c019517f 100644 --- a/tasks/0033_717_33717801_qa_5/task.toml +++ b/tasks/0033_717_33717801_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_717_33717850_qa_2/environment/bootstrap.sh b/tasks/0033_717_33717850_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_717_33717850_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_717_33717850_qa_2/environment/pull_bucket.py b/tasks/0033_717_33717850_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_717_33717850_qa_2/environment/pull_bucket.py +++ b/tasks/0033_717_33717850_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_717_33717850_qa_2/task.toml b/tasks/0033_717_33717850_qa_2/task.toml index 58db8279987cdb3c742be1f4b48d68727954f51f..d4cecd399a0b9e1b72689189b32ce84303c28e13 100644 --- a/tasks/0033_717_33717850_qa_2/task.toml +++ b/tasks/0033_717_33717850_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_726_33726120_qa_2/environment/bootstrap.sh b/tasks/0033_726_33726120_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_726_33726120_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_726_33726120_qa_2/environment/pull_bucket.py b/tasks/0033_726_33726120_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_726_33726120_qa_2/environment/pull_bucket.py +++ b/tasks/0033_726_33726120_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_726_33726120_qa_2/task.toml b/tasks/0033_726_33726120_qa_2/task.toml index e9f4d768c19cd4959adaaae6ab92fe9c173136cb..bed6e218af6b8a0c740f32de5e4d6c344a33415b 100644 --- a/tasks/0033_726_33726120_qa_2/task.toml +++ b/tasks/0033_726_33726120_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_726_33726120_qa_4/environment/bootstrap.sh b/tasks/0033_726_33726120_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_726_33726120_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_726_33726120_qa_4/environment/pull_bucket.py b/tasks/0033_726_33726120_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_726_33726120_qa_4/environment/pull_bucket.py +++ b/tasks/0033_726_33726120_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_726_33726120_qa_4/task.toml b/tasks/0033_726_33726120_qa_4/task.toml index ba954c8877c3dcf55ea76cf0c960613ce5655f3c..18e527a7ce0b0ccf94a7ce6fe4200a43b0981087 100644 --- a/tasks/0033_726_33726120_qa_4/task.toml +++ b/tasks/0033_726_33726120_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_726_33726120_qa_5/environment/bootstrap.sh b/tasks/0033_726_33726120_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_726_33726120_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_726_33726120_qa_5/environment/pull_bucket.py b/tasks/0033_726_33726120_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_726_33726120_qa_5/environment/pull_bucket.py +++ b/tasks/0033_726_33726120_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_726_33726120_qa_5/task.toml b/tasks/0033_726_33726120_qa_5/task.toml index 7ae49647ff7803e659773a2244c470cc30c9fd90..cfe3db82f77152fc44c76ed3cae6813985b89886 100644 --- a/tasks/0033_726_33726120_qa_5/task.toml +++ b/tasks/0033_726_33726120_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_745_33745374_qa_2/environment/bootstrap.sh b/tasks/0033_745_33745374_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_745_33745374_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_745_33745374_qa_2/environment/pull_bucket.py b/tasks/0033_745_33745374_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_745_33745374_qa_2/environment/pull_bucket.py +++ b/tasks/0033_745_33745374_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_745_33745374_qa_2/task.toml b/tasks/0033_745_33745374_qa_2/task.toml index 748d9918330b30923b16596315b94fbbb3b1c585..9800fda8ca30c1b9c2bbb77cbaece80b2ab59ed1 100644 --- a/tasks/0033_745_33745374_qa_2/task.toml +++ b/tasks/0033_745_33745374_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_752_33752341_qa_4/environment/bootstrap.sh b/tasks/0033_752_33752341_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_752_33752341_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_752_33752341_qa_4/environment/pull_bucket.py b/tasks/0033_752_33752341_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_752_33752341_qa_4/environment/pull_bucket.py +++ b/tasks/0033_752_33752341_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_752_33752341_qa_4/task.toml b/tasks/0033_752_33752341_qa_4/task.toml index 64c041c472d03a43cbf36cae2c2ecc8adc283f72..58885fff3bb3384695feeeb76925db0d01c2ebef 100644 --- a/tasks/0033_752_33752341_qa_4/task.toml +++ b/tasks/0033_752_33752341_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_755_33755094_qa_3/environment/bootstrap.sh b/tasks/0033_755_33755094_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_755_33755094_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_755_33755094_qa_3/environment/pull_bucket.py b/tasks/0033_755_33755094_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_755_33755094_qa_3/environment/pull_bucket.py +++ b/tasks/0033_755_33755094_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_755_33755094_qa_3/task.toml b/tasks/0033_755_33755094_qa_3/task.toml index debdf0f7fec687d00213024a2ff4f1e34c4e6102..e2b9a5f15cb47a9db0b656e235e0acd15bc8b2ea 100644 --- a/tasks/0033_755_33755094_qa_3/task.toml +++ b/tasks/0033_755_33755094_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_760_33760253_qa_4/environment/bootstrap.sh b/tasks/0033_760_33760253_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_760_33760253_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_760_33760253_qa_4/environment/pull_bucket.py b/tasks/0033_760_33760253_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_760_33760253_qa_4/environment/pull_bucket.py +++ b/tasks/0033_760_33760253_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_760_33760253_qa_4/task.toml b/tasks/0033_760_33760253_qa_4/task.toml index 1c80036eba21726c8129bff53d65f0dbfd039185..36c491ee71d08ab76a917ba8961fa31aa3130d6a 100644 --- a/tasks/0033_760_33760253_qa_4/task.toml +++ b/tasks/0033_760_33760253_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_787_33787812_qa_1/environment/bootstrap.sh b/tasks/0033_787_33787812_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_787_33787812_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_787_33787812_qa_1/environment/pull_bucket.py b/tasks/0033_787_33787812_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_787_33787812_qa_1/environment/pull_bucket.py +++ b/tasks/0033_787_33787812_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_787_33787812_qa_1/task.toml b/tasks/0033_787_33787812_qa_1/task.toml index 6d1c3e0ab9aa8ab5cf83a7a2206c6ebbc057a67f..0f2c94b57b56111ddc1941832f5981d1d22ce27d 100644 --- a/tasks/0033_787_33787812_qa_1/task.toml +++ b/tasks/0033_787_33787812_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_963_33963401_qa_1/environment/bootstrap.sh b/tasks/0033_963_33963401_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_963_33963401_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_963_33963401_qa_1/environment/pull_bucket.py b/tasks/0033_963_33963401_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_963_33963401_qa_1/environment/pull_bucket.py +++ b/tasks/0033_963_33963401_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_963_33963401_qa_1/task.toml b/tasks/0033_963_33963401_qa_1/task.toml index 4581c2baf2e9aa152921ccf33cb216eae7b87282..629b72b08d9057d66cf52cd7670a72db88d0dcc9 100644 --- a/tasks/0033_963_33963401_qa_1/task.toml +++ b/tasks/0033_963_33963401_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_963_33963401_qa_3/environment/bootstrap.sh b/tasks/0033_963_33963401_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_963_33963401_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_963_33963401_qa_3/environment/pull_bucket.py b/tasks/0033_963_33963401_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_963_33963401_qa_3/environment/pull_bucket.py +++ b/tasks/0033_963_33963401_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_963_33963401_qa_3/task.toml b/tasks/0033_963_33963401_qa_3/task.toml index 2e9c23112e2b7037a4201619a6943a9530864dab..3f42bd391e4213f4e03ac66209b3deb1503b3cdf 100644 --- a/tasks/0033_963_33963401_qa_3/task.toml +++ b/tasks/0033_963_33963401_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0033_988_33988731_qa_4/environment/bootstrap.sh b/tasks/0033_988_33988731_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0033_988_33988731_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0033_988_33988731_qa_4/environment/pull_bucket.py b/tasks/0033_988_33988731_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0033_988_33988731_qa_4/environment/pull_bucket.py +++ b/tasks/0033_988_33988731_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0033_988_33988731_qa_4/task.toml b/tasks/0033_988_33988731_qa_4/task.toml index 2c87ec9745d5267b165f7f896d8a5de466522255..57aa27f0ad91144b6b2bb94219b1d1bf785732b3 100644 --- a/tasks/0033_988_33988731_qa_4/task.toml +++ b/tasks/0033_988_33988731_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_023_34023168_qa_1/environment/bootstrap.sh b/tasks/0034_023_34023168_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_023_34023168_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_023_34023168_qa_1/environment/pull_bucket.py b/tasks/0034_023_34023168_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_023_34023168_qa_1/environment/pull_bucket.py +++ b/tasks/0034_023_34023168_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_023_34023168_qa_1/task.toml b/tasks/0034_023_34023168_qa_1/task.toml index b48e64fa8bdffcfc979fcdd909e8296e56ef35ef..8849a104c4b87f35bb30363418c10b573b88105c 100644 --- a/tasks/0034_023_34023168_qa_1/task.toml +++ b/tasks/0034_023_34023168_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_023_34023168_qa_2/environment/bootstrap.sh b/tasks/0034_023_34023168_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_023_34023168_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_023_34023168_qa_2/environment/pull_bucket.py b/tasks/0034_023_34023168_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_023_34023168_qa_2/environment/pull_bucket.py +++ b/tasks/0034_023_34023168_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_023_34023168_qa_2/task.toml b/tasks/0034_023_34023168_qa_2/task.toml index 3238922ae2a7e844d12e9ae76a937cc84c7463c7..1536570570cc60f1c2e09cc2e0e26c89be4122bc 100644 --- a/tasks/0034_023_34023168_qa_2/task.toml +++ b/tasks/0034_023_34023168_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_043_34043351_qa_3/environment/bootstrap.sh b/tasks/0034_043_34043351_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_043_34043351_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_043_34043351_qa_3/environment/pull_bucket.py b/tasks/0034_043_34043351_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_043_34043351_qa_3/environment/pull_bucket.py +++ b/tasks/0034_043_34043351_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_043_34043351_qa_3/task.toml b/tasks/0034_043_34043351_qa_3/task.toml index 5c2dfc8fb945b13b0db40587e6d6493319406781..16326345995ead47051952818aba90e0e6326206 100644 --- a/tasks/0034_043_34043351_qa_3/task.toml +++ b/tasks/0034_043_34043351_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_108_34108193_qa_1/environment/bootstrap.sh b/tasks/0034_108_34108193_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_108_34108193_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_108_34108193_qa_1/environment/pull_bucket.py b/tasks/0034_108_34108193_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_108_34108193_qa_1/environment/pull_bucket.py +++ b/tasks/0034_108_34108193_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_108_34108193_qa_1/task.toml b/tasks/0034_108_34108193_qa_1/task.toml index a22411507323441123979f589af3d2e4c731f1bd..cff239459c473fd159348e358af9076dd1b238bc 100644 --- a/tasks/0034_108_34108193_qa_1/task.toml +++ b/tasks/0034_108_34108193_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_170_34170800_qa_2/environment/bootstrap.sh b/tasks/0034_170_34170800_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_170_34170800_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_170_34170800_qa_2/environment/pull_bucket.py b/tasks/0034_170_34170800_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_170_34170800_qa_2/environment/pull_bucket.py +++ b/tasks/0034_170_34170800_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_170_34170800_qa_2/task.toml b/tasks/0034_170_34170800_qa_2/task.toml index 83fe57eb10cbb79644a6c23f02914844ecf9d758..ce51f2f2319b09754517c9314e43aef6c26e24c7 100644 --- a/tasks/0034_170_34170800_qa_2/task.toml +++ b/tasks/0034_170_34170800_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_193_34193226_qa_2/environment/bootstrap.sh b/tasks/0034_193_34193226_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_193_34193226_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_193_34193226_qa_2/environment/pull_bucket.py b/tasks/0034_193_34193226_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_193_34193226_qa_2/environment/pull_bucket.py +++ b/tasks/0034_193_34193226_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_193_34193226_qa_2/task.toml b/tasks/0034_193_34193226_qa_2/task.toml index 53263dd317d05faf6b647d86edfe382e44d97576..7704b14e6072599f1b11d861ac159d958afba67d 100644 --- a/tasks/0034_193_34193226_qa_2/task.toml +++ b/tasks/0034_193_34193226_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_193_34193226_qa_3/environment/bootstrap.sh b/tasks/0034_193_34193226_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_193_34193226_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_193_34193226_qa_3/environment/pull_bucket.py b/tasks/0034_193_34193226_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_193_34193226_qa_3/environment/pull_bucket.py +++ b/tasks/0034_193_34193226_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_193_34193226_qa_3/task.toml b/tasks/0034_193_34193226_qa_3/task.toml index 588f8a0f32875dddacbff06e11821fe4fcbc32fe..b7de88b01673e5af1bb7487b8d7ff6be318e8e20 100644 --- a/tasks/0034_193_34193226_qa_3/task.toml +++ b/tasks/0034_193_34193226_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_200_34200101_qa_1/environment/bootstrap.sh b/tasks/0034_200_34200101_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_200_34200101_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_200_34200101_qa_1/environment/pull_bucket.py b/tasks/0034_200_34200101_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_200_34200101_qa_1/environment/pull_bucket.py +++ b/tasks/0034_200_34200101_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_200_34200101_qa_1/task.toml b/tasks/0034_200_34200101_qa_1/task.toml index 029a729f5d563a16a0e999ddfb8139a635414584..34b40d106822b393db337a2eeaf3fff227fbe1da 100644 --- a/tasks/0034_200_34200101_qa_1/task.toml +++ b/tasks/0034_200_34200101_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_233_34233505_qa_1/environment/bootstrap.sh b/tasks/0034_233_34233505_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_233_34233505_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_233_34233505_qa_1/environment/pull_bucket.py b/tasks/0034_233_34233505_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_233_34233505_qa_1/environment/pull_bucket.py +++ b/tasks/0034_233_34233505_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_233_34233505_qa_1/task.toml b/tasks/0034_233_34233505_qa_1/task.toml index b0d26cc14f87d550e67bf64bbbf8bf3b2d61efa3..7764179e70f45a3f10f8140827d623e371b1e896 100644 --- a/tasks/0034_233_34233505_qa_1/task.toml +++ b/tasks/0034_233_34233505_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_233_34233505_qa_2/environment/bootstrap.sh b/tasks/0034_233_34233505_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_233_34233505_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_233_34233505_qa_2/environment/pull_bucket.py b/tasks/0034_233_34233505_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_233_34233505_qa_2/environment/pull_bucket.py +++ b/tasks/0034_233_34233505_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_233_34233505_qa_2/task.toml b/tasks/0034_233_34233505_qa_2/task.toml index b61fb61471d873786f0127056e4af9da39966b6b..a495d64bf32a10690b0285e9d32fc95eceebfde0 100644 --- a/tasks/0034_233_34233505_qa_2/task.toml +++ b/tasks/0034_233_34233505_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_233_34233505_qa_4/environment/bootstrap.sh b/tasks/0034_233_34233505_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_233_34233505_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_233_34233505_qa_4/environment/pull_bucket.py b/tasks/0034_233_34233505_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_233_34233505_qa_4/environment/pull_bucket.py +++ b/tasks/0034_233_34233505_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_233_34233505_qa_4/task.toml b/tasks/0034_233_34233505_qa_4/task.toml index 0aa18c9e49a105e5e3794060029079b65b81e98b..f3d36132d09d242303da8850965ed71eb0e4b97c 100644 --- a/tasks/0034_233_34233505_qa_4/task.toml +++ b/tasks/0034_233_34233505_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_265_34265100_qa_1/environment/bootstrap.sh b/tasks/0034_265_34265100_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_265_34265100_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_265_34265100_qa_1/environment/pull_bucket.py b/tasks/0034_265_34265100_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_265_34265100_qa_1/environment/pull_bucket.py +++ b/tasks/0034_265_34265100_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_265_34265100_qa_1/task.toml b/tasks/0034_265_34265100_qa_1/task.toml index b4356252a9489df0696f7ddf4d7ea97addb6c6fe..866b55f1ce9c0dc2e0ca327e49697eb278859b57 100644 --- a/tasks/0034_265_34265100_qa_1/task.toml +++ b/tasks/0034_265_34265100_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_265_34265100_qa_2/environment/bootstrap.sh b/tasks/0034_265_34265100_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_265_34265100_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_265_34265100_qa_2/environment/pull_bucket.py b/tasks/0034_265_34265100_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_265_34265100_qa_2/environment/pull_bucket.py +++ b/tasks/0034_265_34265100_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_265_34265100_qa_2/task.toml b/tasks/0034_265_34265100_qa_2/task.toml index 48f71110bdfc6d70dfe43705a27a6bdf64c8b98f..df1d752b6132f5d7e24d0a1e52d94c6af66ffb16 100644 --- a/tasks/0034_265_34265100_qa_2/task.toml +++ b/tasks/0034_265_34265100_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_295_34295424_qa_1/environment/bootstrap.sh b/tasks/0034_295_34295424_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_295_34295424_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_295_34295424_qa_1/environment/pull_bucket.py b/tasks/0034_295_34295424_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_295_34295424_qa_1/environment/pull_bucket.py +++ b/tasks/0034_295_34295424_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_295_34295424_qa_1/task.toml b/tasks/0034_295_34295424_qa_1/task.toml index d1a84f15020f0b2edc71733af11ad63eddec135e..83399ab0eee9eb8c928321c34dda8e8ad144eeb3 100644 --- a/tasks/0034_295_34295424_qa_1/task.toml +++ b/tasks/0034_295_34295424_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_339_34339717_qa_1/environment/bootstrap.sh b/tasks/0034_339_34339717_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_339_34339717_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_339_34339717_qa_1/environment/pull_bucket.py b/tasks/0034_339_34339717_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_339_34339717_qa_1/environment/pull_bucket.py +++ b/tasks/0034_339_34339717_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_339_34339717_qa_1/task.toml b/tasks/0034_339_34339717_qa_1/task.toml index 9de9ec1db996d0a042c7793eebe736586bb5cd3c..763eab833a1f9fdf9d6b1a0a41edf42a5f6f36d0 100644 --- a/tasks/0034_339_34339717_qa_1/task.toml +++ b/tasks/0034_339_34339717_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_339_34339717_qa_3/environment/bootstrap.sh b/tasks/0034_339_34339717_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_339_34339717_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_339_34339717_qa_3/environment/pull_bucket.py b/tasks/0034_339_34339717_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_339_34339717_qa_3/environment/pull_bucket.py +++ b/tasks/0034_339_34339717_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_339_34339717_qa_3/task.toml b/tasks/0034_339_34339717_qa_3/task.toml index c73302f8e12a736ebe7022225f131bac8dd52710..b0ee6affdc84649a97c648bdb6903054d8b6735f 100644 --- a/tasks/0034_339_34339717_qa_3/task.toml +++ b/tasks/0034_339_34339717_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_339_34339717_qa_5/environment/bootstrap.sh b/tasks/0034_339_34339717_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_339_34339717_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_339_34339717_qa_5/environment/pull_bucket.py b/tasks/0034_339_34339717_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_339_34339717_qa_5/environment/pull_bucket.py +++ b/tasks/0034_339_34339717_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_339_34339717_qa_5/task.toml b/tasks/0034_339_34339717_qa_5/task.toml index 423511dc8a099926d798b29f7fd4eecbea38dbb8..065c11e0a5de3f91e12b8d5d5c12d2990a2b0bbb 100644 --- a/tasks/0034_339_34339717_qa_5/task.toml +++ b/tasks/0034_339_34339717_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_376_34376500_qa_4/environment/bootstrap.sh b/tasks/0034_376_34376500_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_376_34376500_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_376_34376500_qa_4/environment/pull_bucket.py b/tasks/0034_376_34376500_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_376_34376500_qa_4/environment/pull_bucket.py +++ b/tasks/0034_376_34376500_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_376_34376500_qa_4/task.toml b/tasks/0034_376_34376500_qa_4/task.toml index c3b05b1502d29162b0e43726b1aa689c0e702021..36d558c001673883f07257b9a9e1785c70eb8636 100644 --- a/tasks/0034_376_34376500_qa_4/task.toml +++ b/tasks/0034_376_34376500_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_380_34380054_qa_1/environment/bootstrap.sh b/tasks/0034_380_34380054_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_380_34380054_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_380_34380054_qa_1/environment/pull_bucket.py b/tasks/0034_380_34380054_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_380_34380054_qa_1/environment/pull_bucket.py +++ b/tasks/0034_380_34380054_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_380_34380054_qa_1/task.toml b/tasks/0034_380_34380054_qa_1/task.toml index 12cdf34e9a23dc02957f8f8a714df711f5c19adb..517ba2d958ca7051aed781d7767e6f64c26f0970 100644 --- a/tasks/0034_380_34380054_qa_1/task.toml +++ b/tasks/0034_380_34380054_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_380_34380054_qa_2/environment/bootstrap.sh b/tasks/0034_380_34380054_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_380_34380054_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_380_34380054_qa_2/environment/pull_bucket.py b/tasks/0034_380_34380054_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_380_34380054_qa_2/environment/pull_bucket.py +++ b/tasks/0034_380_34380054_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_380_34380054_qa_2/task.toml b/tasks/0034_380_34380054_qa_2/task.toml index a49bbadbf3ad0afd0e7f1266e9a524cb66d6c4fb..b01ba3def988a15809b64a1dc67bc700d4fcf1c4 100644 --- a/tasks/0034_380_34380054_qa_2/task.toml +++ b/tasks/0034_380_34380054_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_457_34457545_qa_2/environment/bootstrap.sh b/tasks/0034_457_34457545_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_457_34457545_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_457_34457545_qa_2/environment/pull_bucket.py b/tasks/0034_457_34457545_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_457_34457545_qa_2/environment/pull_bucket.py +++ b/tasks/0034_457_34457545_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_457_34457545_qa_2/task.toml b/tasks/0034_457_34457545_qa_2/task.toml index 2e0424d3e43df36bdde59a9a73c2df734a58d779..1c57fdfa4e7b7ac8b5fa80aca85875ca91c31c65 100644 --- a/tasks/0034_457_34457545_qa_2/task.toml +++ b/tasks/0034_457_34457545_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_513_34513680_qa_5/environment/bootstrap.sh b/tasks/0034_513_34513680_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_513_34513680_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_513_34513680_qa_5/environment/pull_bucket.py b/tasks/0034_513_34513680_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_513_34513680_qa_5/environment/pull_bucket.py +++ b/tasks/0034_513_34513680_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_513_34513680_qa_5/task.toml b/tasks/0034_513_34513680_qa_5/task.toml index cdb0ceab1c3c41d2092149f35290ed68a7af7678..9c907c7db589e2345d96c54f1ae09a652f8c6eda 100644 --- a/tasks/0034_513_34513680_qa_5/task.toml +++ b/tasks/0034_513_34513680_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_568_34568948_qa_3/environment/bootstrap.sh b/tasks/0034_568_34568948_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_568_34568948_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_568_34568948_qa_3/environment/pull_bucket.py b/tasks/0034_568_34568948_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_568_34568948_qa_3/environment/pull_bucket.py +++ b/tasks/0034_568_34568948_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_568_34568948_qa_3/task.toml b/tasks/0034_568_34568948_qa_3/task.toml index 8a671b8a3280b7be7db5632b72c70af87a2be42f..3bf43d609e01ee7c5ad5c2c4b0a44556095ed09f 100644 --- a/tasks/0034_568_34568948_qa_3/task.toml +++ b/tasks/0034_568_34568948_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_568_34568948_qa_5/environment/bootstrap.sh b/tasks/0034_568_34568948_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_568_34568948_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_568_34568948_qa_5/environment/pull_bucket.py b/tasks/0034_568_34568948_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_568_34568948_qa_5/environment/pull_bucket.py +++ b/tasks/0034_568_34568948_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_568_34568948_qa_5/task.toml b/tasks/0034_568_34568948_qa_5/task.toml index 25c798f9bec975541418d0076e6bbe3ecb0af0a4..a9e9a3e3d6d1e00512ece77e445b00cd1577ffc2 100644 --- a/tasks/0034_568_34568948_qa_5/task.toml +++ b/tasks/0034_568_34568948_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_588_34588161_qa_5/environment/bootstrap.sh b/tasks/0034_588_34588161_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_588_34588161_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_588_34588161_qa_5/environment/pull_bucket.py b/tasks/0034_588_34588161_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_588_34588161_qa_5/environment/pull_bucket.py +++ b/tasks/0034_588_34588161_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_588_34588161_qa_5/task.toml b/tasks/0034_588_34588161_qa_5/task.toml index c3a0d52c61bdd1ec475f6eb6a5a486660f7d701f..feeab25b78f9b98dbe5c85b9552a81a5109b3881 100644 --- a/tasks/0034_588_34588161_qa_5/task.toml +++ b/tasks/0034_588_34588161_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_651_34651965_qa_2/environment/bootstrap.sh b/tasks/0034_651_34651965_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_651_34651965_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_651_34651965_qa_2/environment/pull_bucket.py b/tasks/0034_651_34651965_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_651_34651965_qa_2/environment/pull_bucket.py +++ b/tasks/0034_651_34651965_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_651_34651965_qa_2/task.toml b/tasks/0034_651_34651965_qa_2/task.toml index 318dbf12fc63a1688894aeb500aa68beec338772..28803535c1e7748be3d73f814b90d62d74c9d7e9 100644 --- a/tasks/0034_651_34651965_qa_2/task.toml +++ b/tasks/0034_651_34651965_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_705_34705944_qa_4/environment/bootstrap.sh b/tasks/0034_705_34705944_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_705_34705944_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_705_34705944_qa_4/environment/pull_bucket.py b/tasks/0034_705_34705944_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_705_34705944_qa_4/environment/pull_bucket.py +++ b/tasks/0034_705_34705944_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_705_34705944_qa_4/task.toml b/tasks/0034_705_34705944_qa_4/task.toml index d3d983f75ab4efd78e8a340938d47f8ebde3b97f..62696087ae146f9a64066fb23b6a4ddae6d42f11 100644 --- a/tasks/0034_705_34705944_qa_4/task.toml +++ b/tasks/0034_705_34705944_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_726_34726167_qa_2/environment/bootstrap.sh b/tasks/0034_726_34726167_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_726_34726167_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_726_34726167_qa_2/environment/pull_bucket.py b/tasks/0034_726_34726167_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_726_34726167_qa_2/environment/pull_bucket.py +++ b/tasks/0034_726_34726167_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_726_34726167_qa_2/task.toml b/tasks/0034_726_34726167_qa_2/task.toml index 977fc981bd2c862f662c6e9dc20d8150be830c4c..9ea5d802afb0078ebd076bfc8009183d058dc89b 100644 --- a/tasks/0034_726_34726167_qa_2/task.toml +++ b/tasks/0034_726_34726167_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_748_34748003_qa_1/environment/bootstrap.sh b/tasks/0034_748_34748003_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_748_34748003_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_748_34748003_qa_1/environment/pull_bucket.py b/tasks/0034_748_34748003_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_748_34748003_qa_1/environment/pull_bucket.py +++ b/tasks/0034_748_34748003_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_748_34748003_qa_1/task.toml b/tasks/0034_748_34748003_qa_1/task.toml index e1dbec3927e6ad5d77a27329c94c3618a7fd2376..429f897f1c72cc1e7440c1c637f7a6866052bbe4 100644 --- a/tasks/0034_748_34748003_qa_1/task.toml +++ b/tasks/0034_748_34748003_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_748_34748003_qa_3/environment/bootstrap.sh b/tasks/0034_748_34748003_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_748_34748003_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_748_34748003_qa_3/environment/pull_bucket.py b/tasks/0034_748_34748003_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_748_34748003_qa_3/environment/pull_bucket.py +++ b/tasks/0034_748_34748003_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_748_34748003_qa_3/task.toml b/tasks/0034_748_34748003_qa_3/task.toml index 6b185ec6da49d8cc46cc42d4e70e4b127c93d591..4e228d4ef3c36256da3a611e62bc522ca4f949c3 100644 --- a/tasks/0034_748_34748003_qa_3/task.toml +++ b/tasks/0034_748_34748003_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_768_34768850_qa_2/environment/bootstrap.sh b/tasks/0034_768_34768850_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_768_34768850_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_768_34768850_qa_2/environment/pull_bucket.py b/tasks/0034_768_34768850_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_768_34768850_qa_2/environment/pull_bucket.py +++ b/tasks/0034_768_34768850_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_768_34768850_qa_2/task.toml b/tasks/0034_768_34768850_qa_2/task.toml index 237af6c754f7c711e72bc5bcb55340db1f3ae2e9..bdd9927c99c0af6f544718983df27a0ffb418f7c 100644 --- a/tasks/0034_768_34768850_qa_2/task.toml +++ b/tasks/0034_768_34768850_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_768_34768850_qa_3/environment/bootstrap.sh b/tasks/0034_768_34768850_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_768_34768850_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_768_34768850_qa_3/environment/pull_bucket.py b/tasks/0034_768_34768850_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_768_34768850_qa_3/environment/pull_bucket.py +++ b/tasks/0034_768_34768850_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_768_34768850_qa_3/task.toml b/tasks/0034_768_34768850_qa_3/task.toml index b932b882465bcadf6ccfe89568fb6f0003f9f28b..f79674ae5dae57de1b3150636e2acc86e19ce6d7 100644 --- a/tasks/0034_768_34768850_qa_3/task.toml +++ b/tasks/0034_768_34768850_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_773_34773515_qa_1/environment/bootstrap.sh b/tasks/0034_773_34773515_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_773_34773515_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_773_34773515_qa_1/environment/pull_bucket.py b/tasks/0034_773_34773515_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_773_34773515_qa_1/environment/pull_bucket.py +++ b/tasks/0034_773_34773515_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_773_34773515_qa_1/task.toml b/tasks/0034_773_34773515_qa_1/task.toml index c688dfa17eea42dddfae20e0b47c9a63dccb0e13..25b8c8be48fa57910c700c4882b2d611d5d7d085 100644 --- a/tasks/0034_773_34773515_qa_1/task.toml +++ b/tasks/0034_773_34773515_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_773_34773515_qa_2/environment/bootstrap.sh b/tasks/0034_773_34773515_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_773_34773515_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_773_34773515_qa_2/environment/pull_bucket.py b/tasks/0034_773_34773515_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_773_34773515_qa_2/environment/pull_bucket.py +++ b/tasks/0034_773_34773515_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_773_34773515_qa_2/task.toml b/tasks/0034_773_34773515_qa_2/task.toml index 8a8ec692d97899402ffedb62db96685296fbf764..36a59da671471d8d684bd1bb0075b2b26a9250a0 100644 --- a/tasks/0034_773_34773515_qa_2/task.toml +++ b/tasks/0034_773_34773515_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_773_34773515_qa_3/environment/bootstrap.sh b/tasks/0034_773_34773515_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_773_34773515_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_773_34773515_qa_3/environment/pull_bucket.py b/tasks/0034_773_34773515_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_773_34773515_qa_3/environment/pull_bucket.py +++ b/tasks/0034_773_34773515_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_773_34773515_qa_3/task.toml b/tasks/0034_773_34773515_qa_3/task.toml index 0dd6c2b39ea5f742784f93b22665f5292d18ec8c..657b13ad86af0e74e1eb67158f5079597b72f984 100644 --- a/tasks/0034_773_34773515_qa_3/task.toml +++ b/tasks/0034_773_34773515_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_773_34773515_qa_5/environment/bootstrap.sh b/tasks/0034_773_34773515_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_773_34773515_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_773_34773515_qa_5/environment/pull_bucket.py b/tasks/0034_773_34773515_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_773_34773515_qa_5/environment/pull_bucket.py +++ b/tasks/0034_773_34773515_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_773_34773515_qa_5/task.toml b/tasks/0034_773_34773515_qa_5/task.toml index a8353b2937a2f78a5d65fefd48e3651b0bad20b4..5061dbfd00e4d9098add174a3fe5eb619137d6c0 100644 --- a/tasks/0034_773_34773515_qa_5/task.toml +++ b/tasks/0034_773_34773515_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_777_34777395_qa_3/environment/bootstrap.sh b/tasks/0034_777_34777395_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_777_34777395_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_777_34777395_qa_3/environment/pull_bucket.py b/tasks/0034_777_34777395_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_777_34777395_qa_3/environment/pull_bucket.py +++ b/tasks/0034_777_34777395_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_777_34777395_qa_3/task.toml b/tasks/0034_777_34777395_qa_3/task.toml index 47b5acf18aff40a4cc4b563923fe532dfe7f563a..bf6869464c0aefd2dd8fb7db4648054b6b03fbf8 100644 --- a/tasks/0034_777_34777395_qa_3/task.toml +++ b/tasks/0034_777_34777395_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_793_34793224_qa_1/environment/bootstrap.sh b/tasks/0034_793_34793224_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_793_34793224_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_793_34793224_qa_1/environment/pull_bucket.py b/tasks/0034_793_34793224_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_793_34793224_qa_1/environment/pull_bucket.py +++ b/tasks/0034_793_34793224_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_793_34793224_qa_1/task.toml b/tasks/0034_793_34793224_qa_1/task.toml index fa31c449856f06fe25e09bbe6b683aa495ff1b1b..ccacd189d3bc4b47bf783d6c559638f7268450ec 100644 --- a/tasks/0034_793_34793224_qa_1/task.toml +++ b/tasks/0034_793_34793224_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_793_34793224_qa_3/environment/bootstrap.sh b/tasks/0034_793_34793224_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_793_34793224_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_793_34793224_qa_3/environment/pull_bucket.py b/tasks/0034_793_34793224_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_793_34793224_qa_3/environment/pull_bucket.py +++ b/tasks/0034_793_34793224_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_793_34793224_qa_3/task.toml b/tasks/0034_793_34793224_qa_3/task.toml index 616da1de5104c6ebb0e566f5d79b5c9925caaa46..2c0fe9e322e171852d4ef1ea0ea78c64c3558684 100644 --- a/tasks/0034_793_34793224_qa_3/task.toml +++ b/tasks/0034_793_34793224_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_886_34886359_qa_3/environment/bootstrap.sh b/tasks/0034_886_34886359_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_886_34886359_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_886_34886359_qa_3/environment/pull_bucket.py b/tasks/0034_886_34886359_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_886_34886359_qa_3/environment/pull_bucket.py +++ b/tasks/0034_886_34886359_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_886_34886359_qa_3/task.toml b/tasks/0034_886_34886359_qa_3/task.toml index 2dfff93ec234ad98ee5b994ef5943154b0721c51..b10a6c046dca02a3e79de6cbdc925f615eb81ea5 100644 --- a/tasks/0034_886_34886359_qa_3/task.toml +++ b/tasks/0034_886_34886359_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_886_34886359_qa_5/environment/bootstrap.sh b/tasks/0034_886_34886359_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_886_34886359_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_886_34886359_qa_5/environment/pull_bucket.py b/tasks/0034_886_34886359_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_886_34886359_qa_5/environment/pull_bucket.py +++ b/tasks/0034_886_34886359_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_886_34886359_qa_5/task.toml b/tasks/0034_886_34886359_qa_5/task.toml index 40cec983ff421e7c05a4aabd67f5346a2336b9ff..5f1082add1611ed079d8874e03b1ac61024ed92a 100644 --- a/tasks/0034_886_34886359_qa_5/task.toml +++ b/tasks/0034_886_34886359_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_890_34890721_qa_3/environment/bootstrap.sh b/tasks/0034_890_34890721_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_890_34890721_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_890_34890721_qa_3/environment/pull_bucket.py b/tasks/0034_890_34890721_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_890_34890721_qa_3/environment/pull_bucket.py +++ b/tasks/0034_890_34890721_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_890_34890721_qa_3/task.toml b/tasks/0034_890_34890721_qa_3/task.toml index 709950bde2c5442a3e689a8972c40cf784192314..1bfc6b7b8c686e43fd01238adf01ae4f1516e144 100644 --- a/tasks/0034_890_34890721_qa_3/task.toml +++ b/tasks/0034_890_34890721_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_890_34890721_qa_4/environment/bootstrap.sh b/tasks/0034_890_34890721_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_890_34890721_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_890_34890721_qa_4/environment/pull_bucket.py b/tasks/0034_890_34890721_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_890_34890721_qa_4/environment/pull_bucket.py +++ b/tasks/0034_890_34890721_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_890_34890721_qa_4/task.toml b/tasks/0034_890_34890721_qa_4/task.toml index da0e8c6f045ee47a06c56a1f0d88945ea34c691b..0518ebc04b85d852261a7a1ba1f1dfcf750089d6 100644 --- a/tasks/0034_890_34890721_qa_4/task.toml +++ b/tasks/0034_890_34890721_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_912_34912092_qa_3/environment/bootstrap.sh b/tasks/0034_912_34912092_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_912_34912092_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_912_34912092_qa_3/environment/pull_bucket.py b/tasks/0034_912_34912092_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_912_34912092_qa_3/environment/pull_bucket.py +++ b/tasks/0034_912_34912092_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_912_34912092_qa_3/task.toml b/tasks/0034_912_34912092_qa_3/task.toml index 0d02a699700eab986a8fe764810853e871acac12..0066f4f1094e85b9d44397940bbae9ab933d04d5 100644 --- a/tasks/0034_912_34912092_qa_3/task.toml +++ b/tasks/0034_912_34912092_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_912_34912092_qa_5/environment/bootstrap.sh b/tasks/0034_912_34912092_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_912_34912092_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_912_34912092_qa_5/environment/pull_bucket.py b/tasks/0034_912_34912092_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_912_34912092_qa_5/environment/pull_bucket.py +++ b/tasks/0034_912_34912092_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_912_34912092_qa_5/task.toml b/tasks/0034_912_34912092_qa_5/task.toml index de53c9186d4cfa2661ebee3842072090e8e60676..2af4181373c9dc7364b325d112cec2bc64724861 100644 --- a/tasks/0034_912_34912092_qa_5/task.toml +++ b/tasks/0034_912_34912092_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_916_34916115_qa_2/environment/bootstrap.sh b/tasks/0034_916_34916115_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_916_34916115_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_916_34916115_qa_2/environment/pull_bucket.py b/tasks/0034_916_34916115_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_916_34916115_qa_2/environment/pull_bucket.py +++ b/tasks/0034_916_34916115_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_916_34916115_qa_2/task.toml b/tasks/0034_916_34916115_qa_2/task.toml index 0eeb495d131c70add077580bd38595b06080ebd5..abb7dda04733951ee2bb31d73b1ba110186ecda7 100644 --- a/tasks/0034_916_34916115_qa_2/task.toml +++ b/tasks/0034_916_34916115_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_945_34945606_qa_2/environment/bootstrap.sh b/tasks/0034_945_34945606_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_945_34945606_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_945_34945606_qa_2/environment/pull_bucket.py b/tasks/0034_945_34945606_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_945_34945606_qa_2/environment/pull_bucket.py +++ b/tasks/0034_945_34945606_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_945_34945606_qa_2/task.toml b/tasks/0034_945_34945606_qa_2/task.toml index b91a1b66b3b993455f1ecb74e257bc9c536102b5..ac5efd56ce2f44016249c4d29713cb2a91e62f98 100644 --- a/tasks/0034_945_34945606_qa_2/task.toml +++ b/tasks/0034_945_34945606_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0034_945_34945606_qa_5/environment/bootstrap.sh b/tasks/0034_945_34945606_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0034_945_34945606_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0034_945_34945606_qa_5/environment/pull_bucket.py b/tasks/0034_945_34945606_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0034_945_34945606_qa_5/environment/pull_bucket.py +++ b/tasks/0034_945_34945606_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0034_945_34945606_qa_5/task.toml b/tasks/0034_945_34945606_qa_5/task.toml index 99c69104bc8d0dd10e94e471d73cfc9a334bc4ad..ddbf03349484eff7b8a55bbe49390cfb137ce8d8 100644 --- a/tasks/0034_945_34945606_qa_5/task.toml +++ b/tasks/0034_945_34945606_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_022_35022939_qa_2/environment/bootstrap.sh b/tasks/0035_022_35022939_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_022_35022939_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_022_35022939_qa_2/environment/pull_bucket.py b/tasks/0035_022_35022939_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_022_35022939_qa_2/environment/pull_bucket.py +++ b/tasks/0035_022_35022939_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_022_35022939_qa_2/task.toml b/tasks/0035_022_35022939_qa_2/task.toml index fec7c74b1c73eb933f9b33b6ec0253359747c218..9c2b644545ea9a2bd7e94cb0a5d9becb7e50b6ae 100644 --- a/tasks/0035_022_35022939_qa_2/task.toml +++ b/tasks/0035_022_35022939_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_025_35025726_qa_2/environment/bootstrap.sh b/tasks/0035_025_35025726_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_025_35025726_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_025_35025726_qa_2/environment/pull_bucket.py b/tasks/0035_025_35025726_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_025_35025726_qa_2/environment/pull_bucket.py +++ b/tasks/0035_025_35025726_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_025_35025726_qa_2/task.toml b/tasks/0035_025_35025726_qa_2/task.toml index 6f8e6c8c18e702a198d48e126ff51a102b6d6f4c..4ce99d2ddfa2d680bac85db558383b687db7e747 100644 --- a/tasks/0035_025_35025726_qa_2/task.toml +++ b/tasks/0035_025_35025726_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_070_35070602_qa_2/environment/bootstrap.sh b/tasks/0035_070_35070602_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_070_35070602_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_070_35070602_qa_2/environment/pull_bucket.py b/tasks/0035_070_35070602_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_070_35070602_qa_2/environment/pull_bucket.py +++ b/tasks/0035_070_35070602_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_070_35070602_qa_2/task.toml b/tasks/0035_070_35070602_qa_2/task.toml index 3bb176780fde8891f6f19b6d96212ca638cc4425..d4b858ac1ae3b8ddba9351745535422be2445d2d 100644 --- a/tasks/0035_070_35070602_qa_2/task.toml +++ b/tasks/0035_070_35070602_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_074_35074138_qa_2/environment/bootstrap.sh b/tasks/0035_074_35074138_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_074_35074138_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_074_35074138_qa_2/environment/pull_bucket.py b/tasks/0035_074_35074138_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_074_35074138_qa_2/environment/pull_bucket.py +++ b/tasks/0035_074_35074138_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_074_35074138_qa_2/task.toml b/tasks/0035_074_35074138_qa_2/task.toml index 2e1ba1a494b2905af8d7fcc77477b0054f2e16b0..82b209277f217e490d6c16d557d2ce0c747c9d52 100644 --- a/tasks/0035_074_35074138_qa_2/task.toml +++ b/tasks/0035_074_35074138_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_121_35121535_qa_1/environment/bootstrap.sh b/tasks/0035_121_35121535_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_121_35121535_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_121_35121535_qa_1/environment/pull_bucket.py b/tasks/0035_121_35121535_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_121_35121535_qa_1/environment/pull_bucket.py +++ b/tasks/0035_121_35121535_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_121_35121535_qa_1/task.toml b/tasks/0035_121_35121535_qa_1/task.toml index 64471c4366d607deb1db15acc8e755445379ca6b..80d64abe75cc66859c143726882bc2d4a3ef94b9 100644 --- a/tasks/0035_121_35121535_qa_1/task.toml +++ b/tasks/0035_121_35121535_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_122_35122628_qa_1/environment/bootstrap.sh b/tasks/0035_122_35122628_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_122_35122628_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_122_35122628_qa_1/environment/pull_bucket.py b/tasks/0035_122_35122628_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_122_35122628_qa_1/environment/pull_bucket.py +++ b/tasks/0035_122_35122628_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_122_35122628_qa_1/task.toml b/tasks/0035_122_35122628_qa_1/task.toml index 4b06c7cbaab2476350aab0c0ba1bbe071da1e317..7fe8da34ae581dc2a60f9d054969dd420c42faff 100644 --- a/tasks/0035_122_35122628_qa_1/task.toml +++ b/tasks/0035_122_35122628_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_152_35152468_qa_2/environment/bootstrap.sh b/tasks/0035_152_35152468_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_152_35152468_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_152_35152468_qa_2/environment/pull_bucket.py b/tasks/0035_152_35152468_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_152_35152468_qa_2/environment/pull_bucket.py +++ b/tasks/0035_152_35152468_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_152_35152468_qa_2/task.toml b/tasks/0035_152_35152468_qa_2/task.toml index 1631ebb1816723ee8838921c836378fda59e7eaa..370aa0958534a17e14455d782ada9edbcd42d003 100644 --- a/tasks/0035_152_35152468_qa_2/task.toml +++ b/tasks/0035_152_35152468_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_171_35171975_qa_3/environment/bootstrap.sh b/tasks/0035_171_35171975_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_171_35171975_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_171_35171975_qa_3/environment/pull_bucket.py b/tasks/0035_171_35171975_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_171_35171975_qa_3/environment/pull_bucket.py +++ b/tasks/0035_171_35171975_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_171_35171975_qa_3/task.toml b/tasks/0035_171_35171975_qa_3/task.toml index c03d720ccbbfcd820e0b12482d3c80ac151956af..16bc9f2bdd739a93f25112b81c9070dc91ba9b7f 100644 --- a/tasks/0035_171_35171975_qa_3/task.toml +++ b/tasks/0035_171_35171975_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_171_35171975_qa_4/environment/bootstrap.sh b/tasks/0035_171_35171975_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_171_35171975_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_171_35171975_qa_4/environment/pull_bucket.py b/tasks/0035_171_35171975_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_171_35171975_qa_4/environment/pull_bucket.py +++ b/tasks/0035_171_35171975_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_171_35171975_qa_4/task.toml b/tasks/0035_171_35171975_qa_4/task.toml index 0b3af76fad73af9a9b9512e603a1ddf066e9c184..4ff6e5c4c20aff7df502d6dc411d1b0bcb85a844 100644 --- a/tasks/0035_171_35171975_qa_4/task.toml +++ b/tasks/0035_171_35171975_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_188_35188217_qa_4/environment/bootstrap.sh b/tasks/0035_188_35188217_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_188_35188217_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_188_35188217_qa_4/environment/pull_bucket.py b/tasks/0035_188_35188217_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_188_35188217_qa_4/environment/pull_bucket.py +++ b/tasks/0035_188_35188217_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_188_35188217_qa_4/task.toml b/tasks/0035_188_35188217_qa_4/task.toml index 010813738c5d78be0f3e27de3bdb2bae4bdf6eb2..56f6cebf7a118e5e6771c6b48a1c041a5517c041 100644 --- a/tasks/0035_188_35188217_qa_4/task.toml +++ b/tasks/0035_188_35188217_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_225_35225660_qa_3/environment/bootstrap.sh b/tasks/0035_225_35225660_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_225_35225660_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_225_35225660_qa_3/environment/pull_bucket.py b/tasks/0035_225_35225660_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_225_35225660_qa_3/environment/pull_bucket.py +++ b/tasks/0035_225_35225660_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_225_35225660_qa_3/task.toml b/tasks/0035_225_35225660_qa_3/task.toml index 7aebffbdd86e21c2680185236dfa289310214075..5a34af449e1ea074541a060318a1d4ef5edcc551 100644 --- a/tasks/0035_225_35225660_qa_3/task.toml +++ b/tasks/0035_225_35225660_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_228_35228737_qa_5/environment/bootstrap.sh b/tasks/0035_228_35228737_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_228_35228737_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_228_35228737_qa_5/environment/pull_bucket.py b/tasks/0035_228_35228737_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_228_35228737_qa_5/environment/pull_bucket.py +++ b/tasks/0035_228_35228737_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_228_35228737_qa_5/task.toml b/tasks/0035_228_35228737_qa_5/task.toml index ab72cc769646f4e50041696b73dfd23d7d1df7ff..817f178c427a704b1e92123cd45d5d65bccde087 100644 --- a/tasks/0035_228_35228737_qa_5/task.toml +++ b/tasks/0035_228_35228737_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_236_35236430_qa_3/environment/bootstrap.sh b/tasks/0035_236_35236430_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_236_35236430_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_236_35236430_qa_3/environment/pull_bucket.py b/tasks/0035_236_35236430_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_236_35236430_qa_3/environment/pull_bucket.py +++ b/tasks/0035_236_35236430_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_236_35236430_qa_3/task.toml b/tasks/0035_236_35236430_qa_3/task.toml index 1d48f12dc94d3f86c1bfbc3904e0fe8cf6cece79..909b4ce47253f59141d0bc2f994d4da1c6a56273 100644 --- a/tasks/0035_236_35236430_qa_3/task.toml +++ b/tasks/0035_236_35236430_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_236_35236553_qa_1/environment/bootstrap.sh b/tasks/0035_236_35236553_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_236_35236553_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_236_35236553_qa_1/environment/pull_bucket.py b/tasks/0035_236_35236553_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_236_35236553_qa_1/environment/pull_bucket.py +++ b/tasks/0035_236_35236553_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_236_35236553_qa_1/task.toml b/tasks/0035_236_35236553_qa_1/task.toml index f79e1bbe36c7cad6559e5a9122abb36bf0cb9a72..d66d20fdf226cb0745b66f3a93c59de9be70c52b 100644 --- a/tasks/0035_236_35236553_qa_1/task.toml +++ b/tasks/0035_236_35236553_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_236_35236553_qa_4/environment/bootstrap.sh b/tasks/0035_236_35236553_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_236_35236553_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_236_35236553_qa_4/environment/pull_bucket.py b/tasks/0035_236_35236553_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_236_35236553_qa_4/environment/pull_bucket.py +++ b/tasks/0035_236_35236553_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_236_35236553_qa_4/task.toml b/tasks/0035_236_35236553_qa_4/task.toml index 6cdeed2877e69bb7c8eccd02d63752982adf7c91..c625b57c0ae9ad5fa07db29ff669ed66301cc0a7 100644 --- a/tasks/0035_236_35236553_qa_4/task.toml +++ b/tasks/0035_236_35236553_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_242_35242928_qa_2/environment/bootstrap.sh b/tasks/0035_242_35242928_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_242_35242928_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_242_35242928_qa_2/environment/pull_bucket.py b/tasks/0035_242_35242928_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_242_35242928_qa_2/environment/pull_bucket.py +++ b/tasks/0035_242_35242928_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_242_35242928_qa_2/task.toml b/tasks/0035_242_35242928_qa_2/task.toml index d6916d15a6f3f8d6fb76fece8fc47bf07f02c8be..4c4ac611b42e5b80f2608b228c39c64b277eeba0 100644 --- a/tasks/0035_242_35242928_qa_2/task.toml +++ b/tasks/0035_242_35242928_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_247_35247886_qa_1/environment/bootstrap.sh b/tasks/0035_247_35247886_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_247_35247886_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_247_35247886_qa_1/environment/pull_bucket.py b/tasks/0035_247_35247886_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_247_35247886_qa_1/environment/pull_bucket.py +++ b/tasks/0035_247_35247886_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_247_35247886_qa_1/task.toml b/tasks/0035_247_35247886_qa_1/task.toml index f63d9c2dcd9be229fc5744f122f763a3fb8326ee..b725cbf13175c76ab4ee0f83220e5bafbb9dc278 100644 --- a/tasks/0035_247_35247886_qa_1/task.toml +++ b/tasks/0035_247_35247886_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_269_35269567_qa_1/environment/bootstrap.sh b/tasks/0035_269_35269567_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_269_35269567_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_269_35269567_qa_1/environment/pull_bucket.py b/tasks/0035_269_35269567_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_269_35269567_qa_1/environment/pull_bucket.py +++ b/tasks/0035_269_35269567_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_269_35269567_qa_1/task.toml b/tasks/0035_269_35269567_qa_1/task.toml index a45599fd6cb2b0bf27ac20b51e09faecf087f34e..1bb91dd31d5fd7fc8a7022289f03c55b81ce37d0 100644 --- a/tasks/0035_269_35269567_qa_1/task.toml +++ b/tasks/0035_269_35269567_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_269_35269567_qa_2/environment/bootstrap.sh b/tasks/0035_269_35269567_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_269_35269567_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_269_35269567_qa_2/environment/pull_bucket.py b/tasks/0035_269_35269567_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_269_35269567_qa_2/environment/pull_bucket.py +++ b/tasks/0035_269_35269567_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_269_35269567_qa_2/task.toml b/tasks/0035_269_35269567_qa_2/task.toml index 8805b5c74a23402e9baee1a5c2e717c3494bb0f7..7681d90b371196798bdb2c6cde8b18c6282c05b8 100644 --- a/tasks/0035_269_35269567_qa_2/task.toml +++ b/tasks/0035_269_35269567_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_273_35273491_qa_3/environment/bootstrap.sh b/tasks/0035_273_35273491_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_273_35273491_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_273_35273491_qa_3/environment/pull_bucket.py b/tasks/0035_273_35273491_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_273_35273491_qa_3/environment/pull_bucket.py +++ b/tasks/0035_273_35273491_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_273_35273491_qa_3/task.toml b/tasks/0035_273_35273491_qa_3/task.toml index fe0a4a41b9ce09cd065d756dd4bf8d3a43d82667..61ff16d28d5cbe2a7b792ccfe9f27db999ee42e7 100644 --- a/tasks/0035_273_35273491_qa_3/task.toml +++ b/tasks/0035_273_35273491_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_303_35303628_qa_1/environment/bootstrap.sh b/tasks/0035_303_35303628_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_303_35303628_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_303_35303628_qa_1/environment/pull_bucket.py b/tasks/0035_303_35303628_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_303_35303628_qa_1/environment/pull_bucket.py +++ b/tasks/0035_303_35303628_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_303_35303628_qa_1/task.toml b/tasks/0035_303_35303628_qa_1/task.toml index b6437177d36b92a8b37639d932f1e223f979bf21..4906733e12ca3097610c2bbf2432fe50fc1b626d 100644 --- a/tasks/0035_303_35303628_qa_1/task.toml +++ b/tasks/0035_303_35303628_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_303_35303628_qa_2/environment/bootstrap.sh b/tasks/0035_303_35303628_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_303_35303628_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_303_35303628_qa_2/environment/pull_bucket.py b/tasks/0035_303_35303628_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_303_35303628_qa_2/environment/pull_bucket.py +++ b/tasks/0035_303_35303628_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_303_35303628_qa_2/task.toml b/tasks/0035_303_35303628_qa_2/task.toml index 13958100724e76b4eb286228756b93b0398ce86c..213ead52ab9ae75ae4cc6c5d051a6155cecc4d60 100644 --- a/tasks/0035_303_35303628_qa_2/task.toml +++ b/tasks/0035_303_35303628_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_332_35332466_qa_2/environment/bootstrap.sh b/tasks/0035_332_35332466_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_332_35332466_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_332_35332466_qa_2/environment/pull_bucket.py b/tasks/0035_332_35332466_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_332_35332466_qa_2/environment/pull_bucket.py +++ b/tasks/0035_332_35332466_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_332_35332466_qa_2/task.toml b/tasks/0035_332_35332466_qa_2/task.toml index 6392daf694c8a86371d16f52cc7caf069fd58a4d..3e8a5a9b7ed94a04a7f7afefe85071c657582331 100644 --- a/tasks/0035_332_35332466_qa_2/task.toml +++ b/tasks/0035_332_35332466_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_332_35332810_qa_3/environment/bootstrap.sh b/tasks/0035_332_35332810_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_332_35332810_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_332_35332810_qa_3/environment/pull_bucket.py b/tasks/0035_332_35332810_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_332_35332810_qa_3/environment/pull_bucket.py +++ b/tasks/0035_332_35332810_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_332_35332810_qa_3/task.toml b/tasks/0035_332_35332810_qa_3/task.toml index f21f044ddfe51c269e8f3f5725a8e37d8c1c229a..b043c47f6e38eb44b6605b80218e5aa11117c6d6 100644 --- a/tasks/0035_332_35332810_qa_3/task.toml +++ b/tasks/0035_332_35332810_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_336_35336797_qa_5/environment/bootstrap.sh b/tasks/0035_336_35336797_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_336_35336797_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_336_35336797_qa_5/environment/pull_bucket.py b/tasks/0035_336_35336797_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_336_35336797_qa_5/environment/pull_bucket.py +++ b/tasks/0035_336_35336797_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_336_35336797_qa_5/task.toml b/tasks/0035_336_35336797_qa_5/task.toml index c6bf373492db2014e22c10c83f60f73816ae9e6d..2b2f42aae7a39afecbc513a65c33d7cb8bda1ce7 100644 --- a/tasks/0035_336_35336797_qa_5/task.toml +++ b/tasks/0035_336_35336797_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_337_35337905_qa_1/environment/bootstrap.sh b/tasks/0035_337_35337905_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_337_35337905_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_337_35337905_qa_1/environment/pull_bucket.py b/tasks/0035_337_35337905_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_337_35337905_qa_1/environment/pull_bucket.py +++ b/tasks/0035_337_35337905_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_337_35337905_qa_1/task.toml b/tasks/0035_337_35337905_qa_1/task.toml index 877d508f80972b9dcc7db8c8da29734d3a2c4d22..9211d1b100092c408bdbab2234b89c0909206517 100644 --- a/tasks/0035_337_35337905_qa_1/task.toml +++ b/tasks/0035_337_35337905_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_350_35350224_qa_5/environment/bootstrap.sh b/tasks/0035_350_35350224_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_350_35350224_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_350_35350224_qa_5/environment/pull_bucket.py b/tasks/0035_350_35350224_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_350_35350224_qa_5/environment/pull_bucket.py +++ b/tasks/0035_350_35350224_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_350_35350224_qa_5/task.toml b/tasks/0035_350_35350224_qa_5/task.toml index 8dd3c5bd46a97e77de68a2e395ddb2de939fdbf9..e30616d3eafebb0a9ade7854287202fc6281906f 100644 --- a/tasks/0035_350_35350224_qa_5/task.toml +++ b/tasks/0035_350_35350224_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_362_35362667_qa_4/environment/bootstrap.sh b/tasks/0035_362_35362667_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_362_35362667_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_362_35362667_qa_4/environment/pull_bucket.py b/tasks/0035_362_35362667_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_362_35362667_qa_4/environment/pull_bucket.py +++ b/tasks/0035_362_35362667_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_362_35362667_qa_4/task.toml b/tasks/0035_362_35362667_qa_4/task.toml index f59eb062042d61c3f2cdf78684f2349640b9f7c7..d7ead1b0aafc86aa830b9bcb1dfe4a9d72e5a2ee 100644 --- a/tasks/0035_362_35362667_qa_4/task.toml +++ b/tasks/0035_362_35362667_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_362_35362667_qa_5/environment/bootstrap.sh b/tasks/0035_362_35362667_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_362_35362667_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_362_35362667_qa_5/environment/pull_bucket.py b/tasks/0035_362_35362667_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_362_35362667_qa_5/environment/pull_bucket.py +++ b/tasks/0035_362_35362667_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_362_35362667_qa_5/task.toml b/tasks/0035_362_35362667_qa_5/task.toml index 1ced5d9bac9549e459039cfb76847b759fce2255..9d5eae232d18fe5ca7cc0f8e3fe8124dadf6e955 100644 --- a/tasks/0035_362_35362667_qa_5/task.toml +++ b/tasks/0035_362_35362667_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_370_35370774_qa_3/environment/bootstrap.sh b/tasks/0035_370_35370774_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_370_35370774_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_370_35370774_qa_3/environment/pull_bucket.py b/tasks/0035_370_35370774_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_370_35370774_qa_3/environment/pull_bucket.py +++ b/tasks/0035_370_35370774_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_370_35370774_qa_3/task.toml b/tasks/0035_370_35370774_qa_3/task.toml index d291150ff63473d3d0cf568b5961c80abfc3dcd5..35bf77c3d13ec9db0bbe8fa74fd7f8d029bb80d0 100644 --- a/tasks/0035_370_35370774_qa_3/task.toml +++ b/tasks/0035_370_35370774_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_391_35391770_qa_1/environment/bootstrap.sh b/tasks/0035_391_35391770_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_391_35391770_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_391_35391770_qa_1/environment/pull_bucket.py b/tasks/0035_391_35391770_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_391_35391770_qa_1/environment/pull_bucket.py +++ b/tasks/0035_391_35391770_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_391_35391770_qa_1/task.toml b/tasks/0035_391_35391770_qa_1/task.toml index 761f595bfbd34dd8f00c133e9cabef2875a7bbed..47d55de7f7a60c67eb68b8f4ea5a2abdea1dede6 100644 --- a/tasks/0035_391_35391770_qa_1/task.toml +++ b/tasks/0035_391_35391770_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_442_35442155_qa_2/environment/bootstrap.sh b/tasks/0035_442_35442155_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_442_35442155_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_442_35442155_qa_2/environment/pull_bucket.py b/tasks/0035_442_35442155_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_442_35442155_qa_2/environment/pull_bucket.py +++ b/tasks/0035_442_35442155_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_442_35442155_qa_2/task.toml b/tasks/0035_442_35442155_qa_2/task.toml index 784b27ca7b22aaccf839572d881a76be69549b92..2ad7c14c4a3e1c3a7c1e44505462c300660a52a3 100644 --- a/tasks/0035_442_35442155_qa_2/task.toml +++ b/tasks/0035_442_35442155_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_456_35456170_qa_5/environment/bootstrap.sh b/tasks/0035_456_35456170_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_456_35456170_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_456_35456170_qa_5/environment/pull_bucket.py b/tasks/0035_456_35456170_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_456_35456170_qa_5/environment/pull_bucket.py +++ b/tasks/0035_456_35456170_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_456_35456170_qa_5/task.toml b/tasks/0035_456_35456170_qa_5/task.toml index e1cfa570f11dd8af4cee13d54e0251ea78a5fb2f..63f8e95ca577ed6476b5f2520a854b9885753e06 100644 --- a/tasks/0035_456_35456170_qa_5/task.toml +++ b/tasks/0035_456_35456170_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_513_35513650_qa_5/environment/bootstrap.sh b/tasks/0035_513_35513650_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_513_35513650_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_513_35513650_qa_5/environment/pull_bucket.py b/tasks/0035_513_35513650_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_513_35513650_qa_5/environment/pull_bucket.py +++ b/tasks/0035_513_35513650_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_513_35513650_qa_5/task.toml b/tasks/0035_513_35513650_qa_5/task.toml index a45173d9d6083d1eb9631732bfcbb3ccc4263716..3199793fe6ce457bc8143c4126762caa87bb87b6 100644 --- a/tasks/0035_513_35513650_qa_5/task.toml +++ b/tasks/0035_513_35513650_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_539_35539946_qa_3/environment/bootstrap.sh b/tasks/0035_539_35539946_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_539_35539946_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_539_35539946_qa_3/environment/pull_bucket.py b/tasks/0035_539_35539946_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_539_35539946_qa_3/environment/pull_bucket.py +++ b/tasks/0035_539_35539946_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_539_35539946_qa_3/task.toml b/tasks/0035_539_35539946_qa_3/task.toml index 4b5493ec2edd61c4aa4c884d9c325f7d878a12f0..9bfde7f15a3857e4adcf2bcea3ee3621fe6ae657 100644 --- a/tasks/0035_539_35539946_qa_3/task.toml +++ b/tasks/0035_539_35539946_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_546_35546963_qa_4/environment/bootstrap.sh b/tasks/0035_546_35546963_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_546_35546963_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_546_35546963_qa_4/environment/pull_bucket.py b/tasks/0035_546_35546963_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_546_35546963_qa_4/environment/pull_bucket.py +++ b/tasks/0035_546_35546963_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_546_35546963_qa_4/task.toml b/tasks/0035_546_35546963_qa_4/task.toml index de8eb3adb4ba70900e4472ae5a7c20f77c0afe09..92ca16d62b5c2a26cc4c4f8b3e446af82c9aa256 100644 --- a/tasks/0035_546_35546963_qa_4/task.toml +++ b/tasks/0035_546_35546963_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_558_35558843_qa_1/environment/bootstrap.sh b/tasks/0035_558_35558843_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_558_35558843_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_558_35558843_qa_1/environment/pull_bucket.py b/tasks/0035_558_35558843_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_558_35558843_qa_1/environment/pull_bucket.py +++ b/tasks/0035_558_35558843_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_558_35558843_qa_1/task.toml b/tasks/0035_558_35558843_qa_1/task.toml index 0502714c92e1c79048ab60b0331f072219486ab5..8133daa9baccf57abbf96756a6dd7a0506e6ef7b 100644 --- a/tasks/0035_558_35558843_qa_1/task.toml +++ b/tasks/0035_558_35558843_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_586_35586526_qa_2/environment/bootstrap.sh b/tasks/0035_586_35586526_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_586_35586526_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_586_35586526_qa_2/environment/pull_bucket.py b/tasks/0035_586_35586526_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_586_35586526_qa_2/environment/pull_bucket.py +++ b/tasks/0035_586_35586526_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_586_35586526_qa_2/task.toml b/tasks/0035_586_35586526_qa_2/task.toml index 0ddab79f4d569338455a4ba36fa67fc1bc60d7c7..eb4c792fa7d1e65b90d44a3fd116285c23b277e4 100644 --- a/tasks/0035_586_35586526_qa_2/task.toml +++ b/tasks/0035_586_35586526_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_609_35609748_qa_1/environment/bootstrap.sh b/tasks/0035_609_35609748_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_609_35609748_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_609_35609748_qa_1/environment/pull_bucket.py b/tasks/0035_609_35609748_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_609_35609748_qa_1/environment/pull_bucket.py +++ b/tasks/0035_609_35609748_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_609_35609748_qa_1/task.toml b/tasks/0035_609_35609748_qa_1/task.toml index 64d98af93dea39f472733411f3e54d63c0d0961d..0d89895560e7c3d3bc1840ec9d6b8bc19ca2cae5 100644 --- a/tasks/0035_609_35609748_qa_1/task.toml +++ b/tasks/0035_609_35609748_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_610_35610325_qa_3/environment/bootstrap.sh b/tasks/0035_610_35610325_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_610_35610325_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_610_35610325_qa_3/environment/pull_bucket.py b/tasks/0035_610_35610325_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_610_35610325_qa_3/environment/pull_bucket.py +++ b/tasks/0035_610_35610325_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_610_35610325_qa_3/task.toml b/tasks/0035_610_35610325_qa_3/task.toml index 772c46f0ff4447a2beeb6e6969a37d5b85dba72e..875948375cf0e84799f186b8f771d5a3c2331b75 100644 --- a/tasks/0035_610_35610325_qa_3/task.toml +++ b/tasks/0035_610_35610325_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_638_35638998_qa_1/environment/bootstrap.sh b/tasks/0035_638_35638998_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_638_35638998_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_638_35638998_qa_1/environment/pull_bucket.py b/tasks/0035_638_35638998_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_638_35638998_qa_1/environment/pull_bucket.py +++ b/tasks/0035_638_35638998_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_638_35638998_qa_1/task.toml b/tasks/0035_638_35638998_qa_1/task.toml index 1e44eac2cae3fa6ab2529fac7c64c64502795af3..4ec71fc3e5189c97a3aff5e0947e0cafacb393e2 100644 --- a/tasks/0035_638_35638998_qa_1/task.toml +++ b/tasks/0035_638_35638998_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_638_35638998_qa_4/environment/bootstrap.sh b/tasks/0035_638_35638998_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_638_35638998_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_638_35638998_qa_4/environment/pull_bucket.py b/tasks/0035_638_35638998_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_638_35638998_qa_4/environment/pull_bucket.py +++ b/tasks/0035_638_35638998_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_638_35638998_qa_4/task.toml b/tasks/0035_638_35638998_qa_4/task.toml index 10e55af5c2efab54b91fed89f702ad1966856355..2d6f40636fb7f7cdd85199f7decfc2bd1c085167 100644 --- a/tasks/0035_638_35638998_qa_4/task.toml +++ b/tasks/0035_638_35638998_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_645_35645519_qa_3/environment/bootstrap.sh b/tasks/0035_645_35645519_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_645_35645519_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_645_35645519_qa_3/environment/pull_bucket.py b/tasks/0035_645_35645519_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_645_35645519_qa_3/environment/pull_bucket.py +++ b/tasks/0035_645_35645519_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_645_35645519_qa_3/task.toml b/tasks/0035_645_35645519_qa_3/task.toml index 1cad783f47fc9f1b604075dabf0e4ac74a22286b..9d2a23d0f520e5e3ac89ab130a8f5324b906c217 100644 --- a/tasks/0035_645_35645519_qa_3/task.toml +++ b/tasks/0035_645_35645519_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_645_35645519_qa_4/environment/bootstrap.sh b/tasks/0035_645_35645519_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_645_35645519_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_645_35645519_qa_4/environment/pull_bucket.py b/tasks/0035_645_35645519_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_645_35645519_qa_4/environment/pull_bucket.py +++ b/tasks/0035_645_35645519_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_645_35645519_qa_4/task.toml b/tasks/0035_645_35645519_qa_4/task.toml index 8d5e7f438144ff6065bb888fecf83511f1f45358..db984eedda5a664fa8dfdc9841c033d31a65452b 100644 --- a/tasks/0035_645_35645519_qa_4/task.toml +++ b/tasks/0035_645_35645519_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_645_35645519_qa_5/environment/bootstrap.sh b/tasks/0035_645_35645519_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_645_35645519_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_645_35645519_qa_5/environment/pull_bucket.py b/tasks/0035_645_35645519_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_645_35645519_qa_5/environment/pull_bucket.py +++ b/tasks/0035_645_35645519_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_645_35645519_qa_5/task.toml b/tasks/0035_645_35645519_qa_5/task.toml index e9711240b421cc4930b216000b9de4ab0f150b47..8147dac402b7e355eec5f1302da0e34fb5319d9a 100644 --- a/tasks/0035_645_35645519_qa_5/task.toml +++ b/tasks/0035_645_35645519_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_700_35700149_qa_1/environment/bootstrap.sh b/tasks/0035_700_35700149_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_700_35700149_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_700_35700149_qa_1/environment/pull_bucket.py b/tasks/0035_700_35700149_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_700_35700149_qa_1/environment/pull_bucket.py +++ b/tasks/0035_700_35700149_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_700_35700149_qa_1/task.toml b/tasks/0035_700_35700149_qa_1/task.toml index 33dffc7cb1e0bcec049be7c5eff96c1fb78d9d96..e9bcbe828261f6afb1370621bc22f9d2839f988b 100644 --- a/tasks/0035_700_35700149_qa_1/task.toml +++ b/tasks/0035_700_35700149_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_700_35700149_qa_3/environment/bootstrap.sh b/tasks/0035_700_35700149_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_700_35700149_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_700_35700149_qa_3/environment/pull_bucket.py b/tasks/0035_700_35700149_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_700_35700149_qa_3/environment/pull_bucket.py +++ b/tasks/0035_700_35700149_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_700_35700149_qa_3/task.toml b/tasks/0035_700_35700149_qa_3/task.toml index aef23815fdbc202d39110bc7ea2aefa7017b8cfb..b56972ee16b5f7f956ee4c7e466f250653a0efc5 100644 --- a/tasks/0035_700_35700149_qa_3/task.toml +++ b/tasks/0035_700_35700149_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_712_35712790_qa_3/environment/bootstrap.sh b/tasks/0035_712_35712790_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_712_35712790_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_712_35712790_qa_3/environment/pull_bucket.py b/tasks/0035_712_35712790_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_712_35712790_qa_3/environment/pull_bucket.py +++ b/tasks/0035_712_35712790_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_712_35712790_qa_3/task.toml b/tasks/0035_712_35712790_qa_3/task.toml index 3403841b42b3ac17862ab3b1bfb3d50db55cd38a..929b83ae76834c31844d8e9b61af2a101ae41190 100644 --- a/tasks/0035_712_35712790_qa_3/task.toml +++ b/tasks/0035_712_35712790_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_717_35717551_qa_2/environment/bootstrap.sh b/tasks/0035_717_35717551_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_717_35717551_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_717_35717551_qa_2/environment/pull_bucket.py b/tasks/0035_717_35717551_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_717_35717551_qa_2/environment/pull_bucket.py +++ b/tasks/0035_717_35717551_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_717_35717551_qa_2/task.toml b/tasks/0035_717_35717551_qa_2/task.toml index 8c3d8c9e14e114c069d81a5831ae51d72202b6c9..c2c7a1418d6e454866c0f2e9d1f5ca525111ea0f 100644 --- a/tasks/0035_717_35717551_qa_2/task.toml +++ b/tasks/0035_717_35717551_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_717_35717551_qa_4/environment/bootstrap.sh b/tasks/0035_717_35717551_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_717_35717551_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_717_35717551_qa_4/environment/pull_bucket.py b/tasks/0035_717_35717551_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_717_35717551_qa_4/environment/pull_bucket.py +++ b/tasks/0035_717_35717551_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_717_35717551_qa_4/task.toml b/tasks/0035_717_35717551_qa_4/task.toml index 318cebbc326517e2c6ad1b63f9284389036fe288..ba6d9d04e69a59ee107ab67b4af6afd9733042bb 100644 --- a/tasks/0035_717_35717551_qa_4/task.toml +++ b/tasks/0035_717_35717551_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_745_35745803_qa_1/environment/bootstrap.sh b/tasks/0035_745_35745803_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_745_35745803_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_745_35745803_qa_1/environment/pull_bucket.py b/tasks/0035_745_35745803_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_745_35745803_qa_1/environment/pull_bucket.py +++ b/tasks/0035_745_35745803_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_745_35745803_qa_1/task.toml b/tasks/0035_745_35745803_qa_1/task.toml index 65ee6e9f50bfba4537e362a2f841021d9cc06cfe..df40175897270fc32cbe104f9db63751ac3cd4f9 100644 --- a/tasks/0035_745_35745803_qa_1/task.toml +++ b/tasks/0035_745_35745803_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_755_35755658_qa_3/environment/bootstrap.sh b/tasks/0035_755_35755658_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_755_35755658_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_755_35755658_qa_3/environment/pull_bucket.py b/tasks/0035_755_35755658_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_755_35755658_qa_3/environment/pull_bucket.py +++ b/tasks/0035_755_35755658_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_755_35755658_qa_3/task.toml b/tasks/0035_755_35755658_qa_3/task.toml index 62e7d721b83b2c0a7311638207aea276d06b993e..89f6f56dfcb725046a5aaa8eca7d9ded6e121085 100644 --- a/tasks/0035_755_35755658_qa_3/task.toml +++ b/tasks/0035_755_35755658_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_789_35789775_qa_3/environment/bootstrap.sh b/tasks/0035_789_35789775_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_789_35789775_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_789_35789775_qa_3/environment/pull_bucket.py b/tasks/0035_789_35789775_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_789_35789775_qa_3/environment/pull_bucket.py +++ b/tasks/0035_789_35789775_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_789_35789775_qa_3/task.toml b/tasks/0035_789_35789775_qa_3/task.toml index 2c8ad3dea7939a974588d7edaed4e9668ad88a90..24b4b1fa46f8c21be8dcd29a66b60ef4a98748be 100644 --- a/tasks/0035_789_35789775_qa_3/task.toml +++ b/tasks/0035_789_35789775_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_789_35789775_qa_5/environment/bootstrap.sh b/tasks/0035_789_35789775_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_789_35789775_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_789_35789775_qa_5/environment/pull_bucket.py b/tasks/0035_789_35789775_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_789_35789775_qa_5/environment/pull_bucket.py +++ b/tasks/0035_789_35789775_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_789_35789775_qa_5/task.toml b/tasks/0035_789_35789775_qa_5/task.toml index efa70c7f5d8d301e05c709abc4b8edebcbd4b4fb..8dc4b755f79321b96af3d6d094806e7a6225424e 100644 --- a/tasks/0035_789_35789775_qa_5/task.toml +++ b/tasks/0035_789_35789775_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_812_35812389_qa_2/environment/bootstrap.sh b/tasks/0035_812_35812389_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_812_35812389_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_812_35812389_qa_2/environment/pull_bucket.py b/tasks/0035_812_35812389_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_812_35812389_qa_2/environment/pull_bucket.py +++ b/tasks/0035_812_35812389_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_812_35812389_qa_2/task.toml b/tasks/0035_812_35812389_qa_2/task.toml index 859a0c1596c4e51a083a1626402f460cca40bc74..76f9f1a3a77352ae6567ae4dfefb6560afcb7134 100644 --- a/tasks/0035_812_35812389_qa_2/task.toml +++ b/tasks/0035_812_35812389_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_835_35835284_qa_2/environment/bootstrap.sh b/tasks/0035_835_35835284_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_835_35835284_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_835_35835284_qa_2/environment/pull_bucket.py b/tasks/0035_835_35835284_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_835_35835284_qa_2/environment/pull_bucket.py +++ b/tasks/0035_835_35835284_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_835_35835284_qa_2/task.toml b/tasks/0035_835_35835284_qa_2/task.toml index 8f9bce8ac5432fd6a29f51e96e31f697e1696f6d..6b928821b6899c2b8c50fea86ace24a691ee038b 100644 --- a/tasks/0035_835_35835284_qa_2/task.toml +++ b/tasks/0035_835_35835284_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_835_35835284_qa_3/environment/bootstrap.sh b/tasks/0035_835_35835284_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_835_35835284_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_835_35835284_qa_3/environment/pull_bucket.py b/tasks/0035_835_35835284_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_835_35835284_qa_3/environment/pull_bucket.py +++ b/tasks/0035_835_35835284_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_835_35835284_qa_3/task.toml b/tasks/0035_835_35835284_qa_3/task.toml index 83707ba5f14330fec3b759f283aa8ddbfd6be72d..6207ce1db661638bc179e89959c8bb14312fe963 100644 --- a/tasks/0035_835_35835284_qa_3/task.toml +++ b/tasks/0035_835_35835284_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_901_35901074_qa_5/environment/bootstrap.sh b/tasks/0035_901_35901074_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_901_35901074_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_901_35901074_qa_5/environment/pull_bucket.py b/tasks/0035_901_35901074_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_901_35901074_qa_5/environment/pull_bucket.py +++ b/tasks/0035_901_35901074_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_901_35901074_qa_5/task.toml b/tasks/0035_901_35901074_qa_5/task.toml index 196722fc8f53fbd77d6b24d5c2866c57c3138545..90383b1469ae341a663ded6e5d967fece5d9c9f1 100644 --- a/tasks/0035_901_35901074_qa_5/task.toml +++ b/tasks/0035_901_35901074_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_911_35911748_qa_2/environment/bootstrap.sh b/tasks/0035_911_35911748_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_911_35911748_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_911_35911748_qa_2/environment/pull_bucket.py b/tasks/0035_911_35911748_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_911_35911748_qa_2/environment/pull_bucket.py +++ b/tasks/0035_911_35911748_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_911_35911748_qa_2/task.toml b/tasks/0035_911_35911748_qa_2/task.toml index 3c1d1b5f0fc1704bf2fbac4a87c77c30d895cd4c..fc251d62321f8333a0cc1256d54cc339434abeac 100644 --- a/tasks/0035_911_35911748_qa_2/task.toml +++ b/tasks/0035_911_35911748_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_921_35921172_qa_1/environment/bootstrap.sh b/tasks/0035_921_35921172_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_921_35921172_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_921_35921172_qa_1/environment/pull_bucket.py b/tasks/0035_921_35921172_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_921_35921172_qa_1/environment/pull_bucket.py +++ b/tasks/0035_921_35921172_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_921_35921172_qa_1/task.toml b/tasks/0035_921_35921172_qa_1/task.toml index e5ea55c6128599009c714a204ad19d4d0e8246a5..062cb74abac797204987b1036eb0ad41b904a07b 100644 --- a/tasks/0035_921_35921172_qa_1/task.toml +++ b/tasks/0035_921_35921172_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_921_35921172_qa_4/environment/bootstrap.sh b/tasks/0035_921_35921172_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_921_35921172_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_921_35921172_qa_4/environment/pull_bucket.py b/tasks/0035_921_35921172_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_921_35921172_qa_4/environment/pull_bucket.py +++ b/tasks/0035_921_35921172_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_921_35921172_qa_4/task.toml b/tasks/0035_921_35921172_qa_4/task.toml index ab14aa0c086b74e0bf5a9ffebb5a289763ed2ad0..a6eb2053e067d6267f3aacd079817d26115c6edc 100644 --- a/tasks/0035_921_35921172_qa_4/task.toml +++ b/tasks/0035_921_35921172_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_921_35921172_qa_5/environment/bootstrap.sh b/tasks/0035_921_35921172_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_921_35921172_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_921_35921172_qa_5/environment/pull_bucket.py b/tasks/0035_921_35921172_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_921_35921172_qa_5/environment/pull_bucket.py +++ b/tasks/0035_921_35921172_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_921_35921172_qa_5/task.toml b/tasks/0035_921_35921172_qa_5/task.toml index c9a663bf25a553386e327abbbec50709ab61d831..f18811766806efb27878725ae9d3ff7dc5856df4 100644 --- a/tasks/0035_921_35921172_qa_5/task.toml +++ b/tasks/0035_921_35921172_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_974_35974226_qa_4/environment/bootstrap.sh b/tasks/0035_974_35974226_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_974_35974226_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_974_35974226_qa_4/environment/pull_bucket.py b/tasks/0035_974_35974226_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_974_35974226_qa_4/environment/pull_bucket.py +++ b/tasks/0035_974_35974226_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_974_35974226_qa_4/task.toml b/tasks/0035_974_35974226_qa_4/task.toml index fe5631718e78f4b7ec77bf9000193963b84e6042..483050387814e32cee2fac0361f5cc4ffac066ed 100644 --- a/tasks/0035_974_35974226_qa_4/task.toml +++ b/tasks/0035_974_35974226_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_980_35980933_qa_5/environment/bootstrap.sh b/tasks/0035_980_35980933_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_980_35980933_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_980_35980933_qa_5/environment/pull_bucket.py b/tasks/0035_980_35980933_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_980_35980933_qa_5/environment/pull_bucket.py +++ b/tasks/0035_980_35980933_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_980_35980933_qa_5/task.toml b/tasks/0035_980_35980933_qa_5/task.toml index 9ac662a5130d51b421cf3468ae98c97ea0f747dc..c30e2cf92c2fcf4a7547348dba1f09fe47e93940 100644 --- a/tasks/0035_980_35980933_qa_5/task.toml +++ b/tasks/0035_980_35980933_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0035_999_35999601_qa_3/environment/bootstrap.sh b/tasks/0035_999_35999601_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0035_999_35999601_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0035_999_35999601_qa_3/environment/pull_bucket.py b/tasks/0035_999_35999601_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0035_999_35999601_qa_3/environment/pull_bucket.py +++ b/tasks/0035_999_35999601_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0035_999_35999601_qa_3/task.toml b/tasks/0035_999_35999601_qa_3/task.toml index c633becfcf41fb690532aa096e14a6248bd62e9d..550fc21f3a8504b248705bf99918658d5b86a559 100644 --- a/tasks/0035_999_35999601_qa_3/task.toml +++ b/tasks/0035_999_35999601_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_001_36001422_qa_1/environment/bootstrap.sh b/tasks/0036_001_36001422_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_001_36001422_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_001_36001422_qa_1/environment/pull_bucket.py b/tasks/0036_001_36001422_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_001_36001422_qa_1/environment/pull_bucket.py +++ b/tasks/0036_001_36001422_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_001_36001422_qa_1/task.toml b/tasks/0036_001_36001422_qa_1/task.toml index e4e1044fe995d8fd3bcdc7cb1e6e71c98d78fcd2..37df15c19ecd34e57c60d07667c8b8422c08b2ef 100644 --- a/tasks/0036_001_36001422_qa_1/task.toml +++ b/tasks/0036_001_36001422_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_030_36030056_qa_2/environment/bootstrap.sh b/tasks/0036_030_36030056_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_030_36030056_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_030_36030056_qa_2/environment/pull_bucket.py b/tasks/0036_030_36030056_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_030_36030056_qa_2/environment/pull_bucket.py +++ b/tasks/0036_030_36030056_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_030_36030056_qa_2/task.toml b/tasks/0036_030_36030056_qa_2/task.toml index b24f45e8a909fc16ac5b432ef2e75c243a536fed..5f31f9e6f451eb5764e895e8c3da15b5bd8a77a1 100644 --- a/tasks/0036_030_36030056_qa_2/task.toml +++ b/tasks/0036_030_36030056_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_141_36141043_qa_2/environment/bootstrap.sh b/tasks/0036_141_36141043_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_141_36141043_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_141_36141043_qa_2/environment/pull_bucket.py b/tasks/0036_141_36141043_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_141_36141043_qa_2/environment/pull_bucket.py +++ b/tasks/0036_141_36141043_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_141_36141043_qa_2/task.toml b/tasks/0036_141_36141043_qa_2/task.toml index 493ec38118f5bb9abfac3e8bc5c84c1a52381543..a52720498cbf032123c940cd52aa9b5662806a6a 100644 --- a/tasks/0036_141_36141043_qa_2/task.toml +++ b/tasks/0036_141_36141043_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_186_36186441_qa_2/environment/bootstrap.sh b/tasks/0036_186_36186441_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_186_36186441_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_186_36186441_qa_2/environment/pull_bucket.py b/tasks/0036_186_36186441_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_186_36186441_qa_2/environment/pull_bucket.py +++ b/tasks/0036_186_36186441_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_186_36186441_qa_2/task.toml b/tasks/0036_186_36186441_qa_2/task.toml index 30fb16c440ae559c5e50a7cd2a8b97a4bc834cf2..6474cf853f7d20c4c06eafd49ea3c4bd86287799 100644 --- a/tasks/0036_186_36186441_qa_2/task.toml +++ b/tasks/0036_186_36186441_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_230_36230590_qa_1/environment/bootstrap.sh b/tasks/0036_230_36230590_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_230_36230590_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_230_36230590_qa_1/environment/pull_bucket.py b/tasks/0036_230_36230590_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_230_36230590_qa_1/environment/pull_bucket.py +++ b/tasks/0036_230_36230590_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_230_36230590_qa_1/task.toml b/tasks/0036_230_36230590_qa_1/task.toml index 67ca46075d678b43007ed7f87b03cb922c58a1c0..9e94946f0dd28e0e593c054224ddf5aa75f15da1 100644 --- a/tasks/0036_230_36230590_qa_1/task.toml +++ b/tasks/0036_230_36230590_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_275_36275138_qa_4/environment/bootstrap.sh b/tasks/0036_275_36275138_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_275_36275138_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_275_36275138_qa_4/environment/pull_bucket.py b/tasks/0036_275_36275138_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_275_36275138_qa_4/environment/pull_bucket.py +++ b/tasks/0036_275_36275138_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_275_36275138_qa_4/task.toml b/tasks/0036_275_36275138_qa_4/task.toml index c9a7777e68564c93f02561bec459254a1d6828c4..5f4f81b0c0983d28da58a6adf637e14d2dea086e 100644 --- a/tasks/0036_275_36275138_qa_4/task.toml +++ b/tasks/0036_275_36275138_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_275_36275741_qa_5/environment/bootstrap.sh b/tasks/0036_275_36275741_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_275_36275741_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_275_36275741_qa_5/environment/pull_bucket.py b/tasks/0036_275_36275741_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_275_36275741_qa_5/environment/pull_bucket.py +++ b/tasks/0036_275_36275741_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_275_36275741_qa_5/task.toml b/tasks/0036_275_36275741_qa_5/task.toml index 7656716c3f2c571435e5ea3c4ca178a7324dc393..419d88cf3e3aedb2b44527a90cf715ad1afec2f7 100644 --- a/tasks/0036_275_36275741_qa_5/task.toml +++ b/tasks/0036_275_36275741_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_294_36294724_qa_1/environment/bootstrap.sh b/tasks/0036_294_36294724_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_294_36294724_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_294_36294724_qa_1/environment/pull_bucket.py b/tasks/0036_294_36294724_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_294_36294724_qa_1/environment/pull_bucket.py +++ b/tasks/0036_294_36294724_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_294_36294724_qa_1/task.toml b/tasks/0036_294_36294724_qa_1/task.toml index 7e997df48d712ba45e8342f98383f8b363c978ce..409a3ebdccd3035b665dee00eb34f36930640988 100644 --- a/tasks/0036_294_36294724_qa_1/task.toml +++ b/tasks/0036_294_36294724_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_305_36305200_qa_3/environment/bootstrap.sh b/tasks/0036_305_36305200_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_305_36305200_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_305_36305200_qa_3/environment/pull_bucket.py b/tasks/0036_305_36305200_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_305_36305200_qa_3/environment/pull_bucket.py +++ b/tasks/0036_305_36305200_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_305_36305200_qa_3/task.toml b/tasks/0036_305_36305200_qa_3/task.toml index 80ff4a1114f88e49a0d2e18536a668d79a5ac677..838fff7e5ffd9fbd5e3100fcfde26150178a0c31 100644 --- a/tasks/0036_305_36305200_qa_3/task.toml +++ b/tasks/0036_305_36305200_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_324_36324294_qa_1/environment/bootstrap.sh b/tasks/0036_324_36324294_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_324_36324294_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_324_36324294_qa_1/environment/pull_bucket.py b/tasks/0036_324_36324294_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_324_36324294_qa_1/environment/pull_bucket.py +++ b/tasks/0036_324_36324294_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_324_36324294_qa_1/task.toml b/tasks/0036_324_36324294_qa_1/task.toml index f1b5817b7e3d35d90bc7be61f77b41d85abef35a..b5791c582de599779a069d8c517fc0afa5acb434 100644 --- a/tasks/0036_324_36324294_qa_1/task.toml +++ b/tasks/0036_324_36324294_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_430_36430763_qa_1/environment/bootstrap.sh b/tasks/0036_430_36430763_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_430_36430763_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_430_36430763_qa_1/environment/pull_bucket.py b/tasks/0036_430_36430763_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_430_36430763_qa_1/environment/pull_bucket.py +++ b/tasks/0036_430_36430763_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_430_36430763_qa_1/task.toml b/tasks/0036_430_36430763_qa_1/task.toml index 95ae455382c3126d39600632db871df62b865dc8..c6ab8b4f50d834ab7092d0405878d5e158dff2ed 100644 --- a/tasks/0036_430_36430763_qa_1/task.toml +++ b/tasks/0036_430_36430763_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_430_36430763_qa_5/environment/bootstrap.sh b/tasks/0036_430_36430763_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_430_36430763_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_430_36430763_qa_5/environment/pull_bucket.py b/tasks/0036_430_36430763_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_430_36430763_qa_5/environment/pull_bucket.py +++ b/tasks/0036_430_36430763_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_430_36430763_qa_5/task.toml b/tasks/0036_430_36430763_qa_5/task.toml index c9fff337829e1ce4f4183fe24205e1a9a0e8be47..bbb930e77dfd88fea55147b77dd9ed791235f198 100644 --- a/tasks/0036_430_36430763_qa_5/task.toml +++ b/tasks/0036_430_36430763_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_436_36436182_qa_5/environment/bootstrap.sh b/tasks/0036_436_36436182_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_436_36436182_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_436_36436182_qa_5/environment/pull_bucket.py b/tasks/0036_436_36436182_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_436_36436182_qa_5/environment/pull_bucket.py +++ b/tasks/0036_436_36436182_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_436_36436182_qa_5/task.toml b/tasks/0036_436_36436182_qa_5/task.toml index e18a58db1f40d25137537e10ad77782d98ab4247..62b3a3c2b9f9382e86e81f77f55f9e66713d2bbd 100644 --- a/tasks/0036_436_36436182_qa_5/task.toml +++ b/tasks/0036_436_36436182_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_510_36510950_qa_3/environment/bootstrap.sh b/tasks/0036_510_36510950_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_510_36510950_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_510_36510950_qa_3/environment/pull_bucket.py b/tasks/0036_510_36510950_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_510_36510950_qa_3/environment/pull_bucket.py +++ b/tasks/0036_510_36510950_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_510_36510950_qa_3/task.toml b/tasks/0036_510_36510950_qa_3/task.toml index 6ab6ff2895fef4607c13018d7dd71d4e55319b3e..8d7e34832e288c4b68843865adb9409923eb9ed1 100644 --- a/tasks/0036_510_36510950_qa_3/task.toml +++ b/tasks/0036_510_36510950_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_510_36510950_qa_4/environment/bootstrap.sh b/tasks/0036_510_36510950_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_510_36510950_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_510_36510950_qa_4/environment/pull_bucket.py b/tasks/0036_510_36510950_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_510_36510950_qa_4/environment/pull_bucket.py +++ b/tasks/0036_510_36510950_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_510_36510950_qa_4/task.toml b/tasks/0036_510_36510950_qa_4/task.toml index b3d646c8421e93a4e0b90c1f07d08ff9d48f9735..d867ffb3cb84933fe6de472748d13b6da58e6ca5 100644 --- a/tasks/0036_510_36510950_qa_4/task.toml +++ b/tasks/0036_510_36510950_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_510_36510950_qa_5/environment/bootstrap.sh b/tasks/0036_510_36510950_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_510_36510950_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_510_36510950_qa_5/environment/pull_bucket.py b/tasks/0036_510_36510950_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_510_36510950_qa_5/environment/pull_bucket.py +++ b/tasks/0036_510_36510950_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_510_36510950_qa_5/task.toml b/tasks/0036_510_36510950_qa_5/task.toml index 39859acb549c9195e515d9b5eca60a9fba1fb7cc..16ba500a90fd96f865006060291cd345f4ba1212 100644 --- a/tasks/0036_510_36510950_qa_5/task.toml +++ b/tasks/0036_510_36510950_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_579_36579520_qa_4/environment/bootstrap.sh b/tasks/0036_579_36579520_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_579_36579520_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_579_36579520_qa_4/environment/pull_bucket.py b/tasks/0036_579_36579520_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_579_36579520_qa_4/environment/pull_bucket.py +++ b/tasks/0036_579_36579520_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_579_36579520_qa_4/task.toml b/tasks/0036_579_36579520_qa_4/task.toml index 7953189249f8af6611cd78e5a909dd4dcb07ba08..973eeb85b93844259b4864468694be51e25e3e53 100644 --- a/tasks/0036_579_36579520_qa_4/task.toml +++ b/tasks/0036_579_36579520_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_629_36629065_qa_2/environment/bootstrap.sh b/tasks/0036_629_36629065_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_629_36629065_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_629_36629065_qa_2/environment/pull_bucket.py b/tasks/0036_629_36629065_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_629_36629065_qa_2/environment/pull_bucket.py +++ b/tasks/0036_629_36629065_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_629_36629065_qa_2/task.toml b/tasks/0036_629_36629065_qa_2/task.toml index 623b5b86027a0299a8394a44a361b0571efac4ac..263fcecd787aa9814c3fc10d52226a1f49e4bb71 100644 --- a/tasks/0036_629_36629065_qa_2/task.toml +++ b/tasks/0036_629_36629065_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_637_36637598_qa_2/environment/bootstrap.sh b/tasks/0036_637_36637598_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_637_36637598_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_637_36637598_qa_2/environment/pull_bucket.py b/tasks/0036_637_36637598_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_637_36637598_qa_2/environment/pull_bucket.py +++ b/tasks/0036_637_36637598_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_637_36637598_qa_2/task.toml b/tasks/0036_637_36637598_qa_2/task.toml index 2e68a7db37e3c1d79de9115f356a2a6524526a95..1d60cc2d336cb6e8149bb33db2d0ca1e3e82c023 100644 --- a/tasks/0036_637_36637598_qa_2/task.toml +++ b/tasks/0036_637_36637598_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_637_36637598_qa_4/environment/bootstrap.sh b/tasks/0036_637_36637598_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_637_36637598_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_637_36637598_qa_4/environment/pull_bucket.py b/tasks/0036_637_36637598_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_637_36637598_qa_4/environment/pull_bucket.py +++ b/tasks/0036_637_36637598_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_637_36637598_qa_4/task.toml b/tasks/0036_637_36637598_qa_4/task.toml index 41f3622693109d6d94a59295b6856fb831a31964..6e42cba7266629f4f17341b67adcf4bc1a941e37 100644 --- a/tasks/0036_637_36637598_qa_4/task.toml +++ b/tasks/0036_637_36637598_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_800_36800377_qa_3/environment/bootstrap.sh b/tasks/0036_800_36800377_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_800_36800377_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_800_36800377_qa_3/environment/pull_bucket.py b/tasks/0036_800_36800377_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_800_36800377_qa_3/environment/pull_bucket.py +++ b/tasks/0036_800_36800377_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_800_36800377_qa_3/task.toml b/tasks/0036_800_36800377_qa_3/task.toml index 9b9847dd24fc5d501839438cfdd07e7695100f95..71c1f7c52d2e526cfe0fc875c0977c678b9c4744 100644 --- a/tasks/0036_800_36800377_qa_3/task.toml +++ b/tasks/0036_800_36800377_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_800_36800377_qa_4/environment/bootstrap.sh b/tasks/0036_800_36800377_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_800_36800377_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_800_36800377_qa_4/environment/pull_bucket.py b/tasks/0036_800_36800377_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_800_36800377_qa_4/environment/pull_bucket.py +++ b/tasks/0036_800_36800377_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_800_36800377_qa_4/task.toml b/tasks/0036_800_36800377_qa_4/task.toml index 9d3954c9446fea4febcdbc568736e6e81d4b6cff..2d3d45016771bfbf162d45b3159ab3ab9cbc69d7 100644 --- a/tasks/0036_800_36800377_qa_4/task.toml +++ b/tasks/0036_800_36800377_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_800_36800377_qa_5/environment/bootstrap.sh b/tasks/0036_800_36800377_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_800_36800377_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_800_36800377_qa_5/environment/pull_bucket.py b/tasks/0036_800_36800377_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_800_36800377_qa_5/environment/pull_bucket.py +++ b/tasks/0036_800_36800377_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_800_36800377_qa_5/task.toml b/tasks/0036_800_36800377_qa_5/task.toml index 2c3ead60e5f3fb75eae45adf89938aeeb42ca323..39d561355c62989247b53d9f40e9a9950ba99f4e 100644 --- a/tasks/0036_800_36800377_qa_5/task.toml +++ b/tasks/0036_800_36800377_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_817_36817810_qa_1/environment/bootstrap.sh b/tasks/0036_817_36817810_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_817_36817810_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_817_36817810_qa_1/environment/pull_bucket.py b/tasks/0036_817_36817810_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_817_36817810_qa_1/environment/pull_bucket.py +++ b/tasks/0036_817_36817810_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_817_36817810_qa_1/task.toml b/tasks/0036_817_36817810_qa_1/task.toml index 62df7f5b5bd7a8845cb0abd2c86cacd831a972b6..aa3069bcdc8c550e6f54b12abe6ecb227d4a1b9b 100644 --- a/tasks/0036_817_36817810_qa_1/task.toml +++ b/tasks/0036_817_36817810_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_817_36817810_qa_4/environment/bootstrap.sh b/tasks/0036_817_36817810_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_817_36817810_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_817_36817810_qa_4/environment/pull_bucket.py b/tasks/0036_817_36817810_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_817_36817810_qa_4/environment/pull_bucket.py +++ b/tasks/0036_817_36817810_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_817_36817810_qa_4/task.toml b/tasks/0036_817_36817810_qa_4/task.toml index e2e9fce8994173a637a24d59e9f30eefdd829ae2..c4edba826b9fb5d118e7d57da46fb1b2a0a8db55 100644 --- a/tasks/0036_817_36817810_qa_4/task.toml +++ b/tasks/0036_817_36817810_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_818_36818972_qa_1/environment/bootstrap.sh b/tasks/0036_818_36818972_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_818_36818972_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_818_36818972_qa_1/environment/pull_bucket.py b/tasks/0036_818_36818972_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_818_36818972_qa_1/environment/pull_bucket.py +++ b/tasks/0036_818_36818972_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_818_36818972_qa_1/task.toml b/tasks/0036_818_36818972_qa_1/task.toml index b75ef4bf24be511e09b2c613f6399af348950fdc..3c85229f031d4abb7aa44bad48fa67779390b5e8 100644 --- a/tasks/0036_818_36818972_qa_1/task.toml +++ b/tasks/0036_818_36818972_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_847_36847235_qa_1/environment/bootstrap.sh b/tasks/0036_847_36847235_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_847_36847235_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_847_36847235_qa_1/environment/pull_bucket.py b/tasks/0036_847_36847235_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_847_36847235_qa_1/environment/pull_bucket.py +++ b/tasks/0036_847_36847235_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_847_36847235_qa_1/task.toml b/tasks/0036_847_36847235_qa_1/task.toml index 18d1c9d27992718309a7b671db57c3a7973ef0e3..5e88ef9316ec75406efd97ad4ed1b98decf9c687 100644 --- a/tasks/0036_847_36847235_qa_1/task.toml +++ b/tasks/0036_847_36847235_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_916_36916974_qa_1/environment/bootstrap.sh b/tasks/0036_916_36916974_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_916_36916974_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_916_36916974_qa_1/environment/pull_bucket.py b/tasks/0036_916_36916974_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_916_36916974_qa_1/environment/pull_bucket.py +++ b/tasks/0036_916_36916974_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_916_36916974_qa_1/task.toml b/tasks/0036_916_36916974_qa_1/task.toml index 16015d84308d914681fcf5db7be788b3674bc39b..63e7911015e7b43e9deb6ebcdf24037e95bd1abc 100644 --- a/tasks/0036_916_36916974_qa_1/task.toml +++ b/tasks/0036_916_36916974_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_916_36916974_qa_5/environment/bootstrap.sh b/tasks/0036_916_36916974_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_916_36916974_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_916_36916974_qa_5/environment/pull_bucket.py b/tasks/0036_916_36916974_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_916_36916974_qa_5/environment/pull_bucket.py +++ b/tasks/0036_916_36916974_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_916_36916974_qa_5/task.toml b/tasks/0036_916_36916974_qa_5/task.toml index 8bb8ded5533b193abd0d79b87061a0c81a2de4ad..bd5985b3e84e789f179dabac836e5cb689b416ed 100644 --- a/tasks/0036_916_36916974_qa_5/task.toml +++ b/tasks/0036_916_36916974_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_927_36927955_qa_1/environment/bootstrap.sh b/tasks/0036_927_36927955_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_927_36927955_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_927_36927955_qa_1/environment/pull_bucket.py b/tasks/0036_927_36927955_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_927_36927955_qa_1/environment/pull_bucket.py +++ b/tasks/0036_927_36927955_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_927_36927955_qa_1/task.toml b/tasks/0036_927_36927955_qa_1/task.toml index a95bc2edff118abf15efebf821e40e767661dfe6..bb0e28386d007795fe7605535ff8baf5b8f6e22a 100644 --- a/tasks/0036_927_36927955_qa_1/task.toml +++ b/tasks/0036_927_36927955_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0036_949_36949181_qa_1/environment/bootstrap.sh b/tasks/0036_949_36949181_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0036_949_36949181_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0036_949_36949181_qa_1/environment/pull_bucket.py b/tasks/0036_949_36949181_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0036_949_36949181_qa_1/environment/pull_bucket.py +++ b/tasks/0036_949_36949181_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0036_949_36949181_qa_1/task.toml b/tasks/0036_949_36949181_qa_1/task.toml index e7ad05c81415535205e7d48ea9fd10d18acf7cc2..d155e89ed77f7345608260e27f1cc481f82e00db 100644 --- a/tasks/0036_949_36949181_qa_1/task.toml +++ b/tasks/0036_949_36949181_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_011_37011559_qa_5/environment/bootstrap.sh b/tasks/0037_011_37011559_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_011_37011559_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_011_37011559_qa_5/environment/pull_bucket.py b/tasks/0037_011_37011559_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_011_37011559_qa_5/environment/pull_bucket.py +++ b/tasks/0037_011_37011559_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_011_37011559_qa_5/task.toml b/tasks/0037_011_37011559_qa_5/task.toml index 50eced0cc6f63252c96785d9df4b86d1b6c3b113..db7bf268256c26774b0286a3ba0700e988a3cd6c 100644 --- a/tasks/0037_011_37011559_qa_5/task.toml +++ b/tasks/0037_011_37011559_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_052_37052709_qa_5/environment/bootstrap.sh b/tasks/0037_052_37052709_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_052_37052709_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_052_37052709_qa_5/environment/pull_bucket.py b/tasks/0037_052_37052709_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_052_37052709_qa_5/environment/pull_bucket.py +++ b/tasks/0037_052_37052709_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_052_37052709_qa_5/task.toml b/tasks/0037_052_37052709_qa_5/task.toml index 7a4c7b64024fb0d8dc5b6495a78922923e236e97..90b8ce2bbde1a0693e066c117a79c6c447f49580 100644 --- a/tasks/0037_052_37052709_qa_5/task.toml +++ b/tasks/0037_052_37052709_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_084_37084203_qa_1/environment/bootstrap.sh b/tasks/0037_084_37084203_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_084_37084203_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_084_37084203_qa_1/environment/pull_bucket.py b/tasks/0037_084_37084203_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_084_37084203_qa_1/environment/pull_bucket.py +++ b/tasks/0037_084_37084203_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_084_37084203_qa_1/task.toml b/tasks/0037_084_37084203_qa_1/task.toml index ce641a8b2a84cefdb9e9efa06e8f1f93529ab70d..ffb7bd3f89f6d1fa054183d8d54d7c53a754862a 100644 --- a/tasks/0037_084_37084203_qa_1/task.toml +++ b/tasks/0037_084_37084203_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_093_37093290_qa_1/environment/bootstrap.sh b/tasks/0037_093_37093290_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_093_37093290_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_093_37093290_qa_1/environment/pull_bucket.py b/tasks/0037_093_37093290_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_093_37093290_qa_1/environment/pull_bucket.py +++ b/tasks/0037_093_37093290_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_093_37093290_qa_1/task.toml b/tasks/0037_093_37093290_qa_1/task.toml index f0c04048b0b03836958268d0d11c048b10881d56..8cc84ed5cc4e662a9d1da524929fa749552f9975 100644 --- a/tasks/0037_093_37093290_qa_1/task.toml +++ b/tasks/0037_093_37093290_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_139_37139079_qa_2/environment/bootstrap.sh b/tasks/0037_139_37139079_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_139_37139079_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_139_37139079_qa_2/environment/pull_bucket.py b/tasks/0037_139_37139079_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_139_37139079_qa_2/environment/pull_bucket.py +++ b/tasks/0037_139_37139079_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_139_37139079_qa_2/task.toml b/tasks/0037_139_37139079_qa_2/task.toml index 247967e1b2f7065ba821a8edb55ddf71f631184e..71e4cc0f0ea0ae8ea4eff4f683e6b6ffef13331f 100644 --- a/tasks/0037_139_37139079_qa_2/task.toml +++ b/tasks/0037_139_37139079_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_168_37168956_qa_5/environment/bootstrap.sh b/tasks/0037_168_37168956_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_168_37168956_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_168_37168956_qa_5/environment/pull_bucket.py b/tasks/0037_168_37168956_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_168_37168956_qa_5/environment/pull_bucket.py +++ b/tasks/0037_168_37168956_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_168_37168956_qa_5/task.toml b/tasks/0037_168_37168956_qa_5/task.toml index a99d08fa159db997bc0eedd01cd602eb8cbff6d3..0af700a2841644bd5ba5f03871774959644b2f39 100644 --- a/tasks/0037_168_37168956_qa_5/task.toml +++ b/tasks/0037_168_37168956_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_173_37173260_qa_1/environment/bootstrap.sh b/tasks/0037_173_37173260_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_173_37173260_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_173_37173260_qa_1/environment/pull_bucket.py b/tasks/0037_173_37173260_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_173_37173260_qa_1/environment/pull_bucket.py +++ b/tasks/0037_173_37173260_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_173_37173260_qa_1/task.toml b/tasks/0037_173_37173260_qa_1/task.toml index 32d77bc5da1916e239e42f0849914f7db72239df..840f58330392a34a75b02c82d185e4255e38a08e 100644 --- a/tasks/0037_173_37173260_qa_1/task.toml +++ b/tasks/0037_173_37173260_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_209_37209957_qa_5/environment/bootstrap.sh b/tasks/0037_209_37209957_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_209_37209957_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_209_37209957_qa_5/environment/pull_bucket.py b/tasks/0037_209_37209957_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_209_37209957_qa_5/environment/pull_bucket.py +++ b/tasks/0037_209_37209957_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_209_37209957_qa_5/task.toml b/tasks/0037_209_37209957_qa_5/task.toml index 95a8a5f3be70ba878f0063d5dca51c496a165886..777989616aa1c647e0b62548b779f9c7d5b0efc8 100644 --- a/tasks/0037_209_37209957_qa_5/task.toml +++ b/tasks/0037_209_37209957_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_236_37236169_qa_4/environment/bootstrap.sh b/tasks/0037_236_37236169_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_236_37236169_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_236_37236169_qa_4/environment/pull_bucket.py b/tasks/0037_236_37236169_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_236_37236169_qa_4/environment/pull_bucket.py +++ b/tasks/0037_236_37236169_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_236_37236169_qa_4/task.toml b/tasks/0037_236_37236169_qa_4/task.toml index f46f1ee1721643c05af67c63584e46d2baebb530..fedff40a567029e213c3ebbd5c79cf9b724d80ab 100644 --- a/tasks/0037_236_37236169_qa_4/task.toml +++ b/tasks/0037_236_37236169_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_280_37280696_qa_2/environment/bootstrap.sh b/tasks/0037_280_37280696_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_280_37280696_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_280_37280696_qa_2/environment/pull_bucket.py b/tasks/0037_280_37280696_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_280_37280696_qa_2/environment/pull_bucket.py +++ b/tasks/0037_280_37280696_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_280_37280696_qa_2/task.toml b/tasks/0037_280_37280696_qa_2/task.toml index 6a5257f5ebd3c90d0f792cb1000714a0065a99e8..c9884a00d8fccc6287845b97d1dd4530d8338e70 100644 --- a/tasks/0037_280_37280696_qa_2/task.toml +++ b/tasks/0037_280_37280696_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_280_37280696_qa_5/environment/bootstrap.sh b/tasks/0037_280_37280696_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_280_37280696_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_280_37280696_qa_5/environment/pull_bucket.py b/tasks/0037_280_37280696_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_280_37280696_qa_5/environment/pull_bucket.py +++ b/tasks/0037_280_37280696_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_280_37280696_qa_5/task.toml b/tasks/0037_280_37280696_qa_5/task.toml index 695b1b57be2dc6a7f77858263b9da17b8ed83e78..8037a8c5742e96741fa73195c78721602a3ac428 100644 --- a/tasks/0037_280_37280696_qa_5/task.toml +++ b/tasks/0037_280_37280696_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_292_37292636_qa_3/environment/bootstrap.sh b/tasks/0037_292_37292636_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_292_37292636_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_292_37292636_qa_3/environment/pull_bucket.py b/tasks/0037_292_37292636_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_292_37292636_qa_3/environment/pull_bucket.py +++ b/tasks/0037_292_37292636_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_292_37292636_qa_3/task.toml b/tasks/0037_292_37292636_qa_3/task.toml index 940809676a28a28e6852b4a08f595a7b7372bbfb..b0cb71ce119102e72758130339b63dc0b9e6ef0d 100644 --- a/tasks/0037_292_37292636_qa_3/task.toml +++ b/tasks/0037_292_37292636_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_308_37308262_qa_3/environment/bootstrap.sh b/tasks/0037_308_37308262_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_308_37308262_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_308_37308262_qa_3/environment/pull_bucket.py b/tasks/0037_308_37308262_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_308_37308262_qa_3/environment/pull_bucket.py +++ b/tasks/0037_308_37308262_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_308_37308262_qa_3/task.toml b/tasks/0037_308_37308262_qa_3/task.toml index e5bd72734380107cf03c6a6ff2dbeb7b9a2c55f1..96d63831f0c509bd809926ca618e6a5943a2193a 100644 --- a/tasks/0037_308_37308262_qa_3/task.toml +++ b/tasks/0037_308_37308262_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_308_37308262_qa_4/environment/bootstrap.sh b/tasks/0037_308_37308262_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_308_37308262_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_308_37308262_qa_4/environment/pull_bucket.py b/tasks/0037_308_37308262_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_308_37308262_qa_4/environment/pull_bucket.py +++ b/tasks/0037_308_37308262_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_308_37308262_qa_4/task.toml b/tasks/0037_308_37308262_qa_4/task.toml index dee84b38d9c1d28efd55feeffa8d9dbd6add6a1d..e4d0b1bc93c39b6615711c2c667f5a54d3b50ddc 100644 --- a/tasks/0037_308_37308262_qa_4/task.toml +++ b/tasks/0037_308_37308262_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_513_37513711_qa_2/environment/bootstrap.sh b/tasks/0037_513_37513711_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_513_37513711_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_513_37513711_qa_2/environment/pull_bucket.py b/tasks/0037_513_37513711_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_513_37513711_qa_2/environment/pull_bucket.py +++ b/tasks/0037_513_37513711_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_513_37513711_qa_2/task.toml b/tasks/0037_513_37513711_qa_2/task.toml index ed097a16620e3faaf5b9dcf41e0e285fefd4572a..6de0ee47fbd290a1fffd6bb0ad79035702c05e2e 100644 --- a/tasks/0037_513_37513711_qa_2/task.toml +++ b/tasks/0037_513_37513711_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_551_37551034_qa_1/environment/bootstrap.sh b/tasks/0037_551_37551034_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_551_37551034_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_551_37551034_qa_1/environment/pull_bucket.py b/tasks/0037_551_37551034_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_551_37551034_qa_1/environment/pull_bucket.py +++ b/tasks/0037_551_37551034_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_551_37551034_qa_1/task.toml b/tasks/0037_551_37551034_qa_1/task.toml index 9643a51880dc5b49ac06e86aab5759a08e7bdc5c..99ffdda8e947f7c021e937eebfee8ad67a9948be 100644 --- a/tasks/0037_551_37551034_qa_1/task.toml +++ b/tasks/0037_551_37551034_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_554_37554731_qa_1/environment/bootstrap.sh b/tasks/0037_554_37554731_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_554_37554731_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_554_37554731_qa_1/environment/pull_bucket.py b/tasks/0037_554_37554731_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_554_37554731_qa_1/environment/pull_bucket.py +++ b/tasks/0037_554_37554731_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_554_37554731_qa_1/task.toml b/tasks/0037_554_37554731_qa_1/task.toml index 825a3b07fdf09043e88c00e37d93d7a86530caa3..8a595befe134b3674151876c62d4fb2e4566b1a2 100644 --- a/tasks/0037_554_37554731_qa_1/task.toml +++ b/tasks/0037_554_37554731_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_594_37594747_qa_1/environment/bootstrap.sh b/tasks/0037_594_37594747_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_594_37594747_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_594_37594747_qa_1/environment/pull_bucket.py b/tasks/0037_594_37594747_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_594_37594747_qa_1/environment/pull_bucket.py +++ b/tasks/0037_594_37594747_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_594_37594747_qa_1/task.toml b/tasks/0037_594_37594747_qa_1/task.toml index b5a4537f1e43e9a8619a424c1af41d2c15baf43d..721405a3f651d397c852ba31a76742cb9d76eb65 100644 --- a/tasks/0037_594_37594747_qa_1/task.toml +++ b/tasks/0037_594_37594747_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_631_37631084_qa_2/environment/bootstrap.sh b/tasks/0037_631_37631084_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_631_37631084_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_631_37631084_qa_2/environment/pull_bucket.py b/tasks/0037_631_37631084_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_631_37631084_qa_2/environment/pull_bucket.py +++ b/tasks/0037_631_37631084_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_631_37631084_qa_2/task.toml b/tasks/0037_631_37631084_qa_2/task.toml index 3ed9d4598f532400709c98c159ac6e7ac810ddfe..08d2332bfa4bf87dc9fc8c0c23c73eb6d53174fb 100644 --- a/tasks/0037_631_37631084_qa_2/task.toml +++ b/tasks/0037_631_37631084_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_631_37631084_qa_3/environment/bootstrap.sh b/tasks/0037_631_37631084_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_631_37631084_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_631_37631084_qa_3/environment/pull_bucket.py b/tasks/0037_631_37631084_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_631_37631084_qa_3/environment/pull_bucket.py +++ b/tasks/0037_631_37631084_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_631_37631084_qa_3/task.toml b/tasks/0037_631_37631084_qa_3/task.toml index 37c74a33b5dd7404ff9f544741306731b5c8aaf7..63a15bf33a3c6b74da3fa2922800f1cc3e26b48f 100644 --- a/tasks/0037_631_37631084_qa_3/task.toml +++ b/tasks/0037_631_37631084_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_718_37718370_qa_1/environment/bootstrap.sh b/tasks/0037_718_37718370_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_718_37718370_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_718_37718370_qa_1/environment/pull_bucket.py b/tasks/0037_718_37718370_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_718_37718370_qa_1/environment/pull_bucket.py +++ b/tasks/0037_718_37718370_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_718_37718370_qa_1/task.toml b/tasks/0037_718_37718370_qa_1/task.toml index de292bedb07e5f81ca062f3f67db739c1d0b6853..087d5628767c6629ac0715b5c95240b7e2362aab 100644 --- a/tasks/0037_718_37718370_qa_1/task.toml +++ b/tasks/0037_718_37718370_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_718_37718370_qa_2/environment/bootstrap.sh b/tasks/0037_718_37718370_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_718_37718370_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_718_37718370_qa_2/environment/pull_bucket.py b/tasks/0037_718_37718370_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_718_37718370_qa_2/environment/pull_bucket.py +++ b/tasks/0037_718_37718370_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_718_37718370_qa_2/task.toml b/tasks/0037_718_37718370_qa_2/task.toml index 417d6a4fa474d07a046711851649171a61295753..7cebc37c8fd522ceafcf42ca5212631a3c1c5cf3 100644 --- a/tasks/0037_718_37718370_qa_2/task.toml +++ b/tasks/0037_718_37718370_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_718_37718370_qa_3/environment/bootstrap.sh b/tasks/0037_718_37718370_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_718_37718370_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_718_37718370_qa_3/environment/pull_bucket.py b/tasks/0037_718_37718370_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_718_37718370_qa_3/environment/pull_bucket.py +++ b/tasks/0037_718_37718370_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_718_37718370_qa_3/task.toml b/tasks/0037_718_37718370_qa_3/task.toml index 2d276529f35f5e31aa89139096ee0c3b375a9560..b24c79e585ad1f26ea451bbdaecf028f4d8bf26c 100644 --- a/tasks/0037_718_37718370_qa_3/task.toml +++ b/tasks/0037_718_37718370_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_725_37725403_qa_5/environment/bootstrap.sh b/tasks/0037_725_37725403_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_725_37725403_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_725_37725403_qa_5/environment/pull_bucket.py b/tasks/0037_725_37725403_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_725_37725403_qa_5/environment/pull_bucket.py +++ b/tasks/0037_725_37725403_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_725_37725403_qa_5/task.toml b/tasks/0037_725_37725403_qa_5/task.toml index 7e9103064734014ebbd733fad75e828c14268cbd..d306bd35b093e5d0ef2e8291439c3fca584a62ec 100644 --- a/tasks/0037_725_37725403_qa_5/task.toml +++ b/tasks/0037_725_37725403_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_728_37728227_qa_2/environment/bootstrap.sh b/tasks/0037_728_37728227_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_728_37728227_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_728_37728227_qa_2/environment/pull_bucket.py b/tasks/0037_728_37728227_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_728_37728227_qa_2/environment/pull_bucket.py +++ b/tasks/0037_728_37728227_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_728_37728227_qa_2/task.toml b/tasks/0037_728_37728227_qa_2/task.toml index 8059959debe4b3865324b942d1c455c5a5c4be9e..366f996f4dcd0f14d9f72eaf137a7f5e08871d15 100644 --- a/tasks/0037_728_37728227_qa_2/task.toml +++ b/tasks/0037_728_37728227_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_799_37799845_qa_4/environment/bootstrap.sh b/tasks/0037_799_37799845_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_799_37799845_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_799_37799845_qa_4/environment/pull_bucket.py b/tasks/0037_799_37799845_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_799_37799845_qa_4/environment/pull_bucket.py +++ b/tasks/0037_799_37799845_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_799_37799845_qa_4/task.toml b/tasks/0037_799_37799845_qa_4/task.toml index ce7563fb55d92ffaada2b7e053916d32b1ca9859..c3c73fbc222e235dd50b1da7b37b5b99f3003bc9 100644 --- a/tasks/0037_799_37799845_qa_4/task.toml +++ b/tasks/0037_799_37799845_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_799_37799845_qa_5/environment/bootstrap.sh b/tasks/0037_799_37799845_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_799_37799845_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_799_37799845_qa_5/environment/pull_bucket.py b/tasks/0037_799_37799845_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_799_37799845_qa_5/environment/pull_bucket.py +++ b/tasks/0037_799_37799845_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_799_37799845_qa_5/task.toml b/tasks/0037_799_37799845_qa_5/task.toml index 7717c726ff537375142508e63ad1b3b0acaef055..7fa6f80b10c9c213746c21d97dde5123bb9bba90 100644 --- a/tasks/0037_799_37799845_qa_5/task.toml +++ b/tasks/0037_799_37799845_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_859_37859442_qa_1/environment/bootstrap.sh b/tasks/0037_859_37859442_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_859_37859442_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_859_37859442_qa_1/environment/pull_bucket.py b/tasks/0037_859_37859442_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_859_37859442_qa_1/environment/pull_bucket.py +++ b/tasks/0037_859_37859442_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_859_37859442_qa_1/task.toml b/tasks/0037_859_37859442_qa_1/task.toml index b26c8debf0f46ca6b61c6e5fe0fd6e71ead3cfcd..411c7603f77f3d583d9d52be6cc1f6678c9b9331 100644 --- a/tasks/0037_859_37859442_qa_1/task.toml +++ b/tasks/0037_859_37859442_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_895_37895109_qa_2/environment/bootstrap.sh b/tasks/0037_895_37895109_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_895_37895109_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_895_37895109_qa_2/environment/pull_bucket.py b/tasks/0037_895_37895109_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_895_37895109_qa_2/environment/pull_bucket.py +++ b/tasks/0037_895_37895109_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_895_37895109_qa_2/task.toml b/tasks/0037_895_37895109_qa_2/task.toml index cd4f888cdd02b503226382e2e930a4203e1d740b..c2e079fdbb03c6ab0b7a8e9adeed87e0928ddcc1 100644 --- a/tasks/0037_895_37895109_qa_2/task.toml +++ b/tasks/0037_895_37895109_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_918_37918087_qa_1/environment/bootstrap.sh b/tasks/0037_918_37918087_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_918_37918087_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_918_37918087_qa_1/environment/pull_bucket.py b/tasks/0037_918_37918087_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_918_37918087_qa_1/environment/pull_bucket.py +++ b/tasks/0037_918_37918087_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_918_37918087_qa_1/task.toml b/tasks/0037_918_37918087_qa_1/task.toml index 3754669f8e64643c247bec71927fe54afc3fee0f..169152a8b40bdde8c4e94f360a9eb351b590ce8a 100644 --- a/tasks/0037_918_37918087_qa_1/task.toml +++ b/tasks/0037_918_37918087_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_918_37918087_qa_4/environment/bootstrap.sh b/tasks/0037_918_37918087_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_918_37918087_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_918_37918087_qa_4/environment/pull_bucket.py b/tasks/0037_918_37918087_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_918_37918087_qa_4/environment/pull_bucket.py +++ b/tasks/0037_918_37918087_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_918_37918087_qa_4/task.toml b/tasks/0037_918_37918087_qa_4/task.toml index b476e04ad9f12f7dc8038539fb8cbe70139fac2c..bd89dfb89e8b08e9bdfe7386752f0a4f28a3ddec 100644 --- a/tasks/0037_918_37918087_qa_4/task.toml +++ b/tasks/0037_918_37918087_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_933_37933355_qa_2/environment/bootstrap.sh b/tasks/0037_933_37933355_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_933_37933355_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_933_37933355_qa_2/environment/pull_bucket.py b/tasks/0037_933_37933355_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_933_37933355_qa_2/environment/pull_bucket.py +++ b/tasks/0037_933_37933355_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_933_37933355_qa_2/task.toml b/tasks/0037_933_37933355_qa_2/task.toml index 1889abb09c92dfc9bb2a56eac4a1161d56e8249a..c8dd9da6c7e60e3c9e2f39b4c7329d22ccf9eebf 100644 --- a/tasks/0037_933_37933355_qa_2/task.toml +++ b/tasks/0037_933_37933355_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0037_995_37995698_qa_1/environment/bootstrap.sh b/tasks/0037_995_37995698_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0037_995_37995698_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0037_995_37995698_qa_1/environment/pull_bucket.py b/tasks/0037_995_37995698_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0037_995_37995698_qa_1/environment/pull_bucket.py +++ b/tasks/0037_995_37995698_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0037_995_37995698_qa_1/task.toml b/tasks/0037_995_37995698_qa_1/task.toml index 133cd251ff56993f2f8bb9b39bfd914c38a3b7fd..8dbb0b1e7f69b127e795f220d4d4736fd2879bf8 100644 --- a/tasks/0037_995_37995698_qa_1/task.toml +++ b/tasks/0037_995_37995698_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_031_38031736_qa_4/environment/bootstrap.sh b/tasks/0038_031_38031736_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_031_38031736_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_031_38031736_qa_4/environment/pull_bucket.py b/tasks/0038_031_38031736_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_031_38031736_qa_4/environment/pull_bucket.py +++ b/tasks/0038_031_38031736_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_031_38031736_qa_4/task.toml b/tasks/0038_031_38031736_qa_4/task.toml index 374cc57eec50848a852cef038b2c547deafbf004..e649cbeb69a600779c02294d0fa476c3e6d76e56 100644 --- a/tasks/0038_031_38031736_qa_4/task.toml +++ b/tasks/0038_031_38031736_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_159_38159473_qa_2/environment/bootstrap.sh b/tasks/0038_159_38159473_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_159_38159473_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_159_38159473_qa_2/environment/pull_bucket.py b/tasks/0038_159_38159473_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_159_38159473_qa_2/environment/pull_bucket.py +++ b/tasks/0038_159_38159473_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_159_38159473_qa_2/task.toml b/tasks/0038_159_38159473_qa_2/task.toml index 1b7e729f672f32e8c62921677d4a792cf20742b6..18324957893303b15692875c4ee01ae22871cd14 100644 --- a/tasks/0038_159_38159473_qa_2/task.toml +++ b/tasks/0038_159_38159473_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_159_38159473_qa_4/environment/bootstrap.sh b/tasks/0038_159_38159473_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_159_38159473_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_159_38159473_qa_4/environment/pull_bucket.py b/tasks/0038_159_38159473_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_159_38159473_qa_4/environment/pull_bucket.py +++ b/tasks/0038_159_38159473_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_159_38159473_qa_4/task.toml b/tasks/0038_159_38159473_qa_4/task.toml index 34fc327aef8304ba4f5899653785b5a61af002d2..f453e175303d8c389d5a126f52d55d561109f080 100644 --- a/tasks/0038_159_38159473_qa_4/task.toml +++ b/tasks/0038_159_38159473_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_165_38165504_qa_3/environment/bootstrap.sh b/tasks/0038_165_38165504_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_165_38165504_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_165_38165504_qa_3/environment/pull_bucket.py b/tasks/0038_165_38165504_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_165_38165504_qa_3/environment/pull_bucket.py +++ b/tasks/0038_165_38165504_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_165_38165504_qa_3/task.toml b/tasks/0038_165_38165504_qa_3/task.toml index 1e35d28736ebc69f065daf3cb238addd8424deeb..1bbb551b46cb55dbeebb3f132957c332116c9030 100644 --- a/tasks/0038_165_38165504_qa_3/task.toml +++ b/tasks/0038_165_38165504_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_178_38178392_qa_1/environment/bootstrap.sh b/tasks/0038_178_38178392_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_178_38178392_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_178_38178392_qa_1/environment/pull_bucket.py b/tasks/0038_178_38178392_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_178_38178392_qa_1/environment/pull_bucket.py +++ b/tasks/0038_178_38178392_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_178_38178392_qa_1/task.toml b/tasks/0038_178_38178392_qa_1/task.toml index 8a9cf80b4017f05d9ba342ddb75984d544fc5eb5..0526622a718b6aa02319af4668f4a3ccf466f2bb 100644 --- a/tasks/0038_178_38178392_qa_1/task.toml +++ b/tasks/0038_178_38178392_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_189_38189340_qa_1/environment/bootstrap.sh b/tasks/0038_189_38189340_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_189_38189340_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_189_38189340_qa_1/environment/pull_bucket.py b/tasks/0038_189_38189340_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_189_38189340_qa_1/environment/pull_bucket.py +++ b/tasks/0038_189_38189340_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_189_38189340_qa_1/task.toml b/tasks/0038_189_38189340_qa_1/task.toml index 7664404ed58bd616a32433008d5f6aa0a3b9ec53..4f94df25a140506c12daf70eaa2e8d66e98e6801 100644 --- a/tasks/0038_189_38189340_qa_1/task.toml +++ b/tasks/0038_189_38189340_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_189_38189340_qa_2/environment/bootstrap.sh b/tasks/0038_189_38189340_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_189_38189340_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_189_38189340_qa_2/environment/pull_bucket.py b/tasks/0038_189_38189340_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_189_38189340_qa_2/environment/pull_bucket.py +++ b/tasks/0038_189_38189340_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_189_38189340_qa_2/task.toml b/tasks/0038_189_38189340_qa_2/task.toml index 8964f52844faf985d3e4f97247d51c2d909a8a5a..18d0d8f01aee5c4b343ffee4f50653a8c8cb5bb7 100644 --- a/tasks/0038_189_38189340_qa_2/task.toml +++ b/tasks/0038_189_38189340_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_194_38194359_qa_1/environment/bootstrap.sh b/tasks/0038_194_38194359_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_194_38194359_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_194_38194359_qa_1/environment/pull_bucket.py b/tasks/0038_194_38194359_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_194_38194359_qa_1/environment/pull_bucket.py +++ b/tasks/0038_194_38194359_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_194_38194359_qa_1/task.toml b/tasks/0038_194_38194359_qa_1/task.toml index 20299f31a870b7742df8cb73d191982ded550341..1f383dbe3aedd86cd85889fa00e6ddd6ad815e12 100644 --- a/tasks/0038_194_38194359_qa_1/task.toml +++ b/tasks/0038_194_38194359_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_225_38225070_qa_5/environment/bootstrap.sh b/tasks/0038_225_38225070_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_225_38225070_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_225_38225070_qa_5/environment/pull_bucket.py b/tasks/0038_225_38225070_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_225_38225070_qa_5/environment/pull_bucket.py +++ b/tasks/0038_225_38225070_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_225_38225070_qa_5/task.toml b/tasks/0038_225_38225070_qa_5/task.toml index 2fac515bb3b5eec4f0b07f13d2b82fe3de06d378..8989ed976189e71e69e218c7bb678734184ac84e 100644 --- a/tasks/0038_225_38225070_qa_5/task.toml +++ b/tasks/0038_225_38225070_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_280_38280511_qa_5/environment/bootstrap.sh b/tasks/0038_280_38280511_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_280_38280511_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_280_38280511_qa_5/environment/pull_bucket.py b/tasks/0038_280_38280511_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_280_38280511_qa_5/environment/pull_bucket.py +++ b/tasks/0038_280_38280511_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_280_38280511_qa_5/task.toml b/tasks/0038_280_38280511_qa_5/task.toml index fe0c31f3680827c4a3272b3529d20be5859547f9..0cd437a027d37576d6ee06d986a2f37e77af3ebd 100644 --- a/tasks/0038_280_38280511_qa_5/task.toml +++ b/tasks/0038_280_38280511_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_316_38316301_qa_1/environment/bootstrap.sh b/tasks/0038_316_38316301_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_316_38316301_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_316_38316301_qa_1/environment/pull_bucket.py b/tasks/0038_316_38316301_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_316_38316301_qa_1/environment/pull_bucket.py +++ b/tasks/0038_316_38316301_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_316_38316301_qa_1/task.toml b/tasks/0038_316_38316301_qa_1/task.toml index eb66400ef5b44263b1d16eb77757ca8139bd5a27..398725e4518275cf7d2d38d3c7caace03dc63491 100644 --- a/tasks/0038_316_38316301_qa_1/task.toml +++ b/tasks/0038_316_38316301_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_322_38322925_qa_1/environment/bootstrap.sh b/tasks/0038_322_38322925_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_322_38322925_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_322_38322925_qa_1/environment/pull_bucket.py b/tasks/0038_322_38322925_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_322_38322925_qa_1/environment/pull_bucket.py +++ b/tasks/0038_322_38322925_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_322_38322925_qa_1/task.toml b/tasks/0038_322_38322925_qa_1/task.toml index e85e13ee971a75258a267626a3fd421191b44111..d71e84c88f407d045a2c7ef277d66bd37f8580d4 100644 --- a/tasks/0038_322_38322925_qa_1/task.toml +++ b/tasks/0038_322_38322925_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_322_38322925_qa_2/environment/bootstrap.sh b/tasks/0038_322_38322925_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_322_38322925_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_322_38322925_qa_2/environment/pull_bucket.py b/tasks/0038_322_38322925_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_322_38322925_qa_2/environment/pull_bucket.py +++ b/tasks/0038_322_38322925_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_322_38322925_qa_2/task.toml b/tasks/0038_322_38322925_qa_2/task.toml index f8e6bc86cb595ca667f5e5d531b16d165b51e019..5f5bd0de63bd6a2d125ca571fc11d24f0e43df32 100644 --- a/tasks/0038_322_38322925_qa_2/task.toml +++ b/tasks/0038_322_38322925_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_325_38325022_qa_3/environment/bootstrap.sh b/tasks/0038_325_38325022_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_325_38325022_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_325_38325022_qa_3/environment/pull_bucket.py b/tasks/0038_325_38325022_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_325_38325022_qa_3/environment/pull_bucket.py +++ b/tasks/0038_325_38325022_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_325_38325022_qa_3/task.toml b/tasks/0038_325_38325022_qa_3/task.toml index a607b965618f51301352dc3e9f27b63f6bebc1d5..ac4746c487e813957e64d0df80cc79a887c187ba 100644 --- a/tasks/0038_325_38325022_qa_3/task.toml +++ b/tasks/0038_325_38325022_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_408_38408993_qa_2/environment/bootstrap.sh b/tasks/0038_408_38408993_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_408_38408993_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_408_38408993_qa_2/environment/pull_bucket.py b/tasks/0038_408_38408993_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_408_38408993_qa_2/environment/pull_bucket.py +++ b/tasks/0038_408_38408993_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_408_38408993_qa_2/task.toml b/tasks/0038_408_38408993_qa_2/task.toml index bcfef924035703f6603c61dcb119d3e173ca983e..f41d6f76894d82a071bf486e028d228f3371df41 100644 --- a/tasks/0038_408_38408993_qa_2/task.toml +++ b/tasks/0038_408_38408993_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_412_38412209_qa_2/environment/bootstrap.sh b/tasks/0038_412_38412209_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_412_38412209_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_412_38412209_qa_2/environment/pull_bucket.py b/tasks/0038_412_38412209_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_412_38412209_qa_2/environment/pull_bucket.py +++ b/tasks/0038_412_38412209_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_412_38412209_qa_2/task.toml b/tasks/0038_412_38412209_qa_2/task.toml index 1c93a735d7dffd18b000289b87323c32327e37ea..5d5438822c102a2c5bb78fced358eed343e967aa 100644 --- a/tasks/0038_412_38412209_qa_2/task.toml +++ b/tasks/0038_412_38412209_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_412_38412209_qa_3/environment/bootstrap.sh b/tasks/0038_412_38412209_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_412_38412209_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_412_38412209_qa_3/environment/pull_bucket.py b/tasks/0038_412_38412209_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_412_38412209_qa_3/environment/pull_bucket.py +++ b/tasks/0038_412_38412209_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_412_38412209_qa_3/task.toml b/tasks/0038_412_38412209_qa_3/task.toml index 0cdcc37ee295719b7f7a6d492e5e0721ba40e6b4..67ab924ce8152eceec5c5809dec00af7d0c35a44 100644 --- a/tasks/0038_412_38412209_qa_3/task.toml +++ b/tasks/0038_412_38412209_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_412_38412209_qa_5/environment/bootstrap.sh b/tasks/0038_412_38412209_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_412_38412209_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_412_38412209_qa_5/environment/pull_bucket.py b/tasks/0038_412_38412209_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_412_38412209_qa_5/environment/pull_bucket.py +++ b/tasks/0038_412_38412209_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_412_38412209_qa_5/task.toml b/tasks/0038_412_38412209_qa_5/task.toml index 09f2c71f47231f58268cd090ce0d1b8d2d036e28..75d122dfdcc4a5c3e8bfaed5337498ab1e1601aa 100644 --- a/tasks/0038_412_38412209_qa_5/task.toml +++ b/tasks/0038_412_38412209_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_417_38417457_qa_1/environment/bootstrap.sh b/tasks/0038_417_38417457_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_417_38417457_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_417_38417457_qa_1/environment/pull_bucket.py b/tasks/0038_417_38417457_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_417_38417457_qa_1/environment/pull_bucket.py +++ b/tasks/0038_417_38417457_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_417_38417457_qa_1/task.toml b/tasks/0038_417_38417457_qa_1/task.toml index 48ca34b87e461b21fca7eb677754bdb327db63d1..797278ec60033eabfb9ecb825fb34062c87ac8cf 100644 --- a/tasks/0038_417_38417457_qa_1/task.toml +++ b/tasks/0038_417_38417457_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_439_38439618_qa_2/environment/bootstrap.sh b/tasks/0038_439_38439618_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_439_38439618_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_439_38439618_qa_2/environment/pull_bucket.py b/tasks/0038_439_38439618_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_439_38439618_qa_2/environment/pull_bucket.py +++ b/tasks/0038_439_38439618_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_439_38439618_qa_2/task.toml b/tasks/0038_439_38439618_qa_2/task.toml index 24007b9ec7e441a2f7648ca5d4d0da6cc1f5369e..bb7d0bb7534e88521de3e0c6595822934b158638 100644 --- a/tasks/0038_439_38439618_qa_2/task.toml +++ b/tasks/0038_439_38439618_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_439_38439618_qa_5/environment/bootstrap.sh b/tasks/0038_439_38439618_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_439_38439618_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_439_38439618_qa_5/environment/pull_bucket.py b/tasks/0038_439_38439618_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_439_38439618_qa_5/environment/pull_bucket.py +++ b/tasks/0038_439_38439618_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_439_38439618_qa_5/task.toml b/tasks/0038_439_38439618_qa_5/task.toml index 995359a47d8c12e101f8a61f031c0d04052fbe19..7a47de72e97a9f45aae18f08dc2cc1e0db4e8543 100644 --- a/tasks/0038_439_38439618_qa_5/task.toml +++ b/tasks/0038_439_38439618_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_466_38466860_qa_2/environment/bootstrap.sh b/tasks/0038_466_38466860_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_466_38466860_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_466_38466860_qa_2/environment/pull_bucket.py b/tasks/0038_466_38466860_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_466_38466860_qa_2/environment/pull_bucket.py +++ b/tasks/0038_466_38466860_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_466_38466860_qa_2/task.toml b/tasks/0038_466_38466860_qa_2/task.toml index d7382ccb6881a9d62f6ebe4821384b50b67a5a3f..622d327c3a064e8dd8619b43906b580099b0551b 100644 --- a/tasks/0038_466_38466860_qa_2/task.toml +++ b/tasks/0038_466_38466860_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_484_38484065_qa_2/environment/bootstrap.sh b/tasks/0038_484_38484065_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_484_38484065_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_484_38484065_qa_2/environment/pull_bucket.py b/tasks/0038_484_38484065_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_484_38484065_qa_2/environment/pull_bucket.py +++ b/tasks/0038_484_38484065_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_484_38484065_qa_2/task.toml b/tasks/0038_484_38484065_qa_2/task.toml index f4d42f7bdf376da7afe4723d5ec36caaf1617984..3fb028cd167a8318d1710210d2182a23eda033ca 100644 --- a/tasks/0038_484_38484065_qa_2/task.toml +++ b/tasks/0038_484_38484065_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_509_38509914_qa_4/environment/bootstrap.sh b/tasks/0038_509_38509914_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_509_38509914_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_509_38509914_qa_4/environment/pull_bucket.py b/tasks/0038_509_38509914_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_509_38509914_qa_4/environment/pull_bucket.py +++ b/tasks/0038_509_38509914_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_509_38509914_qa_4/task.toml b/tasks/0038_509_38509914_qa_4/task.toml index af55bd144e614a34a5eed905d459bc2fcd4b9b53..df1dbba023267b14d13287e6d06b936a60f64dd2 100644 --- a/tasks/0038_509_38509914_qa_4/task.toml +++ b/tasks/0038_509_38509914_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_547_38547552_qa_1/environment/bootstrap.sh b/tasks/0038_547_38547552_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_547_38547552_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_547_38547552_qa_1/environment/pull_bucket.py b/tasks/0038_547_38547552_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_547_38547552_qa_1/environment/pull_bucket.py +++ b/tasks/0038_547_38547552_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_547_38547552_qa_1/task.toml b/tasks/0038_547_38547552_qa_1/task.toml index ee1a755271176f0e76d880c2f2e620349f392920..bb7889e8afb063f40e55bf60a85f013f219eb9c8 100644 --- a/tasks/0038_547_38547552_qa_1/task.toml +++ b/tasks/0038_547_38547552_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_547_38547552_qa_3/environment/bootstrap.sh b/tasks/0038_547_38547552_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_547_38547552_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_547_38547552_qa_3/environment/pull_bucket.py b/tasks/0038_547_38547552_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_547_38547552_qa_3/environment/pull_bucket.py +++ b/tasks/0038_547_38547552_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_547_38547552_qa_3/task.toml b/tasks/0038_547_38547552_qa_3/task.toml index 00083e3874b0e0ba7548ca4f717a8148fde34a6b..e804987f0fd5b909ef8b04a0b1822fb4a6c23d85 100644 --- a/tasks/0038_547_38547552_qa_3/task.toml +++ b/tasks/0038_547_38547552_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_547_38547552_qa_4/environment/bootstrap.sh b/tasks/0038_547_38547552_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_547_38547552_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_547_38547552_qa_4/environment/pull_bucket.py b/tasks/0038_547_38547552_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_547_38547552_qa_4/environment/pull_bucket.py +++ b/tasks/0038_547_38547552_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_547_38547552_qa_4/task.toml b/tasks/0038_547_38547552_qa_4/task.toml index 59d5053b247015160ac0fb17eda6552910980627..51beb759378bb9e175d7310b6206fe294dd92762 100644 --- a/tasks/0038_547_38547552_qa_4/task.toml +++ b/tasks/0038_547_38547552_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_553_38553601_qa_2/environment/bootstrap.sh b/tasks/0038_553_38553601_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_553_38553601_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_553_38553601_qa_2/environment/pull_bucket.py b/tasks/0038_553_38553601_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_553_38553601_qa_2/environment/pull_bucket.py +++ b/tasks/0038_553_38553601_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_553_38553601_qa_2/task.toml b/tasks/0038_553_38553601_qa_2/task.toml index 6509046a92398b12f409773c89dfa295272204ae..99da9416f51285919528fa4eccfe5116ee1aa999 100644 --- a/tasks/0038_553_38553601_qa_2/task.toml +++ b/tasks/0038_553_38553601_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_553_38553601_qa_3/environment/bootstrap.sh b/tasks/0038_553_38553601_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_553_38553601_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_553_38553601_qa_3/environment/pull_bucket.py b/tasks/0038_553_38553601_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_553_38553601_qa_3/environment/pull_bucket.py +++ b/tasks/0038_553_38553601_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_553_38553601_qa_3/task.toml b/tasks/0038_553_38553601_qa_3/task.toml index efecac1b1d2f256f24f136964de928477e1f4a5a..c148c59f1c975522913bb11ae7f511e5fb3476be 100644 --- a/tasks/0038_553_38553601_qa_3/task.toml +++ b/tasks/0038_553_38553601_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_570_38570610_qa_3/environment/bootstrap.sh b/tasks/0038_570_38570610_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_570_38570610_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_570_38570610_qa_3/environment/pull_bucket.py b/tasks/0038_570_38570610_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_570_38570610_qa_3/environment/pull_bucket.py +++ b/tasks/0038_570_38570610_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_570_38570610_qa_3/task.toml b/tasks/0038_570_38570610_qa_3/task.toml index e53541c797000b1abbcb9cffa0dc452935f1b982..eded82a2d1bae948b784fe2d2d2f5c7301960efe 100644 --- a/tasks/0038_570_38570610_qa_3/task.toml +++ b/tasks/0038_570_38570610_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_606_38606903_qa_2/environment/bootstrap.sh b/tasks/0038_606_38606903_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_606_38606903_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_606_38606903_qa_2/environment/pull_bucket.py b/tasks/0038_606_38606903_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_606_38606903_qa_2/environment/pull_bucket.py +++ b/tasks/0038_606_38606903_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_606_38606903_qa_2/task.toml b/tasks/0038_606_38606903_qa_2/task.toml index e9637016d02c713e1427eb0e35164598ee23b2a1..52dcbf4e5127b5f8fd54708cfa3555510144d043 100644 --- a/tasks/0038_606_38606903_qa_2/task.toml +++ b/tasks/0038_606_38606903_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_606_38606903_qa_3/environment/bootstrap.sh b/tasks/0038_606_38606903_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_606_38606903_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_606_38606903_qa_3/environment/pull_bucket.py b/tasks/0038_606_38606903_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_606_38606903_qa_3/environment/pull_bucket.py +++ b/tasks/0038_606_38606903_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_606_38606903_qa_3/task.toml b/tasks/0038_606_38606903_qa_3/task.toml index 408226ab19800d308d837a3eeb7f45e26afba138..3eb31294b40395240b194e527527e290b4951799 100644 --- a/tasks/0038_606_38606903_qa_3/task.toml +++ b/tasks/0038_606_38606903_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_672_38672361_qa_1/environment/bootstrap.sh b/tasks/0038_672_38672361_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_672_38672361_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_672_38672361_qa_1/environment/pull_bucket.py b/tasks/0038_672_38672361_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_672_38672361_qa_1/environment/pull_bucket.py +++ b/tasks/0038_672_38672361_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_672_38672361_qa_1/task.toml b/tasks/0038_672_38672361_qa_1/task.toml index 5c649de3541b3afb5e372d7b9ec4440d1e76b2ef..add3d548f6bd121dd3ed5b7ac916bd68242d0dda 100644 --- a/tasks/0038_672_38672361_qa_1/task.toml +++ b/tasks/0038_672_38672361_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_672_38672361_qa_3/environment/bootstrap.sh b/tasks/0038_672_38672361_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_672_38672361_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_672_38672361_qa_3/environment/pull_bucket.py b/tasks/0038_672_38672361_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_672_38672361_qa_3/environment/pull_bucket.py +++ b/tasks/0038_672_38672361_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_672_38672361_qa_3/task.toml b/tasks/0038_672_38672361_qa_3/task.toml index 0d90c57dd862e363c4132a566acd5ee02e1565e3..37860f5f56b4c55bf8810890477adad82c57730c 100644 --- a/tasks/0038_672_38672361_qa_3/task.toml +++ b/tasks/0038_672_38672361_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_672_38672361_qa_4/environment/bootstrap.sh b/tasks/0038_672_38672361_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_672_38672361_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_672_38672361_qa_4/environment/pull_bucket.py b/tasks/0038_672_38672361_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_672_38672361_qa_4/environment/pull_bucket.py +++ b/tasks/0038_672_38672361_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_672_38672361_qa_4/task.toml b/tasks/0038_672_38672361_qa_4/task.toml index f674c4c9baebe23d453f34d9b12f1d6c6db5bf2a..e1d20d09290d454d8d261934e64c2f68e9579a17 100644 --- a/tasks/0038_672_38672361_qa_4/task.toml +++ b/tasks/0038_672_38672361_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_673_38673777_qa_1/environment/bootstrap.sh b/tasks/0038_673_38673777_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_673_38673777_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_673_38673777_qa_1/environment/pull_bucket.py b/tasks/0038_673_38673777_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_673_38673777_qa_1/environment/pull_bucket.py +++ b/tasks/0038_673_38673777_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_673_38673777_qa_1/task.toml b/tasks/0038_673_38673777_qa_1/task.toml index 360604d4851e537fc3801f4e033776cce6a92409..36d00b01d0d5d865996b3854dd094d77835df75f 100644 --- a/tasks/0038_673_38673777_qa_1/task.toml +++ b/tasks/0038_673_38673777_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_681_38681339_qa_3/environment/bootstrap.sh b/tasks/0038_681_38681339_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_681_38681339_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_681_38681339_qa_3/environment/pull_bucket.py b/tasks/0038_681_38681339_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_681_38681339_qa_3/environment/pull_bucket.py +++ b/tasks/0038_681_38681339_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_681_38681339_qa_3/task.toml b/tasks/0038_681_38681339_qa_3/task.toml index d4001b1bc5312c89c95b4a0e4a874c66e02f8ef6..5f55c24c4d812c8a6bb9a40a710dc36455af2357 100644 --- a/tasks/0038_681_38681339_qa_3/task.toml +++ b/tasks/0038_681_38681339_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_688_38688219_qa_1/environment/bootstrap.sh b/tasks/0038_688_38688219_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_688_38688219_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_688_38688219_qa_1/environment/pull_bucket.py b/tasks/0038_688_38688219_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_688_38688219_qa_1/environment/pull_bucket.py +++ b/tasks/0038_688_38688219_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_688_38688219_qa_1/task.toml b/tasks/0038_688_38688219_qa_1/task.toml index 2225a84465358e664e9c56f18b15eee5932cd588..81a122a64586a5c1903c30d05a18a44b5f4f54c8 100644 --- a/tasks/0038_688_38688219_qa_1/task.toml +++ b/tasks/0038_688_38688219_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_692_38692630_qa_4/environment/bootstrap.sh b/tasks/0038_692_38692630_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_692_38692630_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_692_38692630_qa_4/environment/pull_bucket.py b/tasks/0038_692_38692630_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_692_38692630_qa_4/environment/pull_bucket.py +++ b/tasks/0038_692_38692630_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_692_38692630_qa_4/task.toml b/tasks/0038_692_38692630_qa_4/task.toml index b87707a7039f18d913ad38713fb746b093ca8702..7867e6234f2257211abe521e0b0b3c614da9db34 100644 --- a/tasks/0038_692_38692630_qa_4/task.toml +++ b/tasks/0038_692_38692630_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_705_38705868_qa_4/environment/bootstrap.sh b/tasks/0038_705_38705868_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_705_38705868_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_705_38705868_qa_4/environment/pull_bucket.py b/tasks/0038_705_38705868_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_705_38705868_qa_4/environment/pull_bucket.py +++ b/tasks/0038_705_38705868_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_705_38705868_qa_4/task.toml b/tasks/0038_705_38705868_qa_4/task.toml index 6f80e21f3d804306d578d15a334ef63c667d9872..053b4dda140230cef8eb429a5b6289bd93500202 100644 --- a/tasks/0038_705_38705868_qa_4/task.toml +++ b/tasks/0038_705_38705868_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_708_38708794_qa_3/environment/bootstrap.sh b/tasks/0038_708_38708794_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_708_38708794_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_708_38708794_qa_3/environment/pull_bucket.py b/tasks/0038_708_38708794_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_708_38708794_qa_3/environment/pull_bucket.py +++ b/tasks/0038_708_38708794_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_708_38708794_qa_3/task.toml b/tasks/0038_708_38708794_qa_3/task.toml index 0c2a49fe37afd388bb6573c5b83ccad675e13ec0..9599cba996f1adfec73418f410ea2c03a7fa6f20 100644 --- a/tasks/0038_708_38708794_qa_3/task.toml +++ b/tasks/0038_708_38708794_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_779_38779670_qa_5/environment/bootstrap.sh b/tasks/0038_779_38779670_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_779_38779670_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_779_38779670_qa_5/environment/pull_bucket.py b/tasks/0038_779_38779670_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_779_38779670_qa_5/environment/pull_bucket.py +++ b/tasks/0038_779_38779670_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_779_38779670_qa_5/task.toml b/tasks/0038_779_38779670_qa_5/task.toml index c7fb502e297226fc1f0f5c0618e02fe8acb19503..3732294c7f40592ed84d120e2002971cedc0dea0 100644 --- a/tasks/0038_779_38779670_qa_5/task.toml +++ b/tasks/0038_779_38779670_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_790_38790514_qa_3/environment/bootstrap.sh b/tasks/0038_790_38790514_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_790_38790514_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_790_38790514_qa_3/environment/pull_bucket.py b/tasks/0038_790_38790514_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_790_38790514_qa_3/environment/pull_bucket.py +++ b/tasks/0038_790_38790514_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_790_38790514_qa_3/task.toml b/tasks/0038_790_38790514_qa_3/task.toml index 5d5cd84f1ea3ad7e67474db0a212eccdc13b89d0..a564fe73482a8c88c5d517caa008bc9de67ac3a7 100644 --- a/tasks/0038_790_38790514_qa_3/task.toml +++ b/tasks/0038_790_38790514_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_821_38821052_qa_5/environment/bootstrap.sh b/tasks/0038_821_38821052_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_821_38821052_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_821_38821052_qa_5/environment/pull_bucket.py b/tasks/0038_821_38821052_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_821_38821052_qa_5/environment/pull_bucket.py +++ b/tasks/0038_821_38821052_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_821_38821052_qa_5/task.toml b/tasks/0038_821_38821052_qa_5/task.toml index b3ca16baee2637838df44de4177e24b84ebe3288..11b653d312b763a678a956c6aa4151bdc6a52234 100644 --- a/tasks/0038_821_38821052_qa_5/task.toml +++ b/tasks/0038_821_38821052_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_821_38821925_qa_1/environment/bootstrap.sh b/tasks/0038_821_38821925_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_821_38821925_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_821_38821925_qa_1/environment/pull_bucket.py b/tasks/0038_821_38821925_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_821_38821925_qa_1/environment/pull_bucket.py +++ b/tasks/0038_821_38821925_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_821_38821925_qa_1/task.toml b/tasks/0038_821_38821925_qa_1/task.toml index 04cecc8ed68a23dfc674db3f623abf7adc9d5f7f..aa68927e810455e0b9fe79e2d55359762959f194 100644 --- a/tasks/0038_821_38821925_qa_1/task.toml +++ b/tasks/0038_821_38821925_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_845_38845267_qa_1/environment/bootstrap.sh b/tasks/0038_845_38845267_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_845_38845267_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_845_38845267_qa_1/environment/pull_bucket.py b/tasks/0038_845_38845267_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_845_38845267_qa_1/environment/pull_bucket.py +++ b/tasks/0038_845_38845267_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_845_38845267_qa_1/task.toml b/tasks/0038_845_38845267_qa_1/task.toml index f82a50cbbc51547584677ce42f962fdde26c2010..06488732b02f4d987c35a7b829d34a610056852e 100644 --- a/tasks/0038_845_38845267_qa_1/task.toml +++ b/tasks/0038_845_38845267_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_884_38884588_qa_5/environment/bootstrap.sh b/tasks/0038_884_38884588_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_884_38884588_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_884_38884588_qa_5/environment/pull_bucket.py b/tasks/0038_884_38884588_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_884_38884588_qa_5/environment/pull_bucket.py +++ b/tasks/0038_884_38884588_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_884_38884588_qa_5/task.toml b/tasks/0038_884_38884588_qa_5/task.toml index 51e2caa7d08edf93fb9e8cdd8043314166e420ab..32cbb4387cf463a3d2a196c0a5b39c2e8558e72d 100644 --- a/tasks/0038_884_38884588_qa_5/task.toml +++ b/tasks/0038_884_38884588_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_899_38899462_qa_2/environment/bootstrap.sh b/tasks/0038_899_38899462_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_899_38899462_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_899_38899462_qa_2/environment/pull_bucket.py b/tasks/0038_899_38899462_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_899_38899462_qa_2/environment/pull_bucket.py +++ b/tasks/0038_899_38899462_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_899_38899462_qa_2/task.toml b/tasks/0038_899_38899462_qa_2/task.toml index 945caa6287432b6262ff12548471dc05ceae66d9..3a0ceeeb1558b3a8f61aa39533da67cbddb0249a 100644 --- a/tasks/0038_899_38899462_qa_2/task.toml +++ b/tasks/0038_899_38899462_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_900_38900780_qa_4/environment/bootstrap.sh b/tasks/0038_900_38900780_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_900_38900780_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_900_38900780_qa_4/environment/pull_bucket.py b/tasks/0038_900_38900780_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_900_38900780_qa_4/environment/pull_bucket.py +++ b/tasks/0038_900_38900780_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_900_38900780_qa_4/task.toml b/tasks/0038_900_38900780_qa_4/task.toml index da62a6d284e7e73cf2a225198956f91b4fcc8ba1..6f57fa37b429ee6fbd7abd445c4387d76161d38b 100644 --- a/tasks/0038_900_38900780_qa_4/task.toml +++ b/tasks/0038_900_38900780_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_900_38900780_qa_5/environment/bootstrap.sh b/tasks/0038_900_38900780_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_900_38900780_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_900_38900780_qa_5/environment/pull_bucket.py b/tasks/0038_900_38900780_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_900_38900780_qa_5/environment/pull_bucket.py +++ b/tasks/0038_900_38900780_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_900_38900780_qa_5/task.toml b/tasks/0038_900_38900780_qa_5/task.toml index a2cca08548378867874141ac338b47c20d4f824e..f2c3318fc4fc8ac4dd13eea77219a4fb42f6f4bc 100644 --- a/tasks/0038_900_38900780_qa_5/task.toml +++ b/tasks/0038_900_38900780_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_910_38910811_qa_2/environment/bootstrap.sh b/tasks/0038_910_38910811_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_910_38910811_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_910_38910811_qa_2/environment/pull_bucket.py b/tasks/0038_910_38910811_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_910_38910811_qa_2/environment/pull_bucket.py +++ b/tasks/0038_910_38910811_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_910_38910811_qa_2/task.toml b/tasks/0038_910_38910811_qa_2/task.toml index 461220503fbe6008b5ca2a287d16f0739ec4b58f..85f5ca85806e56193fa6042055455cad839d153a 100644 --- a/tasks/0038_910_38910811_qa_2/task.toml +++ b/tasks/0038_910_38910811_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_910_38910811_qa_5/environment/bootstrap.sh b/tasks/0038_910_38910811_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_910_38910811_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_910_38910811_qa_5/environment/pull_bucket.py b/tasks/0038_910_38910811_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_910_38910811_qa_5/environment/pull_bucket.py +++ b/tasks/0038_910_38910811_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_910_38910811_qa_5/task.toml b/tasks/0038_910_38910811_qa_5/task.toml index e8a731cda0cf4e516b9cac2b3e738a805c588807..83cfa95fc1fa5ff7034de8d0d725bf0ec1ee1778 100644 --- a/tasks/0038_910_38910811_qa_5/task.toml +++ b/tasks/0038_910_38910811_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_949_38949847_qa_2/environment/bootstrap.sh b/tasks/0038_949_38949847_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_949_38949847_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_949_38949847_qa_2/environment/pull_bucket.py b/tasks/0038_949_38949847_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_949_38949847_qa_2/environment/pull_bucket.py +++ b/tasks/0038_949_38949847_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_949_38949847_qa_2/task.toml b/tasks/0038_949_38949847_qa_2/task.toml index d69aab802fabd94ecdf06f4f0a456d35afd916f1..ce1e61e15ad326b592dfcc91edfe255004cf7f1d 100644 --- a/tasks/0038_949_38949847_qa_2/task.toml +++ b/tasks/0038_949_38949847_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_951_38951341_qa_1/environment/bootstrap.sh b/tasks/0038_951_38951341_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_951_38951341_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_951_38951341_qa_1/environment/pull_bucket.py b/tasks/0038_951_38951341_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_951_38951341_qa_1/environment/pull_bucket.py +++ b/tasks/0038_951_38951341_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_951_38951341_qa_1/task.toml b/tasks/0038_951_38951341_qa_1/task.toml index 313a4df8ca49c5ea95a0bf8476cefb62132c845c..dc64a938195f73a233b1df38ed9f35227de6407b 100644 --- a/tasks/0038_951_38951341_qa_1/task.toml +++ b/tasks/0038_951_38951341_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_970_38970193_qa_5/environment/bootstrap.sh b/tasks/0038_970_38970193_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_970_38970193_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_970_38970193_qa_5/environment/pull_bucket.py b/tasks/0038_970_38970193_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_970_38970193_qa_5/environment/pull_bucket.py +++ b/tasks/0038_970_38970193_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_970_38970193_qa_5/task.toml b/tasks/0038_970_38970193_qa_5/task.toml index cad026d357f39eadb71c797a0a771b64dd2aef01..b5e1a4cf5c4f7fa2011b1d2ea3c6a5c03cd433ea 100644 --- a/tasks/0038_970_38970193_qa_5/task.toml +++ b/tasks/0038_970_38970193_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_970_38970844_qa_5/environment/bootstrap.sh b/tasks/0038_970_38970844_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_970_38970844_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_970_38970844_qa_5/environment/pull_bucket.py b/tasks/0038_970_38970844_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_970_38970844_qa_5/environment/pull_bucket.py +++ b/tasks/0038_970_38970844_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_970_38970844_qa_5/task.toml b/tasks/0038_970_38970844_qa_5/task.toml index 86e7733db788c7ad294825aea5cee1f8c843cb9e..7958cec6f7465e97f165db761fa2ee64689bad7f 100644 --- a/tasks/0038_970_38970844_qa_5/task.toml +++ b/tasks/0038_970_38970844_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0038_984_38984979_qa_4/environment/bootstrap.sh b/tasks/0038_984_38984979_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0038_984_38984979_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0038_984_38984979_qa_4/environment/pull_bucket.py b/tasks/0038_984_38984979_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0038_984_38984979_qa_4/environment/pull_bucket.py +++ b/tasks/0038_984_38984979_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0038_984_38984979_qa_4/task.toml b/tasks/0038_984_38984979_qa_4/task.toml index 62988e02e556ce50deef4e4c0f047a5dfa948027..434e7d21e780b09d37d1823b3521f5b19375dd6e 100644 --- a/tasks/0038_984_38984979_qa_4/task.toml +++ b/tasks/0038_984_38984979_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_006_39006547_qa_4/environment/bootstrap.sh b/tasks/0039_006_39006547_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_006_39006547_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_006_39006547_qa_4/environment/pull_bucket.py b/tasks/0039_006_39006547_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_006_39006547_qa_4/environment/pull_bucket.py +++ b/tasks/0039_006_39006547_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_006_39006547_qa_4/task.toml b/tasks/0039_006_39006547_qa_4/task.toml index 24bc7c46b9d5009941a2761eb45d18b651022a72..49c3df1ebad933567ee10879d5a0ceb7c5d1f8dc 100644 --- a/tasks/0039_006_39006547_qa_4/task.toml +++ b/tasks/0039_006_39006547_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_008_39008775_qa_5/environment/bootstrap.sh b/tasks/0039_008_39008775_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_008_39008775_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_008_39008775_qa_5/environment/pull_bucket.py b/tasks/0039_008_39008775_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_008_39008775_qa_5/environment/pull_bucket.py +++ b/tasks/0039_008_39008775_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_008_39008775_qa_5/task.toml b/tasks/0039_008_39008775_qa_5/task.toml index 9d2b5649040c0bc07ce7d2fbc94e3ea957071f50..730fc3778f07ebfcebb906f4c4e7d474a1e560ee 100644 --- a/tasks/0039_008_39008775_qa_5/task.toml +++ b/tasks/0039_008_39008775_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_033_39033983_qa_3/environment/bootstrap.sh b/tasks/0039_033_39033983_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_033_39033983_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_033_39033983_qa_3/environment/pull_bucket.py b/tasks/0039_033_39033983_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_033_39033983_qa_3/environment/pull_bucket.py +++ b/tasks/0039_033_39033983_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_033_39033983_qa_3/task.toml b/tasks/0039_033_39033983_qa_3/task.toml index 4b166c324d25389405f0d11fb36013f527ddb6b8..f310a25d6abd96af78b47dd4f4605b1c34863600 100644 --- a/tasks/0039_033_39033983_qa_3/task.toml +++ b/tasks/0039_033_39033983_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_100_39100190_qa_5/environment/bootstrap.sh b/tasks/0039_100_39100190_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_100_39100190_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_100_39100190_qa_5/environment/pull_bucket.py b/tasks/0039_100_39100190_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_100_39100190_qa_5/environment/pull_bucket.py +++ b/tasks/0039_100_39100190_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_100_39100190_qa_5/task.toml b/tasks/0039_100_39100190_qa_5/task.toml index 7e2fcc751aa709774e269b2d2e5b28c4fbbc51a3..c6484beb3ea76f17db81f4894d187cbc5db94ae7 100644 --- a/tasks/0039_100_39100190_qa_5/task.toml +++ b/tasks/0039_100_39100190_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_111_39111308_qa_1/environment/bootstrap.sh b/tasks/0039_111_39111308_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_111_39111308_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_111_39111308_qa_1/environment/pull_bucket.py b/tasks/0039_111_39111308_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_111_39111308_qa_1/environment/pull_bucket.py +++ b/tasks/0039_111_39111308_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_111_39111308_qa_1/task.toml b/tasks/0039_111_39111308_qa_1/task.toml index 55d803b2e9ae81c8f1f18f7183d5b391ca7a7acd..4edf7ac27331ffc7f330c95000445e4a409db813 100644 --- a/tasks/0039_111_39111308_qa_1/task.toml +++ b/tasks/0039_111_39111308_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_126_39126060_qa_2/environment/bootstrap.sh b/tasks/0039_126_39126060_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_126_39126060_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_126_39126060_qa_2/environment/pull_bucket.py b/tasks/0039_126_39126060_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_126_39126060_qa_2/environment/pull_bucket.py +++ b/tasks/0039_126_39126060_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_126_39126060_qa_2/task.toml b/tasks/0039_126_39126060_qa_2/task.toml index fdbc01d95fb5e3e850c618d43a678a0309aa4c42..5c6674d41cd2872ef48737ffd23f9888000690ba 100644 --- a/tasks/0039_126_39126060_qa_2/task.toml +++ b/tasks/0039_126_39126060_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_131_39131612_qa_1/environment/bootstrap.sh b/tasks/0039_131_39131612_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_131_39131612_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_131_39131612_qa_1/environment/pull_bucket.py b/tasks/0039_131_39131612_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_131_39131612_qa_1/environment/pull_bucket.py +++ b/tasks/0039_131_39131612_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_131_39131612_qa_1/task.toml b/tasks/0039_131_39131612_qa_1/task.toml index 8aa2448a1d2e4f6f96945c11a037237d7861e8ba..60a68886fc2b1ee2026749ed9e334e7614211185 100644 --- a/tasks/0039_131_39131612_qa_1/task.toml +++ b/tasks/0039_131_39131612_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_154_39154395_qa_2/environment/bootstrap.sh b/tasks/0039_154_39154395_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_154_39154395_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_154_39154395_qa_2/environment/pull_bucket.py b/tasks/0039_154_39154395_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_154_39154395_qa_2/environment/pull_bucket.py +++ b/tasks/0039_154_39154395_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_154_39154395_qa_2/task.toml b/tasks/0039_154_39154395_qa_2/task.toml index ad4091d5fd4ee424a1f05a1d445b79c79a50d115..807103befee8358281ea6a8d333ee904e8ec40ed 100644 --- a/tasks/0039_154_39154395_qa_2/task.toml +++ b/tasks/0039_154_39154395_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_156_39156457_qa_3/environment/bootstrap.sh b/tasks/0039_156_39156457_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_156_39156457_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_156_39156457_qa_3/environment/pull_bucket.py b/tasks/0039_156_39156457_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_156_39156457_qa_3/environment/pull_bucket.py +++ b/tasks/0039_156_39156457_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_156_39156457_qa_3/task.toml b/tasks/0039_156_39156457_qa_3/task.toml index 235d0c7e4cb7f2ab5990060132899c750cf9e6b3..e0b2aca5b214b0af91c71164c638cf80b9a155d0 100644 --- a/tasks/0039_156_39156457_qa_3/task.toml +++ b/tasks/0039_156_39156457_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_159_39159070_qa_2/environment/bootstrap.sh b/tasks/0039_159_39159070_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_159_39159070_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_159_39159070_qa_2/environment/pull_bucket.py b/tasks/0039_159_39159070_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_159_39159070_qa_2/environment/pull_bucket.py +++ b/tasks/0039_159_39159070_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_159_39159070_qa_2/task.toml b/tasks/0039_159_39159070_qa_2/task.toml index 5ea2c8ddada179190b0e5754e7014a47f983fb61..58a626a7bd01cac3372c7535ea57ea87ff660a56 100644 --- a/tasks/0039_159_39159070_qa_2/task.toml +++ b/tasks/0039_159_39159070_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_161_39161872_qa_5/environment/bootstrap.sh b/tasks/0039_161_39161872_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_161_39161872_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_161_39161872_qa_5/environment/pull_bucket.py b/tasks/0039_161_39161872_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_161_39161872_qa_5/environment/pull_bucket.py +++ b/tasks/0039_161_39161872_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_161_39161872_qa_5/task.toml b/tasks/0039_161_39161872_qa_5/task.toml index 9e2df3a7cd7510f222ce257717610e10197ee5ec..bd1b52c166ad769a01c1716ebbca4c3b90c59832 100644 --- a/tasks/0039_161_39161872_qa_5/task.toml +++ b/tasks/0039_161_39161872_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_221_39221041_qa_2/environment/bootstrap.sh b/tasks/0039_221_39221041_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_221_39221041_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_221_39221041_qa_2/environment/pull_bucket.py b/tasks/0039_221_39221041_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_221_39221041_qa_2/environment/pull_bucket.py +++ b/tasks/0039_221_39221041_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_221_39221041_qa_2/task.toml b/tasks/0039_221_39221041_qa_2/task.toml index 451fb3e4a21645782270803d0b23d0d7fb95cf83..951bd3e2e12e80c932d4f7cded520406ee11082a 100644 --- a/tasks/0039_221_39221041_qa_2/task.toml +++ b/tasks/0039_221_39221041_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_234_39234687_qa_1/environment/bootstrap.sh b/tasks/0039_234_39234687_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_234_39234687_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_234_39234687_qa_1/environment/pull_bucket.py b/tasks/0039_234_39234687_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_234_39234687_qa_1/environment/pull_bucket.py +++ b/tasks/0039_234_39234687_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_234_39234687_qa_1/task.toml b/tasks/0039_234_39234687_qa_1/task.toml index 1daff57ba013f01e5822b72c5ebc3eed2f4617ab..507e0e58209c5c4a2fb8ea3619fd96ada762c375 100644 --- a/tasks/0039_234_39234687_qa_1/task.toml +++ b/tasks/0039_234_39234687_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_234_39234687_qa_2/environment/bootstrap.sh b/tasks/0039_234_39234687_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_234_39234687_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_234_39234687_qa_2/environment/pull_bucket.py b/tasks/0039_234_39234687_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_234_39234687_qa_2/environment/pull_bucket.py +++ b/tasks/0039_234_39234687_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_234_39234687_qa_2/task.toml b/tasks/0039_234_39234687_qa_2/task.toml index bbdf82150110d962fe0f0eac0a8a284e88cc0f8e..99ac0582b2f0fd27bcdba615d5838b3b99525224 100644 --- a/tasks/0039_234_39234687_qa_2/task.toml +++ b/tasks/0039_234_39234687_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_243_39243552_qa_4/environment/bootstrap.sh b/tasks/0039_243_39243552_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_243_39243552_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_243_39243552_qa_4/environment/pull_bucket.py b/tasks/0039_243_39243552_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_243_39243552_qa_4/environment/pull_bucket.py +++ b/tasks/0039_243_39243552_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_243_39243552_qa_4/task.toml b/tasks/0039_243_39243552_qa_4/task.toml index baba27ed4bf5af258d843ce909843d88b40e1568..4f8c14c5035bc941680b5528afff960c55e44a58 100644 --- a/tasks/0039_243_39243552_qa_4/task.toml +++ b/tasks/0039_243_39243552_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_289_39289264_qa_1/environment/bootstrap.sh b/tasks/0039_289_39289264_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_289_39289264_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_289_39289264_qa_1/environment/pull_bucket.py b/tasks/0039_289_39289264_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_289_39289264_qa_1/environment/pull_bucket.py +++ b/tasks/0039_289_39289264_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_289_39289264_qa_1/task.toml b/tasks/0039_289_39289264_qa_1/task.toml index 5e51fec615bcc61040a23ddc70357a909a5fc1d4..b9733aebfc90e78c9f5547ad3d60b145e4e7953f 100644 --- a/tasks/0039_289_39289264_qa_1/task.toml +++ b/tasks/0039_289_39289264_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_293_39293599_qa_4/environment/bootstrap.sh b/tasks/0039_293_39293599_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_293_39293599_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_293_39293599_qa_4/environment/pull_bucket.py b/tasks/0039_293_39293599_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_293_39293599_qa_4/environment/pull_bucket.py +++ b/tasks/0039_293_39293599_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_293_39293599_qa_4/task.toml b/tasks/0039_293_39293599_qa_4/task.toml index 005aa36c6c596bee93a167aaac99504ed5dfa9c7..68f5960b069bc4672698a57583cf19fe238852b1 100644 --- a/tasks/0039_293_39293599_qa_4/task.toml +++ b/tasks/0039_293_39293599_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_302_39302156_qa_3/environment/bootstrap.sh b/tasks/0039_302_39302156_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_302_39302156_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_302_39302156_qa_3/environment/pull_bucket.py b/tasks/0039_302_39302156_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_302_39302156_qa_3/environment/pull_bucket.py +++ b/tasks/0039_302_39302156_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_302_39302156_qa_3/task.toml b/tasks/0039_302_39302156_qa_3/task.toml index 89d09c5bf08f6a58e47dd956b7958b6dbdf52df9..df17273ad18fc78a08e0f69eef048dc52063ae4c 100644 --- a/tasks/0039_302_39302156_qa_3/task.toml +++ b/tasks/0039_302_39302156_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_302_39302156_qa_5/environment/bootstrap.sh b/tasks/0039_302_39302156_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_302_39302156_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_302_39302156_qa_5/environment/pull_bucket.py b/tasks/0039_302_39302156_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_302_39302156_qa_5/environment/pull_bucket.py +++ b/tasks/0039_302_39302156_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_302_39302156_qa_5/task.toml b/tasks/0039_302_39302156_qa_5/task.toml index b65b05b6fc17cabcf77f6ca537b7492b8aa64344..d884dbd0758ed8d4a4cb601ff9362520be781288 100644 --- a/tasks/0039_302_39302156_qa_5/task.toml +++ b/tasks/0039_302_39302156_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_318_39318025_qa_4/environment/bootstrap.sh b/tasks/0039_318_39318025_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_318_39318025_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_318_39318025_qa_4/environment/pull_bucket.py b/tasks/0039_318_39318025_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_318_39318025_qa_4/environment/pull_bucket.py +++ b/tasks/0039_318_39318025_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_318_39318025_qa_4/task.toml b/tasks/0039_318_39318025_qa_4/task.toml index 5dcdbf0d8c3533e5baff695d1624eea471e68325..dd3f437dacdf77418d6e5c321b41f82e32c055a1 100644 --- a/tasks/0039_318_39318025_qa_4/task.toml +++ b/tasks/0039_318_39318025_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_354_39354291_qa_1/environment/bootstrap.sh b/tasks/0039_354_39354291_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_354_39354291_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_354_39354291_qa_1/environment/pull_bucket.py b/tasks/0039_354_39354291_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_354_39354291_qa_1/environment/pull_bucket.py +++ b/tasks/0039_354_39354291_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_354_39354291_qa_1/task.toml b/tasks/0039_354_39354291_qa_1/task.toml index 5bd046a89c6ec32e6f5c27012ad7ceb36a6aabb4..ca53ce8a8c7c4e4152d4b6871c1a0c5387c31b04 100644 --- a/tasks/0039_354_39354291_qa_1/task.toml +++ b/tasks/0039_354_39354291_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_354_39354291_qa_3/environment/bootstrap.sh b/tasks/0039_354_39354291_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_354_39354291_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_354_39354291_qa_3/environment/pull_bucket.py b/tasks/0039_354_39354291_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_354_39354291_qa_3/environment/pull_bucket.py +++ b/tasks/0039_354_39354291_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_354_39354291_qa_3/task.toml b/tasks/0039_354_39354291_qa_3/task.toml index e93f8fdc7d767d23d304f7310495115ef271119c..3b1058819f5e3be6e622770d267feabcac31bae7 100644 --- a/tasks/0039_354_39354291_qa_3/task.toml +++ b/tasks/0039_354_39354291_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_357_39357103_qa_3/environment/bootstrap.sh b/tasks/0039_357_39357103_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_357_39357103_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_357_39357103_qa_3/environment/pull_bucket.py b/tasks/0039_357_39357103_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_357_39357103_qa_3/environment/pull_bucket.py +++ b/tasks/0039_357_39357103_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_357_39357103_qa_3/task.toml b/tasks/0039_357_39357103_qa_3/task.toml index 3e919eb3036ed0318c458a233bd44766f6d95d89..10484f828d324b7e33096230e14b0fab2b07968b 100644 --- a/tasks/0039_357_39357103_qa_3/task.toml +++ b/tasks/0039_357_39357103_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_370_39370613_qa_3/environment/bootstrap.sh b/tasks/0039_370_39370613_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_370_39370613_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_370_39370613_qa_3/environment/pull_bucket.py b/tasks/0039_370_39370613_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_370_39370613_qa_3/environment/pull_bucket.py +++ b/tasks/0039_370_39370613_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_370_39370613_qa_3/task.toml b/tasks/0039_370_39370613_qa_3/task.toml index c8f3a2ac52a2778cc021c7d22cc553b368ac8e1f..2e8e53e77f751d1951e546a7f4ece46c07ac9218 100644 --- a/tasks/0039_370_39370613_qa_3/task.toml +++ b/tasks/0039_370_39370613_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_376_39376908_qa_1/environment/bootstrap.sh b/tasks/0039_376_39376908_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_376_39376908_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_376_39376908_qa_1/environment/pull_bucket.py b/tasks/0039_376_39376908_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_376_39376908_qa_1/environment/pull_bucket.py +++ b/tasks/0039_376_39376908_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_376_39376908_qa_1/task.toml b/tasks/0039_376_39376908_qa_1/task.toml index b3f08133317646cb2684683d1c234b1ba6f934a1..4a3c1c3b0f69611fd092bb84dbf817032652f4a9 100644 --- a/tasks/0039_376_39376908_qa_1/task.toml +++ b/tasks/0039_376_39376908_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_392_39392401_qa_1/environment/bootstrap.sh b/tasks/0039_392_39392401_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_392_39392401_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_392_39392401_qa_1/environment/pull_bucket.py b/tasks/0039_392_39392401_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_392_39392401_qa_1/environment/pull_bucket.py +++ b/tasks/0039_392_39392401_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_392_39392401_qa_1/task.toml b/tasks/0039_392_39392401_qa_1/task.toml index 297aa7148fc9bb57b1b26d8de588c16b1cc3798c..53e3992a8ef6c1e85fa0cfd5d4220c64955da108 100644 --- a/tasks/0039_392_39392401_qa_1/task.toml +++ b/tasks/0039_392_39392401_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_392_39392401_qa_3/environment/bootstrap.sh b/tasks/0039_392_39392401_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_392_39392401_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_392_39392401_qa_3/environment/pull_bucket.py b/tasks/0039_392_39392401_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_392_39392401_qa_3/environment/pull_bucket.py +++ b/tasks/0039_392_39392401_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_392_39392401_qa_3/task.toml b/tasks/0039_392_39392401_qa_3/task.toml index aba4432d110e4b7bc95182966bc70182274ac13e..59e484eb7fc19cdb2e45c0fd5023af1931348885 100644 --- a/tasks/0039_392_39392401_qa_3/task.toml +++ b/tasks/0039_392_39392401_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_398_39398269_qa_1/environment/bootstrap.sh b/tasks/0039_398_39398269_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_398_39398269_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_398_39398269_qa_1/environment/pull_bucket.py b/tasks/0039_398_39398269_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_398_39398269_qa_1/environment/pull_bucket.py +++ b/tasks/0039_398_39398269_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_398_39398269_qa_1/task.toml b/tasks/0039_398_39398269_qa_1/task.toml index 26a224b89d4f3b691864d5c8f8e791898bc728d2..d8e332e324bdb9bb173e618031f5539e3e9576cb 100644 --- a/tasks/0039_398_39398269_qa_1/task.toml +++ b/tasks/0039_398_39398269_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_409_39409376_qa_2/environment/bootstrap.sh b/tasks/0039_409_39409376_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_409_39409376_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_409_39409376_qa_2/environment/pull_bucket.py b/tasks/0039_409_39409376_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_409_39409376_qa_2/environment/pull_bucket.py +++ b/tasks/0039_409_39409376_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_409_39409376_qa_2/task.toml b/tasks/0039_409_39409376_qa_2/task.toml index 1f63e62d02e8db14fc42e1e2ec3deb5870ee1748..a9401e90d3a190adb842b7c7231a3a417e903bb9 100644 --- a/tasks/0039_409_39409376_qa_2/task.toml +++ b/tasks/0039_409_39409376_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_450_39450914_qa_1/environment/bootstrap.sh b/tasks/0039_450_39450914_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_450_39450914_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_450_39450914_qa_1/environment/pull_bucket.py b/tasks/0039_450_39450914_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_450_39450914_qa_1/environment/pull_bucket.py +++ b/tasks/0039_450_39450914_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_450_39450914_qa_1/task.toml b/tasks/0039_450_39450914_qa_1/task.toml index fec9445d9fa1f4ab034ac2b960750af06a7f34b6..97b46af02053dd359bcb6fd147a4befae98c845f 100644 --- a/tasks/0039_450_39450914_qa_1/task.toml +++ b/tasks/0039_450_39450914_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_450_39450914_qa_3/environment/bootstrap.sh b/tasks/0039_450_39450914_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_450_39450914_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_450_39450914_qa_3/environment/pull_bucket.py b/tasks/0039_450_39450914_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_450_39450914_qa_3/environment/pull_bucket.py +++ b/tasks/0039_450_39450914_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_450_39450914_qa_3/task.toml b/tasks/0039_450_39450914_qa_3/task.toml index ff968822ee5a2979ad94743fd2601f688c73ecda..69a0b56ca66bed700d8b66dd2aa0b7e849abbc48 100644 --- a/tasks/0039_450_39450914_qa_3/task.toml +++ b/tasks/0039_450_39450914_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_450_39450914_qa_4/environment/bootstrap.sh b/tasks/0039_450_39450914_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_450_39450914_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_450_39450914_qa_4/environment/pull_bucket.py b/tasks/0039_450_39450914_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_450_39450914_qa_4/environment/pull_bucket.py +++ b/tasks/0039_450_39450914_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_450_39450914_qa_4/task.toml b/tasks/0039_450_39450914_qa_4/task.toml index b7d94b42c30559eb014f06f7f5eb37d58ade7c4a..9d33f786fdfb3f290921c5d9d82aa37d16bb846e 100644 --- a/tasks/0039_450_39450914_qa_4/task.toml +++ b/tasks/0039_450_39450914_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_458_39458303_qa_5/environment/bootstrap.sh b/tasks/0039_458_39458303_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_458_39458303_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_458_39458303_qa_5/environment/pull_bucket.py b/tasks/0039_458_39458303_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_458_39458303_qa_5/environment/pull_bucket.py +++ b/tasks/0039_458_39458303_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_458_39458303_qa_5/task.toml b/tasks/0039_458_39458303_qa_5/task.toml index c08ab4081b590904ba6c0f7ab9d2425858221e46..99a6c046303b9b91e15d52154e1abc5092378e5b 100644 --- a/tasks/0039_458_39458303_qa_5/task.toml +++ b/tasks/0039_458_39458303_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_470_39470080_qa_2/environment/bootstrap.sh b/tasks/0039_470_39470080_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_470_39470080_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_470_39470080_qa_2/environment/pull_bucket.py b/tasks/0039_470_39470080_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_470_39470080_qa_2/environment/pull_bucket.py +++ b/tasks/0039_470_39470080_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_470_39470080_qa_2/task.toml b/tasks/0039_470_39470080_qa_2/task.toml index 064c1a1635c4b3f30d126ba09de617147a7707c6..036499b0b812e37f36de7097561952a3b10c4414 100644 --- a/tasks/0039_470_39470080_qa_2/task.toml +++ b/tasks/0039_470_39470080_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_470_39470080_qa_3/environment/bootstrap.sh b/tasks/0039_470_39470080_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_470_39470080_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_470_39470080_qa_3/environment/pull_bucket.py b/tasks/0039_470_39470080_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_470_39470080_qa_3/environment/pull_bucket.py +++ b/tasks/0039_470_39470080_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_470_39470080_qa_3/task.toml b/tasks/0039_470_39470080_qa_3/task.toml index 98569868ee6e34cb4ea27a2bb69506dc62f130aa..86f6f1e414db7b1c1284d19b4fe656a4778b21e1 100644 --- a/tasks/0039_470_39470080_qa_3/task.toml +++ b/tasks/0039_470_39470080_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_477_39477592_qa_5/environment/bootstrap.sh b/tasks/0039_477_39477592_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_477_39477592_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_477_39477592_qa_5/environment/pull_bucket.py b/tasks/0039_477_39477592_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_477_39477592_qa_5/environment/pull_bucket.py +++ b/tasks/0039_477_39477592_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_477_39477592_qa_5/task.toml b/tasks/0039_477_39477592_qa_5/task.toml index 00a8bbd3aa44b1e58c816f321a7ada149b91f8d5..afcc64dc4f5e14d375c2d6b910a390a61ad315ea 100644 --- a/tasks/0039_477_39477592_qa_5/task.toml +++ b/tasks/0039_477_39477592_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_489_39489585_qa_1/environment/bootstrap.sh b/tasks/0039_489_39489585_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_489_39489585_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_489_39489585_qa_1/environment/pull_bucket.py b/tasks/0039_489_39489585_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_489_39489585_qa_1/environment/pull_bucket.py +++ b/tasks/0039_489_39489585_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_489_39489585_qa_1/task.toml b/tasks/0039_489_39489585_qa_1/task.toml index a5e506aaa6c11f46f1bac5530650011f72c30252..aa2a4ff71ac8ed0ca29ebe43523549cda2062611 100644 --- a/tasks/0039_489_39489585_qa_1/task.toml +++ b/tasks/0039_489_39489585_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_489_39489585_qa_2/environment/bootstrap.sh b/tasks/0039_489_39489585_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_489_39489585_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_489_39489585_qa_2/environment/pull_bucket.py b/tasks/0039_489_39489585_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_489_39489585_qa_2/environment/pull_bucket.py +++ b/tasks/0039_489_39489585_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_489_39489585_qa_2/task.toml b/tasks/0039_489_39489585_qa_2/task.toml index 1926d6b78b47d079631d5d20869163daac6a895e..c7d5fa5927044635e21b008895022e2285329549 100644 --- a/tasks/0039_489_39489585_qa_2/task.toml +++ b/tasks/0039_489_39489585_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_510_39510919_qa_3/environment/bootstrap.sh b/tasks/0039_510_39510919_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_510_39510919_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_510_39510919_qa_3/environment/pull_bucket.py b/tasks/0039_510_39510919_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_510_39510919_qa_3/environment/pull_bucket.py +++ b/tasks/0039_510_39510919_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_510_39510919_qa_3/task.toml b/tasks/0039_510_39510919_qa_3/task.toml index abdd98a7dd78741ccf506fbd498ef6829dad4611..c000bd804277de236ffd4cd79802c09c81ab2b9b 100644 --- a/tasks/0039_510_39510919_qa_3/task.toml +++ b/tasks/0039_510_39510919_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_510_39510919_qa_4/environment/bootstrap.sh b/tasks/0039_510_39510919_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_510_39510919_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_510_39510919_qa_4/environment/pull_bucket.py b/tasks/0039_510_39510919_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_510_39510919_qa_4/environment/pull_bucket.py +++ b/tasks/0039_510_39510919_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_510_39510919_qa_4/task.toml b/tasks/0039_510_39510919_qa_4/task.toml index 148a282bd4851ee287d2db4d63d5f36e2abaeb09..f1bcbd6723cc6ebf19d056709520a525d08768dd 100644 --- a/tasks/0039_510_39510919_qa_4/task.toml +++ b/tasks/0039_510_39510919_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_510_39510919_qa_5/environment/bootstrap.sh b/tasks/0039_510_39510919_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_510_39510919_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_510_39510919_qa_5/environment/pull_bucket.py b/tasks/0039_510_39510919_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_510_39510919_qa_5/environment/pull_bucket.py +++ b/tasks/0039_510_39510919_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_510_39510919_qa_5/task.toml b/tasks/0039_510_39510919_qa_5/task.toml index 415562222cbbebeef480f19dc23d308af9b3b32e..d4cae32c7efe330a24ffa1131d76139b94f7fcf1 100644 --- a/tasks/0039_510_39510919_qa_5/task.toml +++ b/tasks/0039_510_39510919_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_512_39512601_qa_2/environment/bootstrap.sh b/tasks/0039_512_39512601_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_512_39512601_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_512_39512601_qa_2/environment/pull_bucket.py b/tasks/0039_512_39512601_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_512_39512601_qa_2/environment/pull_bucket.py +++ b/tasks/0039_512_39512601_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_512_39512601_qa_2/task.toml b/tasks/0039_512_39512601_qa_2/task.toml index 008c49ebdcef2add453c2ae19cdd06c16be47ab1..b0f9bae80370d9e35f708df6ddc40d57a0f98ea8 100644 --- a/tasks/0039_512_39512601_qa_2/task.toml +++ b/tasks/0039_512_39512601_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_513_39513695_qa_3/environment/bootstrap.sh b/tasks/0039_513_39513695_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_513_39513695_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_513_39513695_qa_3/environment/pull_bucket.py b/tasks/0039_513_39513695_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_513_39513695_qa_3/environment/pull_bucket.py +++ b/tasks/0039_513_39513695_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_513_39513695_qa_3/task.toml b/tasks/0039_513_39513695_qa_3/task.toml index 4b7bb213b3e9855218a1043af591f3ec9e176695..c035a01bde1c35b54dc5ae6da162ec8b09e11cb8 100644 --- a/tasks/0039_513_39513695_qa_3/task.toml +++ b/tasks/0039_513_39513695_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_513_39513695_qa_4/environment/bootstrap.sh b/tasks/0039_513_39513695_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_513_39513695_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_513_39513695_qa_4/environment/pull_bucket.py b/tasks/0039_513_39513695_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_513_39513695_qa_4/environment/pull_bucket.py +++ b/tasks/0039_513_39513695_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_513_39513695_qa_4/task.toml b/tasks/0039_513_39513695_qa_4/task.toml index 8a5d6215f71246d073cf656ebb3223aca3c4d503..ea69b541fce01774e6a00afd2e119404c01103e9 100644 --- a/tasks/0039_513_39513695_qa_4/task.toml +++ b/tasks/0039_513_39513695_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_560_39560761_qa_1/environment/bootstrap.sh b/tasks/0039_560_39560761_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_560_39560761_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_560_39560761_qa_1/environment/pull_bucket.py b/tasks/0039_560_39560761_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_560_39560761_qa_1/environment/pull_bucket.py +++ b/tasks/0039_560_39560761_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_560_39560761_qa_1/task.toml b/tasks/0039_560_39560761_qa_1/task.toml index c15a9b3ed8925a8887d4826f9f0341d4c8c3bf9d..a5a2adf110ed3a8e8c8c39ee5a7bbc4ac52181e4 100644 --- a/tasks/0039_560_39560761_qa_1/task.toml +++ b/tasks/0039_560_39560761_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_560_39560761_qa_3/environment/bootstrap.sh b/tasks/0039_560_39560761_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_560_39560761_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_560_39560761_qa_3/environment/pull_bucket.py b/tasks/0039_560_39560761_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_560_39560761_qa_3/environment/pull_bucket.py +++ b/tasks/0039_560_39560761_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_560_39560761_qa_3/task.toml b/tasks/0039_560_39560761_qa_3/task.toml index cb146f8b1361ef74aafa398189da972953bd32f9..3259aa279591d1eff7d61790e25d86073ed8c31a 100644 --- a/tasks/0039_560_39560761_qa_3/task.toml +++ b/tasks/0039_560_39560761_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_581_39581749_qa_4/environment/bootstrap.sh b/tasks/0039_581_39581749_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_581_39581749_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_581_39581749_qa_4/environment/pull_bucket.py b/tasks/0039_581_39581749_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_581_39581749_qa_4/environment/pull_bucket.py +++ b/tasks/0039_581_39581749_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_581_39581749_qa_4/task.toml b/tasks/0039_581_39581749_qa_4/task.toml index 345330b28173ac9248866654a2f66e65e7b3ccda..7ecb8f8d6f320e4463697d756fe27ba5b4e3a144 100644 --- a/tasks/0039_581_39581749_qa_4/task.toml +++ b/tasks/0039_581_39581749_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_581_39581749_qa_5/environment/bootstrap.sh b/tasks/0039_581_39581749_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_581_39581749_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_581_39581749_qa_5/environment/pull_bucket.py b/tasks/0039_581_39581749_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_581_39581749_qa_5/environment/pull_bucket.py +++ b/tasks/0039_581_39581749_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_581_39581749_qa_5/task.toml b/tasks/0039_581_39581749_qa_5/task.toml index a2fb8dd68bea69d9b710ef5078a129be2865f4d1..7a75aa2c5beefbc533814728f7509a78c6fa9483 100644 --- a/tasks/0039_581_39581749_qa_5/task.toml +++ b/tasks/0039_581_39581749_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_599_39599874_qa_1/environment/bootstrap.sh b/tasks/0039_599_39599874_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_599_39599874_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_599_39599874_qa_1/environment/pull_bucket.py b/tasks/0039_599_39599874_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_599_39599874_qa_1/environment/pull_bucket.py +++ b/tasks/0039_599_39599874_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_599_39599874_qa_1/task.toml b/tasks/0039_599_39599874_qa_1/task.toml index 7519534aac977f972aeadc7506a82001dc34238d..f7346ba60e0485713a11e351169fcfcdc9713537 100644 --- a/tasks/0039_599_39599874_qa_1/task.toml +++ b/tasks/0039_599_39599874_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_599_39599874_qa_4/environment/bootstrap.sh b/tasks/0039_599_39599874_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_599_39599874_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_599_39599874_qa_4/environment/pull_bucket.py b/tasks/0039_599_39599874_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_599_39599874_qa_4/environment/pull_bucket.py +++ b/tasks/0039_599_39599874_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_599_39599874_qa_4/task.toml b/tasks/0039_599_39599874_qa_4/task.toml index 4dbcc10cb872c75ee5d5fa60d9ca98926d2079d4..82d36ebeca6864d438a7b90016f21bf8b324ffd8 100644 --- a/tasks/0039_599_39599874_qa_4/task.toml +++ b/tasks/0039_599_39599874_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_613_39613543_qa_3/environment/bootstrap.sh b/tasks/0039_613_39613543_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_613_39613543_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_613_39613543_qa_3/environment/pull_bucket.py b/tasks/0039_613_39613543_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_613_39613543_qa_3/environment/pull_bucket.py +++ b/tasks/0039_613_39613543_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_613_39613543_qa_3/task.toml b/tasks/0039_613_39613543_qa_3/task.toml index e4dd2db4e8c801b2420b8ec2fb11bf00c4fc208c..799208eb16166016682e39b8e14a170a348b8f1a 100644 --- a/tasks/0039_613_39613543_qa_3/task.toml +++ b/tasks/0039_613_39613543_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_655_39655291_qa_2/environment/bootstrap.sh b/tasks/0039_655_39655291_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_655_39655291_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_655_39655291_qa_2/environment/pull_bucket.py b/tasks/0039_655_39655291_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_655_39655291_qa_2/environment/pull_bucket.py +++ b/tasks/0039_655_39655291_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_655_39655291_qa_2/task.toml b/tasks/0039_655_39655291_qa_2/task.toml index dc816c9888b359dfe64ae8d7db4d7aedd67dae3b..2c7bbb34cff1e5653f5ba4fbe1fc053b0c3ed3ff 100644 --- a/tasks/0039_655_39655291_qa_2/task.toml +++ b/tasks/0039_655_39655291_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_655_39655291_qa_4/environment/bootstrap.sh b/tasks/0039_655_39655291_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_655_39655291_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_655_39655291_qa_4/environment/pull_bucket.py b/tasks/0039_655_39655291_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_655_39655291_qa_4/environment/pull_bucket.py +++ b/tasks/0039_655_39655291_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_655_39655291_qa_4/task.toml b/tasks/0039_655_39655291_qa_4/task.toml index 94da38e00cdfbbf94f050125efc60212fbb01cac..532e1c1b110ca174eebc581dcf4555044ebeae5f 100644 --- a/tasks/0039_655_39655291_qa_4/task.toml +++ b/tasks/0039_655_39655291_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_667_39667959_qa_5/environment/bootstrap.sh b/tasks/0039_667_39667959_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_667_39667959_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_667_39667959_qa_5/environment/pull_bucket.py b/tasks/0039_667_39667959_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_667_39667959_qa_5/environment/pull_bucket.py +++ b/tasks/0039_667_39667959_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_667_39667959_qa_5/task.toml b/tasks/0039_667_39667959_qa_5/task.toml index 255b5891acb3f17c73c04419d267ad0aabc30b4a..7a5f4b7647c7ba6e3c8dd4a2e7b945632fc09adb 100644 --- a/tasks/0039_667_39667959_qa_5/task.toml +++ b/tasks/0039_667_39667959_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_671_39671080_qa_2/environment/bootstrap.sh b/tasks/0039_671_39671080_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_671_39671080_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_671_39671080_qa_2/environment/pull_bucket.py b/tasks/0039_671_39671080_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_671_39671080_qa_2/environment/pull_bucket.py +++ b/tasks/0039_671_39671080_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_671_39671080_qa_2/task.toml b/tasks/0039_671_39671080_qa_2/task.toml index 9c2b3fe4c149bd962b45027e3c49b8acb8812cec..9aa7cc3d416fff1499521e74a30a4ba4ceaf71f5 100644 --- a/tasks/0039_671_39671080_qa_2/task.toml +++ b/tasks/0039_671_39671080_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_708_39708837_qa_1/environment/bootstrap.sh b/tasks/0039_708_39708837_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_708_39708837_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_708_39708837_qa_1/environment/pull_bucket.py b/tasks/0039_708_39708837_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_708_39708837_qa_1/environment/pull_bucket.py +++ b/tasks/0039_708_39708837_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_708_39708837_qa_1/task.toml b/tasks/0039_708_39708837_qa_1/task.toml index 49bb213b0e89c9e2f4f4ac4864ba943657a68fd0..e93dd83d21a370132f2677b0ad2f06c0d205b134 100644 --- a/tasks/0039_708_39708837_qa_1/task.toml +++ b/tasks/0039_708_39708837_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_714_39714962_qa_1/environment/bootstrap.sh b/tasks/0039_714_39714962_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_714_39714962_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_714_39714962_qa_1/environment/pull_bucket.py b/tasks/0039_714_39714962_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_714_39714962_qa_1/environment/pull_bucket.py +++ b/tasks/0039_714_39714962_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_714_39714962_qa_1/task.toml b/tasks/0039_714_39714962_qa_1/task.toml index 96dc256a836d42ed3ef862125f6db09c44b01065..440daafee35056d79b20bb80ba942dedd618c006 100644 --- a/tasks/0039_714_39714962_qa_1/task.toml +++ b/tasks/0039_714_39714962_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_714_39714962_qa_2/environment/bootstrap.sh b/tasks/0039_714_39714962_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_714_39714962_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_714_39714962_qa_2/environment/pull_bucket.py b/tasks/0039_714_39714962_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_714_39714962_qa_2/environment/pull_bucket.py +++ b/tasks/0039_714_39714962_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_714_39714962_qa_2/task.toml b/tasks/0039_714_39714962_qa_2/task.toml index 5833e6ad3930da420977fe8aa60290c2aea9feeb..16307db67b174c98ab812d692b806194d8e5b399 100644 --- a/tasks/0039_714_39714962_qa_2/task.toml +++ b/tasks/0039_714_39714962_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_714_39714962_qa_3/environment/bootstrap.sh b/tasks/0039_714_39714962_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_714_39714962_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_714_39714962_qa_3/environment/pull_bucket.py b/tasks/0039_714_39714962_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_714_39714962_qa_3/environment/pull_bucket.py +++ b/tasks/0039_714_39714962_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_714_39714962_qa_3/task.toml b/tasks/0039_714_39714962_qa_3/task.toml index aa8f9c4404539dc69b0bfd673f68e87f0bed0c2c..2fd43c58b64214332529a44b55ffb5f3c7c348a1 100644 --- a/tasks/0039_714_39714962_qa_3/task.toml +++ b/tasks/0039_714_39714962_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_715_39715876_qa_1/environment/bootstrap.sh b/tasks/0039_715_39715876_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_715_39715876_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_715_39715876_qa_1/environment/pull_bucket.py b/tasks/0039_715_39715876_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_715_39715876_qa_1/environment/pull_bucket.py +++ b/tasks/0039_715_39715876_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_715_39715876_qa_1/task.toml b/tasks/0039_715_39715876_qa_1/task.toml index bd0d321b4f5d18abbfbf3a3e52ac5426163932f1..95ca7820f35ebc6108b621443d096f4841455edc 100644 --- a/tasks/0039_715_39715876_qa_1/task.toml +++ b/tasks/0039_715_39715876_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_729_39729863_qa_2/environment/bootstrap.sh b/tasks/0039_729_39729863_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_729_39729863_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_729_39729863_qa_2/environment/pull_bucket.py b/tasks/0039_729_39729863_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_729_39729863_qa_2/environment/pull_bucket.py +++ b/tasks/0039_729_39729863_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_729_39729863_qa_2/task.toml b/tasks/0039_729_39729863_qa_2/task.toml index d0065c5b44d8821ad768e4984e0224cc7a71ded4..deae76b1b2cc44a022d0812aafb9dafd719545c3 100644 --- a/tasks/0039_729_39729863_qa_2/task.toml +++ b/tasks/0039_729_39729863_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_729_39729863_qa_4/environment/bootstrap.sh b/tasks/0039_729_39729863_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_729_39729863_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_729_39729863_qa_4/environment/pull_bucket.py b/tasks/0039_729_39729863_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_729_39729863_qa_4/environment/pull_bucket.py +++ b/tasks/0039_729_39729863_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_729_39729863_qa_4/task.toml b/tasks/0039_729_39729863_qa_4/task.toml index c1998e35f22429451f694038e795861539d41328..22b538aa07cfacf3701bc682d794563d4324aa1b 100644 --- a/tasks/0039_729_39729863_qa_4/task.toml +++ b/tasks/0039_729_39729863_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_729_39729863_qa_5/environment/bootstrap.sh b/tasks/0039_729_39729863_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_729_39729863_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_729_39729863_qa_5/environment/pull_bucket.py b/tasks/0039_729_39729863_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_729_39729863_qa_5/environment/pull_bucket.py +++ b/tasks/0039_729_39729863_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_729_39729863_qa_5/task.toml b/tasks/0039_729_39729863_qa_5/task.toml index cc93cccfecadf801dab51adc4b73419a5e8dad0d..ae8a02dff7b7ccb90efa44e7965ee4ce3dc2fc9d 100644 --- a/tasks/0039_729_39729863_qa_5/task.toml +++ b/tasks/0039_729_39729863_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_741_39741233_qa_5/environment/bootstrap.sh b/tasks/0039_741_39741233_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_741_39741233_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_741_39741233_qa_5/environment/pull_bucket.py b/tasks/0039_741_39741233_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_741_39741233_qa_5/environment/pull_bucket.py +++ b/tasks/0039_741_39741233_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_741_39741233_qa_5/task.toml b/tasks/0039_741_39741233_qa_5/task.toml index d4db1c5918b41bc66d8252c812081fde9b457043..1554f16f05e4d340d77ee3429d9ae929d4140f55 100644 --- a/tasks/0039_741_39741233_qa_5/task.toml +++ b/tasks/0039_741_39741233_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_742_39742099_qa_4/environment/bootstrap.sh b/tasks/0039_742_39742099_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_742_39742099_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_742_39742099_qa_4/environment/pull_bucket.py b/tasks/0039_742_39742099_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_742_39742099_qa_4/environment/pull_bucket.py +++ b/tasks/0039_742_39742099_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_742_39742099_qa_4/task.toml b/tasks/0039_742_39742099_qa_4/task.toml index 03ee8e9eb97c0b70dce33a54fd6606ff38c387c9..289395b23caf73ff1043efe9a8792303f29deb34 100644 --- a/tasks/0039_742_39742099_qa_4/task.toml +++ b/tasks/0039_742_39742099_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_742_39742099_qa_5/environment/bootstrap.sh b/tasks/0039_742_39742099_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_742_39742099_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_742_39742099_qa_5/environment/pull_bucket.py b/tasks/0039_742_39742099_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_742_39742099_qa_5/environment/pull_bucket.py +++ b/tasks/0039_742_39742099_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_742_39742099_qa_5/task.toml b/tasks/0039_742_39742099_qa_5/task.toml index 86a7ba732b4503a1f379509747c356a738438777..9e85ebc8ad67331312c4d6d13736fa2b5df6160f 100644 --- a/tasks/0039_742_39742099_qa_5/task.toml +++ b/tasks/0039_742_39742099_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_768_39768515_qa_1/environment/bootstrap.sh b/tasks/0039_768_39768515_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_768_39768515_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_768_39768515_qa_1/environment/pull_bucket.py b/tasks/0039_768_39768515_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_768_39768515_qa_1/environment/pull_bucket.py +++ b/tasks/0039_768_39768515_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_768_39768515_qa_1/task.toml b/tasks/0039_768_39768515_qa_1/task.toml index e5e9bfeb451365e258f6495aa8e9af1997f87d8c..329e0b132b2b02788c75467b08f3161b22624722 100644 --- a/tasks/0039_768_39768515_qa_1/task.toml +++ b/tasks/0039_768_39768515_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_769_39769016_qa_3/environment/bootstrap.sh b/tasks/0039_769_39769016_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_769_39769016_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_769_39769016_qa_3/environment/pull_bucket.py b/tasks/0039_769_39769016_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_769_39769016_qa_3/environment/pull_bucket.py +++ b/tasks/0039_769_39769016_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_769_39769016_qa_3/task.toml b/tasks/0039_769_39769016_qa_3/task.toml index 07301a8d315ccfe1bc0ed7baae8823e164d0229b..ce472fe005ea05a8cf0e9d987a3b83f5d5aae06c 100644 --- a/tasks/0039_769_39769016_qa_3/task.toml +++ b/tasks/0039_769_39769016_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_782_39782405_qa_2/environment/bootstrap.sh b/tasks/0039_782_39782405_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_782_39782405_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_782_39782405_qa_2/environment/pull_bucket.py b/tasks/0039_782_39782405_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_782_39782405_qa_2/environment/pull_bucket.py +++ b/tasks/0039_782_39782405_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_782_39782405_qa_2/task.toml b/tasks/0039_782_39782405_qa_2/task.toml index 4087ffa53f83a647065540c43c8f43aeb0c57e26..42b6b75fc7fdbade3c5ef9a2d9f66ad4bd884c9e 100644 --- a/tasks/0039_782_39782405_qa_2/task.toml +++ b/tasks/0039_782_39782405_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_785_39785108_qa_1/environment/bootstrap.sh b/tasks/0039_785_39785108_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_785_39785108_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_785_39785108_qa_1/environment/pull_bucket.py b/tasks/0039_785_39785108_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_785_39785108_qa_1/environment/pull_bucket.py +++ b/tasks/0039_785_39785108_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_785_39785108_qa_1/task.toml b/tasks/0039_785_39785108_qa_1/task.toml index 44ff6deac951219f7ca060512d94b56db260a8a7..407dd2c907323095069cacdfc62f5b3fcd06ca5a 100644 --- a/tasks/0039_785_39785108_qa_1/task.toml +++ b/tasks/0039_785_39785108_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_794_39794889_qa_1/environment/bootstrap.sh b/tasks/0039_794_39794889_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_794_39794889_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_794_39794889_qa_1/environment/pull_bucket.py b/tasks/0039_794_39794889_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_794_39794889_qa_1/environment/pull_bucket.py +++ b/tasks/0039_794_39794889_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_794_39794889_qa_1/task.toml b/tasks/0039_794_39794889_qa_1/task.toml index 8de9535351c46437e6fe5f64a12cd7dab7fd4908..936f5b8a08109dfb2b7a952ed5034520ed2bcd0d 100644 --- a/tasks/0039_794_39794889_qa_1/task.toml +++ b/tasks/0039_794_39794889_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_794_39794889_qa_3/environment/bootstrap.sh b/tasks/0039_794_39794889_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_794_39794889_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_794_39794889_qa_3/environment/pull_bucket.py b/tasks/0039_794_39794889_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_794_39794889_qa_3/environment/pull_bucket.py +++ b/tasks/0039_794_39794889_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_794_39794889_qa_3/task.toml b/tasks/0039_794_39794889_qa_3/task.toml index 60e71815edca8c98ae41fbefc520cfbf89a86b61..b44d559bdfe993a90f066f19d74c1bb9e314612f 100644 --- a/tasks/0039_794_39794889_qa_3/task.toml +++ b/tasks/0039_794_39794889_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_810_39810401_qa_1/environment/bootstrap.sh b/tasks/0039_810_39810401_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_810_39810401_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_810_39810401_qa_1/environment/pull_bucket.py b/tasks/0039_810_39810401_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_810_39810401_qa_1/environment/pull_bucket.py +++ b/tasks/0039_810_39810401_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_810_39810401_qa_1/task.toml b/tasks/0039_810_39810401_qa_1/task.toml index d84ac022cb28247f9759ad9df3a0209c8c2b1855..808a3b4fb44308d12547aabd05c9617dfd4d12d4 100644 --- a/tasks/0039_810_39810401_qa_1/task.toml +++ b/tasks/0039_810_39810401_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_810_39810401_qa_2/environment/bootstrap.sh b/tasks/0039_810_39810401_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_810_39810401_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_810_39810401_qa_2/environment/pull_bucket.py b/tasks/0039_810_39810401_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_810_39810401_qa_2/environment/pull_bucket.py +++ b/tasks/0039_810_39810401_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_810_39810401_qa_2/task.toml b/tasks/0039_810_39810401_qa_2/task.toml index 408402214f57b54a4af8198529d8eac4d48a0d5a..27cdf00bab181dbf197b5c4ae61e6274031cb39d 100644 --- a/tasks/0039_810_39810401_qa_2/task.toml +++ b/tasks/0039_810_39810401_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_810_39810505_qa_1/environment/bootstrap.sh b/tasks/0039_810_39810505_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_810_39810505_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_810_39810505_qa_1/environment/pull_bucket.py b/tasks/0039_810_39810505_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_810_39810505_qa_1/environment/pull_bucket.py +++ b/tasks/0039_810_39810505_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_810_39810505_qa_1/task.toml b/tasks/0039_810_39810505_qa_1/task.toml index 374011e42fabb12f6e3e2ce5866a38017c6489f5..d97a3cec9918f6fb79516e4a9a81719d7abbe128 100644 --- a/tasks/0039_810_39810505_qa_1/task.toml +++ b/tasks/0039_810_39810505_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_815_39815076_qa_3/environment/bootstrap.sh b/tasks/0039_815_39815076_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_815_39815076_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_815_39815076_qa_3/environment/pull_bucket.py b/tasks/0039_815_39815076_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_815_39815076_qa_3/environment/pull_bucket.py +++ b/tasks/0039_815_39815076_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_815_39815076_qa_3/task.toml b/tasks/0039_815_39815076_qa_3/task.toml index 54cf83a441cfda8523d2b4dc8513d12ae6ab81b8..193914465ead438e57d3d108f95530346c106e67 100644 --- a/tasks/0039_815_39815076_qa_3/task.toml +++ b/tasks/0039_815_39815076_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_818_39818487_qa_1/environment/bootstrap.sh b/tasks/0039_818_39818487_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_818_39818487_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_818_39818487_qa_1/environment/pull_bucket.py b/tasks/0039_818_39818487_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_818_39818487_qa_1/environment/pull_bucket.py +++ b/tasks/0039_818_39818487_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_818_39818487_qa_1/task.toml b/tasks/0039_818_39818487_qa_1/task.toml index 0525a0b461e69bd60ae9954c17d531a19a2312a3..57e71adf0458439b2db6047709b7bd7ad368d0b8 100644 --- a/tasks/0039_818_39818487_qa_1/task.toml +++ b/tasks/0039_818_39818487_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_818_39818487_qa_3/environment/bootstrap.sh b/tasks/0039_818_39818487_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_818_39818487_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_818_39818487_qa_3/environment/pull_bucket.py b/tasks/0039_818_39818487_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_818_39818487_qa_3/environment/pull_bucket.py +++ b/tasks/0039_818_39818487_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_818_39818487_qa_3/task.toml b/tasks/0039_818_39818487_qa_3/task.toml index a75a03d5bef4714a6e0877f1d7fb5c11ecd72c21..f1ac52ed7d352736fee7b9f3d677756daf311d46 100644 --- a/tasks/0039_818_39818487_qa_3/task.toml +++ b/tasks/0039_818_39818487_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_839_39839532_qa_1/environment/bootstrap.sh b/tasks/0039_839_39839532_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_839_39839532_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_839_39839532_qa_1/environment/pull_bucket.py b/tasks/0039_839_39839532_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_839_39839532_qa_1/environment/pull_bucket.py +++ b/tasks/0039_839_39839532_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_839_39839532_qa_1/task.toml b/tasks/0039_839_39839532_qa_1/task.toml index d109496e9b42af542cac7a94fa0290726b198e07..d817c05677767c9a0c5e14cf13c16ca553f88f02 100644 --- a/tasks/0039_839_39839532_qa_1/task.toml +++ b/tasks/0039_839_39839532_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_839_39839532_qa_2/environment/bootstrap.sh b/tasks/0039_839_39839532_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_839_39839532_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_839_39839532_qa_2/environment/pull_bucket.py b/tasks/0039_839_39839532_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_839_39839532_qa_2/environment/pull_bucket.py +++ b/tasks/0039_839_39839532_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_839_39839532_qa_2/task.toml b/tasks/0039_839_39839532_qa_2/task.toml index 2de1b29a718ad63152be02f1d78cc8656da19d1d..d9f33552d3b07516747be3c8b67d9170bc373f98 100644 --- a/tasks/0039_839_39839532_qa_2/task.toml +++ b/tasks/0039_839_39839532_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_839_39839532_qa_5/environment/bootstrap.sh b/tasks/0039_839_39839532_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_839_39839532_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_839_39839532_qa_5/environment/pull_bucket.py b/tasks/0039_839_39839532_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_839_39839532_qa_5/environment/pull_bucket.py +++ b/tasks/0039_839_39839532_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_839_39839532_qa_5/task.toml b/tasks/0039_839_39839532_qa_5/task.toml index a925f01bea00c593a03e9e3ee8f08a82930f09ef..030edd2e4a17dbc1ff790fadcabbee4a62f6f7c4 100644 --- a/tasks/0039_839_39839532_qa_5/task.toml +++ b/tasks/0039_839_39839532_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_850_39850014_qa_2/environment/bootstrap.sh b/tasks/0039_850_39850014_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_850_39850014_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_850_39850014_qa_2/environment/pull_bucket.py b/tasks/0039_850_39850014_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_850_39850014_qa_2/environment/pull_bucket.py +++ b/tasks/0039_850_39850014_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_850_39850014_qa_2/task.toml b/tasks/0039_850_39850014_qa_2/task.toml index 5ab5d6d5ece245574b190c61b16f437c54e2bd91..3de1e1f534df849c7521203d57007f6f1ef42c4a 100644 --- a/tasks/0039_850_39850014_qa_2/task.toml +++ b/tasks/0039_850_39850014_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_850_39850014_qa_3/environment/bootstrap.sh b/tasks/0039_850_39850014_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_850_39850014_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_850_39850014_qa_3/environment/pull_bucket.py b/tasks/0039_850_39850014_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_850_39850014_qa_3/environment/pull_bucket.py +++ b/tasks/0039_850_39850014_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_850_39850014_qa_3/task.toml b/tasks/0039_850_39850014_qa_3/task.toml index 5e5ce621559895e855dc05a2f22408916a975f44..c970726ac6b89ffde5381eca8f67d9aaaeb3ac3b 100644 --- a/tasks/0039_850_39850014_qa_3/task.toml +++ b/tasks/0039_850_39850014_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_873_39873778_qa_5/environment/bootstrap.sh b/tasks/0039_873_39873778_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_873_39873778_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_873_39873778_qa_5/environment/pull_bucket.py b/tasks/0039_873_39873778_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_873_39873778_qa_5/environment/pull_bucket.py +++ b/tasks/0039_873_39873778_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_873_39873778_qa_5/task.toml b/tasks/0039_873_39873778_qa_5/task.toml index ca5a3a71190c66961e70b117310f2cec345be7c2..8dc727410037a9f293638f16908df9e33c2ce694 100644 --- a/tasks/0039_873_39873778_qa_5/task.toml +++ b/tasks/0039_873_39873778_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_890_39890497_qa_1/environment/bootstrap.sh b/tasks/0039_890_39890497_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_890_39890497_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_890_39890497_qa_1/environment/pull_bucket.py b/tasks/0039_890_39890497_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_890_39890497_qa_1/environment/pull_bucket.py +++ b/tasks/0039_890_39890497_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_890_39890497_qa_1/task.toml b/tasks/0039_890_39890497_qa_1/task.toml index 056208ce27275fd42e79f3cd5067eaa62aea36c3..aea61888309033e9119d1e8dd83ee06af5148024 100644 --- a/tasks/0039_890_39890497_qa_1/task.toml +++ b/tasks/0039_890_39890497_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_908_39908824_qa_4/environment/bootstrap.sh b/tasks/0039_908_39908824_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_908_39908824_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_908_39908824_qa_4/environment/pull_bucket.py b/tasks/0039_908_39908824_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_908_39908824_qa_4/environment/pull_bucket.py +++ b/tasks/0039_908_39908824_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_908_39908824_qa_4/task.toml b/tasks/0039_908_39908824_qa_4/task.toml index a8bc06d182bbef2e293b44e29638ed950040f350..09bb750e78a8fcac9251565b6ea08f80c300e89e 100644 --- a/tasks/0039_908_39908824_qa_4/task.toml +++ b/tasks/0039_908_39908824_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_963_39963214_qa_3/environment/bootstrap.sh b/tasks/0039_963_39963214_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_963_39963214_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_963_39963214_qa_3/environment/pull_bucket.py b/tasks/0039_963_39963214_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_963_39963214_qa_3/environment/pull_bucket.py +++ b/tasks/0039_963_39963214_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_963_39963214_qa_3/task.toml b/tasks/0039_963_39963214_qa_3/task.toml index e776fdcb0d0f4d6f8b95919ed2fdb119e76c2cf4..099681830b63ec24ac290da09c9fcae207b99ee1 100644 --- a/tasks/0039_963_39963214_qa_3/task.toml +++ b/tasks/0039_963_39963214_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_964_39964259_qa_2/environment/bootstrap.sh b/tasks/0039_964_39964259_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_964_39964259_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_964_39964259_qa_2/environment/pull_bucket.py b/tasks/0039_964_39964259_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_964_39964259_qa_2/environment/pull_bucket.py +++ b/tasks/0039_964_39964259_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_964_39964259_qa_2/task.toml b/tasks/0039_964_39964259_qa_2/task.toml index 833ad306251c8251b291a04e82371557bcdb3890..2d9a0eeae22ada4eaec011214101e388ccce69b4 100644 --- a/tasks/0039_964_39964259_qa_2/task.toml +++ b/tasks/0039_964_39964259_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_968_39968264_qa_1/environment/bootstrap.sh b/tasks/0039_968_39968264_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_968_39968264_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_968_39968264_qa_1/environment/pull_bucket.py b/tasks/0039_968_39968264_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_968_39968264_qa_1/environment/pull_bucket.py +++ b/tasks/0039_968_39968264_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_968_39968264_qa_1/task.toml b/tasks/0039_968_39968264_qa_1/task.toml index 1d75a5770bc2e3e116fe45858604d443cb544751..2f9f62e8a9c8e7051d7270d4fca3e2f3074827c7 100644 --- a/tasks/0039_968_39968264_qa_1/task.toml +++ b/tasks/0039_968_39968264_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0039_968_39968264_qa_3/environment/bootstrap.sh b/tasks/0039_968_39968264_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0039_968_39968264_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0039_968_39968264_qa_3/environment/pull_bucket.py b/tasks/0039_968_39968264_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0039_968_39968264_qa_3/environment/pull_bucket.py +++ b/tasks/0039_968_39968264_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0039_968_39968264_qa_3/task.toml b/tasks/0039_968_39968264_qa_3/task.toml index 1e07b0ced36ce9479253907f37a5fa375b4b4a2f..0c8c12792bba033c6b25305c8a58951614b8093a 100644 --- a/tasks/0039_968_39968264_qa_3/task.toml +++ b/tasks/0039_968_39968264_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_008_40008810_qa_1/environment/bootstrap.sh b/tasks/0040_008_40008810_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_008_40008810_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_008_40008810_qa_1/environment/pull_bucket.py b/tasks/0040_008_40008810_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_008_40008810_qa_1/environment/pull_bucket.py +++ b/tasks/0040_008_40008810_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_008_40008810_qa_1/task.toml b/tasks/0040_008_40008810_qa_1/task.toml index f5c39d2bbf6ad9b5f2af5dcad92ed0cec991a476..c75cf3ab6a2e6071d8dbee48e965665b17bc1a4c 100644 --- a/tasks/0040_008_40008810_qa_1/task.toml +++ b/tasks/0040_008_40008810_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_067_40067366_qa_4/environment/bootstrap.sh b/tasks/0040_067_40067366_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_067_40067366_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_067_40067366_qa_4/environment/pull_bucket.py b/tasks/0040_067_40067366_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_067_40067366_qa_4/environment/pull_bucket.py +++ b/tasks/0040_067_40067366_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_067_40067366_qa_4/task.toml b/tasks/0040_067_40067366_qa_4/task.toml index a84ebe0e3e02d62d4dca6e7caaf59b500c343b85..2260183826372b5be61d2b771b091039c4e1e392 100644 --- a/tasks/0040_067_40067366_qa_4/task.toml +++ b/tasks/0040_067_40067366_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_178_40178940_qa_3/environment/bootstrap.sh b/tasks/0040_178_40178940_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_178_40178940_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_178_40178940_qa_3/environment/pull_bucket.py b/tasks/0040_178_40178940_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_178_40178940_qa_3/environment/pull_bucket.py +++ b/tasks/0040_178_40178940_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_178_40178940_qa_3/task.toml b/tasks/0040_178_40178940_qa_3/task.toml index 933e835b3bd567064f67671528cb63d6de8787fe..604f870157fd125aaf516df32097ca8ad87dcd6e 100644 --- a/tasks/0040_178_40178940_qa_3/task.toml +++ b/tasks/0040_178_40178940_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_178_40178940_qa_4/environment/bootstrap.sh b/tasks/0040_178_40178940_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_178_40178940_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_178_40178940_qa_4/environment/pull_bucket.py b/tasks/0040_178_40178940_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_178_40178940_qa_4/environment/pull_bucket.py +++ b/tasks/0040_178_40178940_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_178_40178940_qa_4/task.toml b/tasks/0040_178_40178940_qa_4/task.toml index 74a2c03ace320948444636b3552940b459c3601c..4187a1e4c2295d1a7afd40e7ccefe6b42cef71b9 100644 --- a/tasks/0040_178_40178940_qa_4/task.toml +++ b/tasks/0040_178_40178940_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_288_40288007_qa_1/environment/bootstrap.sh b/tasks/0040_288_40288007_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_288_40288007_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_288_40288007_qa_1/environment/pull_bucket.py b/tasks/0040_288_40288007_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_288_40288007_qa_1/environment/pull_bucket.py +++ b/tasks/0040_288_40288007_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_288_40288007_qa_1/task.toml b/tasks/0040_288_40288007_qa_1/task.toml index 87bc916f623c441c8952423bae0c7453588c615f..091871745ef9340a12323c4a67dcbd5a49a15205 100644 --- a/tasks/0040_288_40288007_qa_1/task.toml +++ b/tasks/0040_288_40288007_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_288_40288007_qa_3/environment/bootstrap.sh b/tasks/0040_288_40288007_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_288_40288007_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_288_40288007_qa_3/environment/pull_bucket.py b/tasks/0040_288_40288007_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_288_40288007_qa_3/environment/pull_bucket.py +++ b/tasks/0040_288_40288007_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_288_40288007_qa_3/task.toml b/tasks/0040_288_40288007_qa_3/task.toml index 8cd7d2151caeba3ab88f2e21cb8fd75eccf8cc5f..0f5266b8c5afbcfee85f1276fb1041e12084cd48 100644 --- a/tasks/0040_288_40288007_qa_3/task.toml +++ b/tasks/0040_288_40288007_qa_3/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_288_40288007_qa_4/environment/bootstrap.sh b/tasks/0040_288_40288007_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_288_40288007_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_288_40288007_qa_4/environment/pull_bucket.py b/tasks/0040_288_40288007_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_288_40288007_qa_4/environment/pull_bucket.py +++ b/tasks/0040_288_40288007_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_288_40288007_qa_4/task.toml b/tasks/0040_288_40288007_qa_4/task.toml index be0898ae707709ddff53dbb3eb2bdf2af6bd07a6..45d89041e5111eeebb5f3f2e69d7c75d6fe92c5b 100644 --- a/tasks/0040_288_40288007_qa_4/task.toml +++ b/tasks/0040_288_40288007_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_298_40298967_qa_4/environment/bootstrap.sh b/tasks/0040_298_40298967_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_298_40298967_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_298_40298967_qa_4/environment/pull_bucket.py b/tasks/0040_298_40298967_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_298_40298967_qa_4/environment/pull_bucket.py +++ b/tasks/0040_298_40298967_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_298_40298967_qa_4/task.toml b/tasks/0040_298_40298967_qa_4/task.toml index a7ae9b2a9fca929f2b7508a575b5f14a35cb143a..ebe6640b97ac72764fa4b521f44f99d7b8e8a6cc 100644 --- a/tasks/0040_298_40298967_qa_4/task.toml +++ b/tasks/0040_298_40298967_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_298_40298967_qa_5/environment/bootstrap.sh b/tasks/0040_298_40298967_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_298_40298967_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_298_40298967_qa_5/environment/pull_bucket.py b/tasks/0040_298_40298967_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_298_40298967_qa_5/environment/pull_bucket.py +++ b/tasks/0040_298_40298967_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_298_40298967_qa_5/task.toml b/tasks/0040_298_40298967_qa_5/task.toml index e98a4d56a924550afd5cf904a7f35d24eeac0fba..a8b8cd7f1c679c43765a99224c272295dfb47c2b 100644 --- a/tasks/0040_298_40298967_qa_5/task.toml +++ b/tasks/0040_298_40298967_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_340_40340401_qa_2/environment/bootstrap.sh b/tasks/0040_340_40340401_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_340_40340401_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_340_40340401_qa_2/environment/pull_bucket.py b/tasks/0040_340_40340401_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_340_40340401_qa_2/environment/pull_bucket.py +++ b/tasks/0040_340_40340401_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_340_40340401_qa_2/task.toml b/tasks/0040_340_40340401_qa_2/task.toml index fcc9d8473023c5aa31bdd35ffd80f0acd9d00fd3..0ee08b013445c7e1daf6221ebb0112fc8623e3cb 100644 --- a/tasks/0040_340_40340401_qa_2/task.toml +++ b/tasks/0040_340_40340401_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_340_40340401_qa_3/environment/bootstrap.sh b/tasks/0040_340_40340401_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_340_40340401_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_340_40340401_qa_3/environment/pull_bucket.py b/tasks/0040_340_40340401_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_340_40340401_qa_3/environment/pull_bucket.py +++ b/tasks/0040_340_40340401_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_340_40340401_qa_3/task.toml b/tasks/0040_340_40340401_qa_3/task.toml index 034d8e401ff5af917abb9a4be4dca8e5d195244e..4d2f1d7cdb2d758d92cdc731171046a2d017f438 100644 --- a/tasks/0040_340_40340401_qa_3/task.toml +++ b/tasks/0040_340_40340401_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_340_40340401_qa_4/environment/bootstrap.sh b/tasks/0040_340_40340401_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_340_40340401_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_340_40340401_qa_4/environment/pull_bucket.py b/tasks/0040_340_40340401_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_340_40340401_qa_4/environment/pull_bucket.py +++ b/tasks/0040_340_40340401_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_340_40340401_qa_4/task.toml b/tasks/0040_340_40340401_qa_4/task.toml index ccb093689b03833f0577292364dbc19c9fe3cee4..1db9472fa0af0ebde0bd05c56ac9d79ab8d84e07 100644 --- a/tasks/0040_340_40340401_qa_4/task.toml +++ b/tasks/0040_340_40340401_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_418_40418668_qa_4/environment/bootstrap.sh b/tasks/0040_418_40418668_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_418_40418668_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_418_40418668_qa_4/environment/pull_bucket.py b/tasks/0040_418_40418668_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_418_40418668_qa_4/environment/pull_bucket.py +++ b/tasks/0040_418_40418668_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_418_40418668_qa_4/task.toml b/tasks/0040_418_40418668_qa_4/task.toml index cd4aa38e637133ed58e80c99f535f10cfd9e775d..7e0fcd9eb1d4a5667f6f18b98c0b1e8ce84fd145 100644 --- a/tasks/0040_418_40418668_qa_4/task.toml +++ b/tasks/0040_418_40418668_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_418_40418668_qa_5/environment/bootstrap.sh b/tasks/0040_418_40418668_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_418_40418668_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_418_40418668_qa_5/environment/pull_bucket.py b/tasks/0040_418_40418668_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_418_40418668_qa_5/environment/pull_bucket.py +++ b/tasks/0040_418_40418668_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_418_40418668_qa_5/task.toml b/tasks/0040_418_40418668_qa_5/task.toml index b00730b3ae15c55a9e575c4fed4ed6e418e54d71..a1a480317216473a4f5a87b6be8e48564be95d4a 100644 --- a/tasks/0040_418_40418668_qa_5/task.toml +++ b/tasks/0040_418_40418668_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_423_40423274_qa_5/environment/bootstrap.sh b/tasks/0040_423_40423274_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_423_40423274_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_423_40423274_qa_5/environment/pull_bucket.py b/tasks/0040_423_40423274_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_423_40423274_qa_5/environment/pull_bucket.py +++ b/tasks/0040_423_40423274_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_423_40423274_qa_5/task.toml b/tasks/0040_423_40423274_qa_5/task.toml index 7c4ecfabacec0b701cba9a9067355554aa23b941..a37ae2fa2a73baa923366b7a06a5def891f67bba 100644 --- a/tasks/0040_423_40423274_qa_5/task.toml +++ b/tasks/0040_423_40423274_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_528_40528853_qa_4/environment/bootstrap.sh b/tasks/0040_528_40528853_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_528_40528853_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_528_40528853_qa_4/environment/pull_bucket.py b/tasks/0040_528_40528853_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_528_40528853_qa_4/environment/pull_bucket.py +++ b/tasks/0040_528_40528853_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_528_40528853_qa_4/task.toml b/tasks/0040_528_40528853_qa_4/task.toml index fd45a1497de495f829e6f0ff6c6094e59b4a746d..42e26ae4740ef38d784a5ef3b6a7bbb2ac23373d 100644 --- a/tasks/0040_528_40528853_qa_4/task.toml +++ b/tasks/0040_528_40528853_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_543_40543827_qa_1/environment/bootstrap.sh b/tasks/0040_543_40543827_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_543_40543827_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_543_40543827_qa_1/environment/pull_bucket.py b/tasks/0040_543_40543827_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_543_40543827_qa_1/environment/pull_bucket.py +++ b/tasks/0040_543_40543827_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_543_40543827_qa_1/task.toml b/tasks/0040_543_40543827_qa_1/task.toml index ab5e7012a485d771aec53b28df89cdd93a56bd48..8a98ed2b04adc4d7948fa689ddb4acb9227df121 100644 --- a/tasks/0040_543_40543827_qa_1/task.toml +++ b/tasks/0040_543_40543827_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_576_40576526_qa_2/environment/bootstrap.sh b/tasks/0040_576_40576526_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_576_40576526_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_576_40576526_qa_2/environment/pull_bucket.py b/tasks/0040_576_40576526_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_576_40576526_qa_2/environment/pull_bucket.py +++ b/tasks/0040_576_40576526_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_576_40576526_qa_2/task.toml b/tasks/0040_576_40576526_qa_2/task.toml index 5342e9d3fbf6ed3c3876bc39f931cc1a29798e01..9d5a4b7fe9c9e8398e0a90297d72795c7e934aea 100644 --- a/tasks/0040_576_40576526_qa_2/task.toml +++ b/tasks/0040_576_40576526_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_587_40587072_qa_1/environment/bootstrap.sh b/tasks/0040_587_40587072_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_587_40587072_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_587_40587072_qa_1/environment/pull_bucket.py b/tasks/0040_587_40587072_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_587_40587072_qa_1/environment/pull_bucket.py +++ b/tasks/0040_587_40587072_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_587_40587072_qa_1/task.toml b/tasks/0040_587_40587072_qa_1/task.toml index 0bcf51fe8ede552f99679ee3e797b0e1dbf67eff..c23ef01e0e1af1d89cb028811aebd1cf9a6591d9 100644 --- a/tasks/0040_587_40587072_qa_1/task.toml +++ b/tasks/0040_587_40587072_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_604_40604616_qa_1/environment/bootstrap.sh b/tasks/0040_604_40604616_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_604_40604616_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_604_40604616_qa_1/environment/pull_bucket.py b/tasks/0040_604_40604616_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_604_40604616_qa_1/environment/pull_bucket.py +++ b/tasks/0040_604_40604616_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_604_40604616_qa_1/task.toml b/tasks/0040_604_40604616_qa_1/task.toml index 1ab8bc1c6bf64b9e92d263448b3047fc5c236781..a9b203270f0f4df17f97614c81d72d0de6b9b057 100644 --- a/tasks/0040_604_40604616_qa_1/task.toml +++ b/tasks/0040_604_40604616_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_620_40620313_qa_1/environment/bootstrap.sh b/tasks/0040_620_40620313_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_620_40620313_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_620_40620313_qa_1/environment/pull_bucket.py b/tasks/0040_620_40620313_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_620_40620313_qa_1/environment/pull_bucket.py +++ b/tasks/0040_620_40620313_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_620_40620313_qa_1/task.toml b/tasks/0040_620_40620313_qa_1/task.toml index 5ec3254b8eb8e987873f4927b6ea6f569270b058..ef23b0754da84428793ffb26646b95e4547c792c 100644 --- a/tasks/0040_620_40620313_qa_1/task.toml +++ b/tasks/0040_620_40620313_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_620_40620313_qa_3/environment/bootstrap.sh b/tasks/0040_620_40620313_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_620_40620313_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_620_40620313_qa_3/environment/pull_bucket.py b/tasks/0040_620_40620313_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_620_40620313_qa_3/environment/pull_bucket.py +++ b/tasks/0040_620_40620313_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_620_40620313_qa_3/task.toml b/tasks/0040_620_40620313_qa_3/task.toml index 1af67c6ebe147373487585ca2be99db9705e6866..194900ac0e2b2fa75d8b84f4569d64c276f94a2f 100644 --- a/tasks/0040_620_40620313_qa_3/task.toml +++ b/tasks/0040_620_40620313_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_620_40620313_qa_5/environment/bootstrap.sh b/tasks/0040_620_40620313_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_620_40620313_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_620_40620313_qa_5/environment/pull_bucket.py b/tasks/0040_620_40620313_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_620_40620313_qa_5/environment/pull_bucket.py +++ b/tasks/0040_620_40620313_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_620_40620313_qa_5/task.toml b/tasks/0040_620_40620313_qa_5/task.toml index fadf51a3cd173b6ffebbfae09f28e557c83c449b..ba9abdb647b05089273e03b1a622fefecc1011be 100644 --- a/tasks/0040_620_40620313_qa_5/task.toml +++ b/tasks/0040_620_40620313_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_627_40627093_qa_1/environment/bootstrap.sh b/tasks/0040_627_40627093_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_627_40627093_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_627_40627093_qa_1/environment/pull_bucket.py b/tasks/0040_627_40627093_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_627_40627093_qa_1/environment/pull_bucket.py +++ b/tasks/0040_627_40627093_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_627_40627093_qa_1/task.toml b/tasks/0040_627_40627093_qa_1/task.toml index 47ca8cc3447ecd60c36fce4d5fbac878879d302a..44fbd16dfd1d0571e9a5dab4581cf502fafe70e8 100644 --- a/tasks/0040_627_40627093_qa_1/task.toml +++ b/tasks/0040_627_40627093_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_627_40627093_qa_4/environment/bootstrap.sh b/tasks/0040_627_40627093_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_627_40627093_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_627_40627093_qa_4/environment/pull_bucket.py b/tasks/0040_627_40627093_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_627_40627093_qa_4/environment/pull_bucket.py +++ b/tasks/0040_627_40627093_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_627_40627093_qa_4/task.toml b/tasks/0040_627_40627093_qa_4/task.toml index bbda4e5f8de74bd590a9bd2e4bc9f5486e0fcab8..d85be8f3fb584e50124fb66438583006388118b4 100644 --- a/tasks/0040_627_40627093_qa_4/task.toml +++ b/tasks/0040_627_40627093_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_644_40644570_qa_1/environment/bootstrap.sh b/tasks/0040_644_40644570_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_644_40644570_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_644_40644570_qa_1/environment/pull_bucket.py b/tasks/0040_644_40644570_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_644_40644570_qa_1/environment/pull_bucket.py +++ b/tasks/0040_644_40644570_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_644_40644570_qa_1/task.toml b/tasks/0040_644_40644570_qa_1/task.toml index b91af78de82bdca227f6800136b87f9c958f8c71..86f20c0ccd6faeb4a19c8ec61daf98f6973bb5e2 100644 --- a/tasks/0040_644_40644570_qa_1/task.toml +++ b/tasks/0040_644_40644570_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_673_40673055_qa_1/environment/bootstrap.sh b/tasks/0040_673_40673055_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_673_40673055_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_673_40673055_qa_1/environment/pull_bucket.py b/tasks/0040_673_40673055_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_673_40673055_qa_1/environment/pull_bucket.py +++ b/tasks/0040_673_40673055_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_673_40673055_qa_1/task.toml b/tasks/0040_673_40673055_qa_1/task.toml index 01cf72ce8fad9dc6b848517ddf3ef470ef34d9a7..9c1171965f438eeae9ea5fa3fed0be1e491b669a 100644 --- a/tasks/0040_673_40673055_qa_1/task.toml +++ b/tasks/0040_673_40673055_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_673_40673055_qa_4/environment/bootstrap.sh b/tasks/0040_673_40673055_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_673_40673055_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_673_40673055_qa_4/environment/pull_bucket.py b/tasks/0040_673_40673055_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_673_40673055_qa_4/environment/pull_bucket.py +++ b/tasks/0040_673_40673055_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_673_40673055_qa_4/task.toml b/tasks/0040_673_40673055_qa_4/task.toml index 9f2156c98383adb1c6c9327f52ba558996f9ce72..af1fd321ecc7df037c7922aa12377442057cccbe 100644 --- a/tasks/0040_673_40673055_qa_4/task.toml +++ b/tasks/0040_673_40673055_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_713_40713386_qa_2/environment/bootstrap.sh b/tasks/0040_713_40713386_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_713_40713386_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_713_40713386_qa_2/environment/pull_bucket.py b/tasks/0040_713_40713386_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_713_40713386_qa_2/environment/pull_bucket.py +++ b/tasks/0040_713_40713386_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_713_40713386_qa_2/task.toml b/tasks/0040_713_40713386_qa_2/task.toml index 7d53b56df64b05a77fccb85da6e837660c34e7ab..3c2851ef36c841d5b093054ae83049fdc2fe7f43 100644 --- a/tasks/0040_713_40713386_qa_2/task.toml +++ b/tasks/0040_713_40713386_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_713_40713386_qa_3/environment/bootstrap.sh b/tasks/0040_713_40713386_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_713_40713386_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_713_40713386_qa_3/environment/pull_bucket.py b/tasks/0040_713_40713386_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_713_40713386_qa_3/environment/pull_bucket.py +++ b/tasks/0040_713_40713386_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_713_40713386_qa_3/task.toml b/tasks/0040_713_40713386_qa_3/task.toml index 2476bbd0fb516570ee606f7a78d472c4a9d97973..8e18320ddc2d0f002e379a51f4bfd3fdc57d5173 100644 --- a/tasks/0040_713_40713386_qa_3/task.toml +++ b/tasks/0040_713_40713386_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_717_40717045_qa_2/environment/bootstrap.sh b/tasks/0040_717_40717045_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_717_40717045_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_717_40717045_qa_2/environment/pull_bucket.py b/tasks/0040_717_40717045_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_717_40717045_qa_2/environment/pull_bucket.py +++ b/tasks/0040_717_40717045_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_717_40717045_qa_2/task.toml b/tasks/0040_717_40717045_qa_2/task.toml index 5bbba5f7ad8e7acd297186195080ce62c93fc34c..0c6135d7f91732ebdb150dc877b0e5673cea0559 100644 --- a/tasks/0040_717_40717045_qa_2/task.toml +++ b/tasks/0040_717_40717045_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_736_40736477_qa_1/environment/bootstrap.sh b/tasks/0040_736_40736477_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_736_40736477_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_736_40736477_qa_1/environment/pull_bucket.py b/tasks/0040_736_40736477_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_736_40736477_qa_1/environment/pull_bucket.py +++ b/tasks/0040_736_40736477_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_736_40736477_qa_1/task.toml b/tasks/0040_736_40736477_qa_1/task.toml index a2ae44e324206c60e719bd09cf5aaa54744608e8..2a0d0499a834c5deca04f15cd1443964a3aca33b 100644 --- a/tasks/0040_736_40736477_qa_1/task.toml +++ b/tasks/0040_736_40736477_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_736_40736477_qa_3/environment/bootstrap.sh b/tasks/0040_736_40736477_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_736_40736477_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_736_40736477_qa_3/environment/pull_bucket.py b/tasks/0040_736_40736477_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_736_40736477_qa_3/environment/pull_bucket.py +++ b/tasks/0040_736_40736477_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_736_40736477_qa_3/task.toml b/tasks/0040_736_40736477_qa_3/task.toml index 13adaa9d838337537326537ec279431fa8aa2c27..bd0ef08f0ce059b6f5c8e87c9d17092a1b69779c 100644 --- a/tasks/0040_736_40736477_qa_3/task.toml +++ b/tasks/0040_736_40736477_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_738_40738491_qa_1/environment/bootstrap.sh b/tasks/0040_738_40738491_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_738_40738491_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_738_40738491_qa_1/environment/pull_bucket.py b/tasks/0040_738_40738491_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_738_40738491_qa_1/environment/pull_bucket.py +++ b/tasks/0040_738_40738491_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_738_40738491_qa_1/task.toml b/tasks/0040_738_40738491_qa_1/task.toml index 9f80da5763fb658f3157390e939d9bbd5188b321..64fac1ce7a2cf6f5a1d527641b2b2d54de3d4497 100644 --- a/tasks/0040_738_40738491_qa_1/task.toml +++ b/tasks/0040_738_40738491_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_738_40738491_qa_3/environment/bootstrap.sh b/tasks/0040_738_40738491_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_738_40738491_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_738_40738491_qa_3/environment/pull_bucket.py b/tasks/0040_738_40738491_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_738_40738491_qa_3/environment/pull_bucket.py +++ b/tasks/0040_738_40738491_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_738_40738491_qa_3/task.toml b/tasks/0040_738_40738491_qa_3/task.toml index 92d0e76bbf8dc58dea28b9617b7f77bcfe381afc..132134d23e100beaf0338dd99c93936f7eb041e1 100644 --- a/tasks/0040_738_40738491_qa_3/task.toml +++ b/tasks/0040_738_40738491_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_738_40738491_qa_4/environment/bootstrap.sh b/tasks/0040_738_40738491_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_738_40738491_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_738_40738491_qa_4/environment/pull_bucket.py b/tasks/0040_738_40738491_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_738_40738491_qa_4/environment/pull_bucket.py +++ b/tasks/0040_738_40738491_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_738_40738491_qa_4/task.toml b/tasks/0040_738_40738491_qa_4/task.toml index 4b182f8c3a4a21b10ebd6cef629bf415ce284f13..5776f5db1ab2546c49b3ba2ccd9556591a4c7e07 100644 --- a/tasks/0040_738_40738491_qa_4/task.toml +++ b/tasks/0040_738_40738491_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_748_40748661_qa_2/environment/bootstrap.sh b/tasks/0040_748_40748661_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_748_40748661_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_748_40748661_qa_2/environment/pull_bucket.py b/tasks/0040_748_40748661_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_748_40748661_qa_2/environment/pull_bucket.py +++ b/tasks/0040_748_40748661_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_748_40748661_qa_2/task.toml b/tasks/0040_748_40748661_qa_2/task.toml index 0a1a6f100a69a55b604ed6adaafd44ac12d41e50..4220a477e44eca34e960770ea5bb4d6289d24931 100644 --- a/tasks/0040_748_40748661_qa_2/task.toml +++ b/tasks/0040_748_40748661_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_748_40748661_qa_3/environment/bootstrap.sh b/tasks/0040_748_40748661_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_748_40748661_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_748_40748661_qa_3/environment/pull_bucket.py b/tasks/0040_748_40748661_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_748_40748661_qa_3/environment/pull_bucket.py +++ b/tasks/0040_748_40748661_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_748_40748661_qa_3/task.toml b/tasks/0040_748_40748661_qa_3/task.toml index b80a327dc0d430f0591ec195e406978396b3a817..d2f341b856c236054e4b840b5fdb0d3b688ac95d 100644 --- a/tasks/0040_748_40748661_qa_3/task.toml +++ b/tasks/0040_748_40748661_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_748_40748661_qa_4/environment/bootstrap.sh b/tasks/0040_748_40748661_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_748_40748661_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_748_40748661_qa_4/environment/pull_bucket.py b/tasks/0040_748_40748661_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_748_40748661_qa_4/environment/pull_bucket.py +++ b/tasks/0040_748_40748661_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_748_40748661_qa_4/task.toml b/tasks/0040_748_40748661_qa_4/task.toml index 0e3e307f1ee3cceffd2b8c35d959778e059a854d..f93e273160742e391af4b68e3b9e6145d8fc37a4 100644 --- a/tasks/0040_748_40748661_qa_4/task.toml +++ b/tasks/0040_748_40748661_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_756_40756003_qa_2/environment/bootstrap.sh b/tasks/0040_756_40756003_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_756_40756003_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_756_40756003_qa_2/environment/pull_bucket.py b/tasks/0040_756_40756003_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_756_40756003_qa_2/environment/pull_bucket.py +++ b/tasks/0040_756_40756003_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_756_40756003_qa_2/task.toml b/tasks/0040_756_40756003_qa_2/task.toml index 1c45e12aafc259d0a0c729f77a198d199de08af3..be141e54bbae9e6bf23dedc86ff212de19163296 100644 --- a/tasks/0040_756_40756003_qa_2/task.toml +++ b/tasks/0040_756_40756003_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_776_40776095_qa_2/environment/bootstrap.sh b/tasks/0040_776_40776095_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_776_40776095_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_776_40776095_qa_2/environment/pull_bucket.py b/tasks/0040_776_40776095_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_776_40776095_qa_2/environment/pull_bucket.py +++ b/tasks/0040_776_40776095_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_776_40776095_qa_2/task.toml b/tasks/0040_776_40776095_qa_2/task.toml index 7250fb542e95a97c42109e125827244495ec841b..e0ed6e26e7e655bf8bee097641bfe7779ee025ba 100644 --- a/tasks/0040_776_40776095_qa_2/task.toml +++ b/tasks/0040_776_40776095_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_783_40783338_qa_3/environment/bootstrap.sh b/tasks/0040_783_40783338_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_783_40783338_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_783_40783338_qa_3/environment/pull_bucket.py b/tasks/0040_783_40783338_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_783_40783338_qa_3/environment/pull_bucket.py +++ b/tasks/0040_783_40783338_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_783_40783338_qa_3/task.toml b/tasks/0040_783_40783338_qa_3/task.toml index f38a0bfd8a55b671971239f0a0a8ebd03d73db31..7e6bad175385bc7e389444e1d5c63f11e7dde853 100644 --- a/tasks/0040_783_40783338_qa_3/task.toml +++ b/tasks/0040_783_40783338_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_785_40785152_qa_2/environment/bootstrap.sh b/tasks/0040_785_40785152_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_785_40785152_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_785_40785152_qa_2/environment/pull_bucket.py b/tasks/0040_785_40785152_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_785_40785152_qa_2/environment/pull_bucket.py +++ b/tasks/0040_785_40785152_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_785_40785152_qa_2/task.toml b/tasks/0040_785_40785152_qa_2/task.toml index d747d078439e50647f869d18e621774f666cfa77..0a8fc215e9873ad0a57e86998d20db1700042099 100644 --- a/tasks/0040_785_40785152_qa_2/task.toml +++ b/tasks/0040_785_40785152_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_785_40785152_qa_5/environment/bootstrap.sh b/tasks/0040_785_40785152_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_785_40785152_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_785_40785152_qa_5/environment/pull_bucket.py b/tasks/0040_785_40785152_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_785_40785152_qa_5/environment/pull_bucket.py +++ b/tasks/0040_785_40785152_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_785_40785152_qa_5/task.toml b/tasks/0040_785_40785152_qa_5/task.toml index a1235c56a5fc5be2f8a1b80170ec178f3806be64..e58d246cd9f0fbe1802ac55ded2ea1e7e9c5fb94 100644 --- a/tasks/0040_785_40785152_qa_5/task.toml +++ b/tasks/0040_785_40785152_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_788_40788057_qa_3/environment/bootstrap.sh b/tasks/0040_788_40788057_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_788_40788057_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_788_40788057_qa_3/environment/pull_bucket.py b/tasks/0040_788_40788057_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_788_40788057_qa_3/environment/pull_bucket.py +++ b/tasks/0040_788_40788057_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_788_40788057_qa_3/task.toml b/tasks/0040_788_40788057_qa_3/task.toml index 84a1c951626b768595574e63bc5094f6cee2c5e9..3799a7f09c8fa6f7409da2ea68f3151fc8ecc335 100644 --- a/tasks/0040_788_40788057_qa_3/task.toml +++ b/tasks/0040_788_40788057_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_788_40788057_qa_5/environment/bootstrap.sh b/tasks/0040_788_40788057_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_788_40788057_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_788_40788057_qa_5/environment/pull_bucket.py b/tasks/0040_788_40788057_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_788_40788057_qa_5/environment/pull_bucket.py +++ b/tasks/0040_788_40788057_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_788_40788057_qa_5/task.toml b/tasks/0040_788_40788057_qa_5/task.toml index 47d1ed9e9c32b98b1645afc4b2a4fdc297795ebf..91bc750b1fdf857defdefb845f3a81684395080f 100644 --- a/tasks/0040_788_40788057_qa_5/task.toml +++ b/tasks/0040_788_40788057_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_788_40788908_qa_4/environment/bootstrap.sh b/tasks/0040_788_40788908_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_788_40788908_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_788_40788908_qa_4/environment/pull_bucket.py b/tasks/0040_788_40788908_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_788_40788908_qa_4/environment/pull_bucket.py +++ b/tasks/0040_788_40788908_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_788_40788908_qa_4/task.toml b/tasks/0040_788_40788908_qa_4/task.toml index eb138b23f22b6ff4f93788fbfca726c702baa906..16ea39157c1b556303ba0c0de07cbd338a91a801 100644 --- a/tasks/0040_788_40788908_qa_4/task.toml +++ b/tasks/0040_788_40788908_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_789_40789473_qa_3/environment/bootstrap.sh b/tasks/0040_789_40789473_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_789_40789473_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_789_40789473_qa_3/environment/pull_bucket.py b/tasks/0040_789_40789473_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_789_40789473_qa_3/environment/pull_bucket.py +++ b/tasks/0040_789_40789473_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_789_40789473_qa_3/task.toml b/tasks/0040_789_40789473_qa_3/task.toml index a7ad576c539a91de0d2b3c550752fb5900bfa77a..70268482bd32cd32726eba2460e188294684c822 100644 --- a/tasks/0040_789_40789473_qa_3/task.toml +++ b/tasks/0040_789_40789473_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_789_40789473_qa_5/environment/bootstrap.sh b/tasks/0040_789_40789473_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_789_40789473_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_789_40789473_qa_5/environment/pull_bucket.py b/tasks/0040_789_40789473_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_789_40789473_qa_5/environment/pull_bucket.py +++ b/tasks/0040_789_40789473_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_789_40789473_qa_5/task.toml b/tasks/0040_789_40789473_qa_5/task.toml index c947756589495465e46949e897a16bbb743803e6..5d5ecc64ddde7598db2b8bd3c63d88afd9446bc7 100644 --- a/tasks/0040_789_40789473_qa_5/task.toml +++ b/tasks/0040_789_40789473_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_805_40805436_qa_1/environment/bootstrap.sh b/tasks/0040_805_40805436_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_805_40805436_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_805_40805436_qa_1/environment/pull_bucket.py b/tasks/0040_805_40805436_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_805_40805436_qa_1/environment/pull_bucket.py +++ b/tasks/0040_805_40805436_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_805_40805436_qa_1/task.toml b/tasks/0040_805_40805436_qa_1/task.toml index 69c4dec2d08eda4ca80d521d5e1f6021d83477dc..a63d9a9cdf55e1131f617341fe5de8a83fcfc1b3 100644 --- a/tasks/0040_805_40805436_qa_1/task.toml +++ b/tasks/0040_805_40805436_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_808_40808132_qa_5/environment/bootstrap.sh b/tasks/0040_808_40808132_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_808_40808132_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_808_40808132_qa_5/environment/pull_bucket.py b/tasks/0040_808_40808132_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_808_40808132_qa_5/environment/pull_bucket.py +++ b/tasks/0040_808_40808132_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_808_40808132_qa_5/task.toml b/tasks/0040_808_40808132_qa_5/task.toml index ba60555d9f5056a75bece00ce05576003cf938db..98fdd8868f1c5c175526eee882def335079cf6ae 100644 --- a/tasks/0040_808_40808132_qa_5/task.toml +++ b/tasks/0040_808_40808132_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_826_40826860_qa_1/environment/bootstrap.sh b/tasks/0040_826_40826860_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_826_40826860_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_826_40826860_qa_1/environment/pull_bucket.py b/tasks/0040_826_40826860_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_826_40826860_qa_1/environment/pull_bucket.py +++ b/tasks/0040_826_40826860_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_826_40826860_qa_1/task.toml b/tasks/0040_826_40826860_qa_1/task.toml index 170dc8661718903d4500606305e6dfef8972ca4a..eb4986b39f700be3c91f78fd2029eb28bd12ebd2 100644 --- a/tasks/0040_826_40826860_qa_1/task.toml +++ b/tasks/0040_826_40826860_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_826_40826860_qa_2/environment/bootstrap.sh b/tasks/0040_826_40826860_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_826_40826860_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_826_40826860_qa_2/environment/pull_bucket.py b/tasks/0040_826_40826860_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_826_40826860_qa_2/environment/pull_bucket.py +++ b/tasks/0040_826_40826860_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_826_40826860_qa_2/task.toml b/tasks/0040_826_40826860_qa_2/task.toml index 1714c2e04e50ba8e1ce79779f699d608e01bb824..a4bbc9b797b4b4444c22b73335b9f3f2a8236624 100644 --- a/tasks/0040_826_40826860_qa_2/task.toml +++ b/tasks/0040_826_40826860_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_843_40843458_qa_3/environment/bootstrap.sh b/tasks/0040_843_40843458_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_843_40843458_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_843_40843458_qa_3/environment/pull_bucket.py b/tasks/0040_843_40843458_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_843_40843458_qa_3/environment/pull_bucket.py +++ b/tasks/0040_843_40843458_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_843_40843458_qa_3/task.toml b/tasks/0040_843_40843458_qa_3/task.toml index 12f460725296d67c536086284cd555ca454c26d4..be8ae34ce892f4e948415cb5552bf31a0a03a4db 100644 --- a/tasks/0040_843_40843458_qa_3/task.toml +++ b/tasks/0040_843_40843458_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_843_40843458_qa_4/environment/bootstrap.sh b/tasks/0040_843_40843458_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_843_40843458_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_843_40843458_qa_4/environment/pull_bucket.py b/tasks/0040_843_40843458_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_843_40843458_qa_4/environment/pull_bucket.py +++ b/tasks/0040_843_40843458_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_843_40843458_qa_4/task.toml b/tasks/0040_843_40843458_qa_4/task.toml index 246212276469a76f7a9f520181949d56687fc205..395695b7f6beeb03bd89a619e88b42f93f1847ee 100644 --- a/tasks/0040_843_40843458_qa_4/task.toml +++ b/tasks/0040_843_40843458_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_853_40853543_qa_3/environment/bootstrap.sh b/tasks/0040_853_40853543_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_853_40853543_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_853_40853543_qa_3/environment/pull_bucket.py b/tasks/0040_853_40853543_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_853_40853543_qa_3/environment/pull_bucket.py +++ b/tasks/0040_853_40853543_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_853_40853543_qa_3/task.toml b/tasks/0040_853_40853543_qa_3/task.toml index fc3d927908921571d89b92656a96257eebb202fa..534cfb23af9a8075432d7a45fae3e441636c1766 100644 --- a/tasks/0040_853_40853543_qa_3/task.toml +++ b/tasks/0040_853_40853543_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_880_40880494_qa_3/environment/bootstrap.sh b/tasks/0040_880_40880494_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_880_40880494_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_880_40880494_qa_3/environment/pull_bucket.py b/tasks/0040_880_40880494_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_880_40880494_qa_3/environment/pull_bucket.py +++ b/tasks/0040_880_40880494_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_880_40880494_qa_3/task.toml b/tasks/0040_880_40880494_qa_3/task.toml index 452ad8dc8970d1494ed16799e7837fff58557d3d..acbb1a54cc16efb0a6f65a09110fef67c6f56611 100644 --- a/tasks/0040_880_40880494_qa_3/task.toml +++ b/tasks/0040_880_40880494_qa_3/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_896_40896108_qa_3/environment/bootstrap.sh b/tasks/0040_896_40896108_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_896_40896108_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_896_40896108_qa_3/environment/pull_bucket.py b/tasks/0040_896_40896108_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_896_40896108_qa_3/environment/pull_bucket.py +++ b/tasks/0040_896_40896108_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_896_40896108_qa_3/task.toml b/tasks/0040_896_40896108_qa_3/task.toml index de72bcd8ac95bcedc083e0466f2f34318dec581e..e7aadb72489262851c269436edc780157f997dc9 100644 --- a/tasks/0040_896_40896108_qa_3/task.toml +++ b/tasks/0040_896_40896108_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_916_40916847_qa_3/environment/bootstrap.sh b/tasks/0040_916_40916847_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_916_40916847_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_916_40916847_qa_3/environment/pull_bucket.py b/tasks/0040_916_40916847_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_916_40916847_qa_3/environment/pull_bucket.py +++ b/tasks/0040_916_40916847_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_916_40916847_qa_3/task.toml b/tasks/0040_916_40916847_qa_3/task.toml index 1f9b904248a3b36cfb1ed2d8441974e2765691c8..5ceab370034e4e5be323052e95df93cfc86b81bd 100644 --- a/tasks/0040_916_40916847_qa_3/task.toml +++ b/tasks/0040_916_40916847_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_921_40921599_qa_1/environment/bootstrap.sh b/tasks/0040_921_40921599_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_921_40921599_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_921_40921599_qa_1/environment/pull_bucket.py b/tasks/0040_921_40921599_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_921_40921599_qa_1/environment/pull_bucket.py +++ b/tasks/0040_921_40921599_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_921_40921599_qa_1/task.toml b/tasks/0040_921_40921599_qa_1/task.toml index d9beacf2540e0e95861d014f0d76af65f431d69d..37c31ae421742c502b57d4cdf62da96e3b717be9 100644 --- a/tasks/0040_921_40921599_qa_1/task.toml +++ b/tasks/0040_921_40921599_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_929_40929685_qa_2/environment/bootstrap.sh b/tasks/0040_929_40929685_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_929_40929685_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_929_40929685_qa_2/environment/pull_bucket.py b/tasks/0040_929_40929685_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_929_40929685_qa_2/environment/pull_bucket.py +++ b/tasks/0040_929_40929685_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_929_40929685_qa_2/task.toml b/tasks/0040_929_40929685_qa_2/task.toml index 070dc384db4523f8d3629d91d837f2e138cc378f..d4182547b9e055fe7a895d96ab12ed9d012db487 100644 --- a/tasks/0040_929_40929685_qa_2/task.toml +++ b/tasks/0040_929_40929685_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_929_40929691_qa_1/environment/bootstrap.sh b/tasks/0040_929_40929691_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_929_40929691_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_929_40929691_qa_1/environment/pull_bucket.py b/tasks/0040_929_40929691_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_929_40929691_qa_1/environment/pull_bucket.py +++ b/tasks/0040_929_40929691_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_929_40929691_qa_1/task.toml b/tasks/0040_929_40929691_qa_1/task.toml index 86e736386c5a8c9a2306bb0ebb3192f8fc1aaf5b..f1f9647b78af02fd42d3a7cc453ef3797cd6d1bc 100644 --- a/tasks/0040_929_40929691_qa_1/task.toml +++ b/tasks/0040_929_40929691_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_930_40930969_qa_4/environment/bootstrap.sh b/tasks/0040_930_40930969_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_930_40930969_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_930_40930969_qa_4/environment/pull_bucket.py b/tasks/0040_930_40930969_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_930_40930969_qa_4/environment/pull_bucket.py +++ b/tasks/0040_930_40930969_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_930_40930969_qa_4/task.toml b/tasks/0040_930_40930969_qa_4/task.toml index 8c631a5b5b590edb327f5c98f072039c8a6b525f..9c2f535da88477b8355cc1bd51b37d167b80221a 100644 --- a/tasks/0040_930_40930969_qa_4/task.toml +++ b/tasks/0040_930_40930969_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_981_40981860_qa_1/environment/bootstrap.sh b/tasks/0040_981_40981860_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_981_40981860_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_981_40981860_qa_1/environment/pull_bucket.py b/tasks/0040_981_40981860_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_981_40981860_qa_1/environment/pull_bucket.py +++ b/tasks/0040_981_40981860_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_981_40981860_qa_1/task.toml b/tasks/0040_981_40981860_qa_1/task.toml index cf8fc095407d1635ff160f009059d71ca6957248..867cf7369828c7aa31d36c4b7fca2673c1da69f2 100644 --- a/tasks/0040_981_40981860_qa_1/task.toml +++ b/tasks/0040_981_40981860_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_981_40981860_qa_5/environment/bootstrap.sh b/tasks/0040_981_40981860_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_981_40981860_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_981_40981860_qa_5/environment/pull_bucket.py b/tasks/0040_981_40981860_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_981_40981860_qa_5/environment/pull_bucket.py +++ b/tasks/0040_981_40981860_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_981_40981860_qa_5/task.toml b/tasks/0040_981_40981860_qa_5/task.toml index a8b0f0e9f24e92935539e37a462e78b6d44f8432..8dde662f126c872654c032f0418340f644fe0585 100644 --- a/tasks/0040_981_40981860_qa_5/task.toml +++ b/tasks/0040_981_40981860_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_983_40983485_qa_1/environment/bootstrap.sh b/tasks/0040_983_40983485_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_983_40983485_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_983_40983485_qa_1/environment/pull_bucket.py b/tasks/0040_983_40983485_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_983_40983485_qa_1/environment/pull_bucket.py +++ b/tasks/0040_983_40983485_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_983_40983485_qa_1/task.toml b/tasks/0040_983_40983485_qa_1/task.toml index 8e4967c5dc13d72ccc917596d0e1321d4a9d7a8b..f4775bb60a572f7b78fd7bb55e251ac77744161a 100644 --- a/tasks/0040_983_40983485_qa_1/task.toml +++ b/tasks/0040_983_40983485_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0040_983_40983485_qa_4/environment/bootstrap.sh b/tasks/0040_983_40983485_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0040_983_40983485_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0040_983_40983485_qa_4/environment/pull_bucket.py b/tasks/0040_983_40983485_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0040_983_40983485_qa_4/environment/pull_bucket.py +++ b/tasks/0040_983_40983485_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0040_983_40983485_qa_4/task.toml b/tasks/0040_983_40983485_qa_4/task.toml index 528b094c026160e2e755c2d6739c4b61ffdc1247..8c14d6b8f69611bb6e4cc19a4cfb47a2adacf02b 100644 --- a/tasks/0040_983_40983485_qa_4/task.toml +++ b/tasks/0040_983_40983485_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_009_41009075_qa_4/environment/bootstrap.sh b/tasks/0041_009_41009075_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_009_41009075_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_009_41009075_qa_4/environment/pull_bucket.py b/tasks/0041_009_41009075_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_009_41009075_qa_4/environment/pull_bucket.py +++ b/tasks/0041_009_41009075_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_009_41009075_qa_4/task.toml b/tasks/0041_009_41009075_qa_4/task.toml index f10a2612d8cd4135f7ee3b179988ad83f6ec0cf6..4d82e7ccd1e0c0f78308cf89eb8916b6cc5ce9c6 100644 --- a/tasks/0041_009_41009075_qa_4/task.toml +++ b/tasks/0041_009_41009075_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_015_41015677_qa_2/environment/bootstrap.sh b/tasks/0041_015_41015677_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_015_41015677_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_015_41015677_qa_2/environment/pull_bucket.py b/tasks/0041_015_41015677_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_015_41015677_qa_2/environment/pull_bucket.py +++ b/tasks/0041_015_41015677_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_015_41015677_qa_2/task.toml b/tasks/0041_015_41015677_qa_2/task.toml index e72922a5fbe1cfe44baf50b8811c9b2fc540cfe7..aea19a63822ab02c35b34799407f6754c1eb1522 100644 --- a/tasks/0041_015_41015677_qa_2/task.toml +++ b/tasks/0041_015_41015677_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_015_41015677_qa_4/environment/bootstrap.sh b/tasks/0041_015_41015677_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_015_41015677_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_015_41015677_qa_4/environment/pull_bucket.py b/tasks/0041_015_41015677_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_015_41015677_qa_4/environment/pull_bucket.py +++ b/tasks/0041_015_41015677_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_015_41015677_qa_4/task.toml b/tasks/0041_015_41015677_qa_4/task.toml index fa76bf10296f5fe02dac8bcd7cbb42f821b03684..9d33bee42db515206a1e151519c5ec41efc0a83d 100644 --- a/tasks/0041_015_41015677_qa_4/task.toml +++ b/tasks/0041_015_41015677_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_018_41018707_qa_1/environment/bootstrap.sh b/tasks/0041_018_41018707_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_018_41018707_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_018_41018707_qa_1/environment/pull_bucket.py b/tasks/0041_018_41018707_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_018_41018707_qa_1/environment/pull_bucket.py +++ b/tasks/0041_018_41018707_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_018_41018707_qa_1/task.toml b/tasks/0041_018_41018707_qa_1/task.toml index 7a1c1318d97082f6ba285112ac6b996ee12a79df..e76cd6470ae6f3415cb2c06974626d70d3660f69 100644 --- a/tasks/0041_018_41018707_qa_1/task.toml +++ b/tasks/0041_018_41018707_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_018_41018707_qa_4/environment/bootstrap.sh b/tasks/0041_018_41018707_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_018_41018707_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_018_41018707_qa_4/environment/pull_bucket.py b/tasks/0041_018_41018707_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_018_41018707_qa_4/environment/pull_bucket.py +++ b/tasks/0041_018_41018707_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_018_41018707_qa_4/task.toml b/tasks/0041_018_41018707_qa_4/task.toml index a90ce027fa9c0600fb62cf548ca2863e244d2a61..8ed0d65834cfca2cab62a9fbc03cd7b173047333 100644 --- a/tasks/0041_018_41018707_qa_4/task.toml +++ b/tasks/0041_018_41018707_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_020_41020843_qa_1/environment/bootstrap.sh b/tasks/0041_020_41020843_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_020_41020843_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_020_41020843_qa_1/environment/pull_bucket.py b/tasks/0041_020_41020843_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_020_41020843_qa_1/environment/pull_bucket.py +++ b/tasks/0041_020_41020843_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_020_41020843_qa_1/task.toml b/tasks/0041_020_41020843_qa_1/task.toml index b1ee5d134a953a7c85461bde6bbb7addc187f087..0d73c9ff87a00ae1a2be3b5f09dab24b5847523b 100644 --- a/tasks/0041_020_41020843_qa_1/task.toml +++ b/tasks/0041_020_41020843_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_020_41020843_qa_4/environment/bootstrap.sh b/tasks/0041_020_41020843_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_020_41020843_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_020_41020843_qa_4/environment/pull_bucket.py b/tasks/0041_020_41020843_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_020_41020843_qa_4/environment/pull_bucket.py +++ b/tasks/0041_020_41020843_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_020_41020843_qa_4/task.toml b/tasks/0041_020_41020843_qa_4/task.toml index 0d22d73f9115866ff9ff301321fe6b026911a74a..6c8fbaba174d01aa7fb672c1d5c1cf277bffad81 100644 --- a/tasks/0041_020_41020843_qa_4/task.toml +++ b/tasks/0041_020_41020843_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_034_41034683_qa_2/environment/bootstrap.sh b/tasks/0041_034_41034683_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_034_41034683_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_034_41034683_qa_2/environment/pull_bucket.py b/tasks/0041_034_41034683_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_034_41034683_qa_2/environment/pull_bucket.py +++ b/tasks/0041_034_41034683_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_034_41034683_qa_2/task.toml b/tasks/0041_034_41034683_qa_2/task.toml index 4d9f7e5a1e997c700c28a8052f7e223e0f87cca2..4bba573ead8120e78554e7928017bf6c0b3472a6 100644 --- a/tasks/0041_034_41034683_qa_2/task.toml +++ b/tasks/0041_034_41034683_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_035_41035825_qa_1/environment/bootstrap.sh b/tasks/0041_035_41035825_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_035_41035825_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_035_41035825_qa_1/environment/pull_bucket.py b/tasks/0041_035_41035825_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_035_41035825_qa_1/environment/pull_bucket.py +++ b/tasks/0041_035_41035825_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_035_41035825_qa_1/task.toml b/tasks/0041_035_41035825_qa_1/task.toml index 8ee88b9cf523c3fe6007863550058311f742c791..f8d6f24fe12950f94a84b7f3292fef5ebc897a11 100644 --- a/tasks/0041_035_41035825_qa_1/task.toml +++ b/tasks/0041_035_41035825_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_074_41074160_qa_1/environment/bootstrap.sh b/tasks/0041_074_41074160_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_074_41074160_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_074_41074160_qa_1/environment/pull_bucket.py b/tasks/0041_074_41074160_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_074_41074160_qa_1/environment/pull_bucket.py +++ b/tasks/0041_074_41074160_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_074_41074160_qa_1/task.toml b/tasks/0041_074_41074160_qa_1/task.toml index 2104487168b01091ee1246b498388ed10e5f8aeb..6c2dbb5fb57fe285575dfe8af3d6164b62b38ff6 100644 --- a/tasks/0041_074_41074160_qa_1/task.toml +++ b/tasks/0041_074_41074160_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_084_41084912_qa_1/environment/bootstrap.sh b/tasks/0041_084_41084912_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_084_41084912_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_084_41084912_qa_1/environment/pull_bucket.py b/tasks/0041_084_41084912_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_084_41084912_qa_1/environment/pull_bucket.py +++ b/tasks/0041_084_41084912_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_084_41084912_qa_1/task.toml b/tasks/0041_084_41084912_qa_1/task.toml index 677d86ca7d981e456573377b5d29940ac6d2944d..b1c513fbae749410191990a7f800971b189f22b1 100644 --- a/tasks/0041_084_41084912_qa_1/task.toml +++ b/tasks/0041_084_41084912_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_143_41143507_qa_1/environment/bootstrap.sh b/tasks/0041_143_41143507_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_143_41143507_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_143_41143507_qa_1/environment/pull_bucket.py b/tasks/0041_143_41143507_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_143_41143507_qa_1/environment/pull_bucket.py +++ b/tasks/0041_143_41143507_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_143_41143507_qa_1/task.toml b/tasks/0041_143_41143507_qa_1/task.toml index 2e8bbde24e5d31a0ff0a6b4b85c6204eac9a8351..62e813418aad9f4964c90a53108fe7f490feb910 100644 --- a/tasks/0041_143_41143507_qa_1/task.toml +++ b/tasks/0041_143_41143507_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_145_41145764_qa_1/environment/bootstrap.sh b/tasks/0041_145_41145764_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_145_41145764_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_145_41145764_qa_1/environment/pull_bucket.py b/tasks/0041_145_41145764_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_145_41145764_qa_1/environment/pull_bucket.py +++ b/tasks/0041_145_41145764_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_145_41145764_qa_1/task.toml b/tasks/0041_145_41145764_qa_1/task.toml index d6aabad8c852962032914990becf865a12f6ceba..7a7871d1d00c4ab9735a93f3f736b32db89e3c90 100644 --- a/tasks/0041_145_41145764_qa_1/task.toml +++ b/tasks/0041_145_41145764_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_145_41145764_qa_2/environment/bootstrap.sh b/tasks/0041_145_41145764_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_145_41145764_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_145_41145764_qa_2/environment/pull_bucket.py b/tasks/0041_145_41145764_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_145_41145764_qa_2/environment/pull_bucket.py +++ b/tasks/0041_145_41145764_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_145_41145764_qa_2/task.toml b/tasks/0041_145_41145764_qa_2/task.toml index 1da4f230c22f1bbffbb83a8b467f293ae947fb13..225d1242ca63e41db5102293a86fd350c2404f14 100644 --- a/tasks/0041_145_41145764_qa_2/task.toml +++ b/tasks/0041_145_41145764_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_156_41156002_qa_2/environment/bootstrap.sh b/tasks/0041_156_41156002_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_156_41156002_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_156_41156002_qa_2/environment/pull_bucket.py b/tasks/0041_156_41156002_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_156_41156002_qa_2/environment/pull_bucket.py +++ b/tasks/0041_156_41156002_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_156_41156002_qa_2/task.toml b/tasks/0041_156_41156002_qa_2/task.toml index 10906a64d24a8d606db35328b43c07de227e26f7..9ccb5274efaa9cfd4a5047f3fcf7d68b6a619b4a 100644 --- a/tasks/0041_156_41156002_qa_2/task.toml +++ b/tasks/0041_156_41156002_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_156_41156002_qa_4/environment/bootstrap.sh b/tasks/0041_156_41156002_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_156_41156002_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_156_41156002_qa_4/environment/pull_bucket.py b/tasks/0041_156_41156002_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_156_41156002_qa_4/environment/pull_bucket.py +++ b/tasks/0041_156_41156002_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_156_41156002_qa_4/task.toml b/tasks/0041_156_41156002_qa_4/task.toml index 1bd0e35debf7c0395dda9b5da42d6eadde179a02..f48d9a1d531843d1b62752a319078867e604a646 100644 --- a/tasks/0041_156_41156002_qa_4/task.toml +++ b/tasks/0041_156_41156002_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_159_41159247_qa_2/environment/bootstrap.sh b/tasks/0041_159_41159247_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_159_41159247_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_159_41159247_qa_2/environment/pull_bucket.py b/tasks/0041_159_41159247_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_159_41159247_qa_2/environment/pull_bucket.py +++ b/tasks/0041_159_41159247_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_159_41159247_qa_2/task.toml b/tasks/0041_159_41159247_qa_2/task.toml index 07814b878f0acab225eff912d04177ebdc56482e..0b8d3460f287c58030ded5a903375a41260024b4 100644 --- a/tasks/0041_159_41159247_qa_2/task.toml +++ b/tasks/0041_159_41159247_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_172_41172395_qa_3/environment/bootstrap.sh b/tasks/0041_172_41172395_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_172_41172395_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_172_41172395_qa_3/environment/pull_bucket.py b/tasks/0041_172_41172395_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_172_41172395_qa_3/environment/pull_bucket.py +++ b/tasks/0041_172_41172395_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_172_41172395_qa_3/task.toml b/tasks/0041_172_41172395_qa_3/task.toml index 221cdbfbd1592b67c9b5767ce2246dce33d06b7b..bcb8e2153eab6235f86c71d837a8a1d141bbd02c 100644 --- a/tasks/0041_172_41172395_qa_3/task.toml +++ b/tasks/0041_172_41172395_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_186_41186066_qa_2/environment/bootstrap.sh b/tasks/0041_186_41186066_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_186_41186066_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_186_41186066_qa_2/environment/pull_bucket.py b/tasks/0041_186_41186066_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_186_41186066_qa_2/environment/pull_bucket.py +++ b/tasks/0041_186_41186066_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_186_41186066_qa_2/task.toml b/tasks/0041_186_41186066_qa_2/task.toml index 922ba2d75bc20f54121f29f2a55c45083defc5d9..6f2c716fc898ea40351f76ca43206be7cddd452c 100644 --- a/tasks/0041_186_41186066_qa_2/task.toml +++ b/tasks/0041_186_41186066_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_193_41193082_qa_3/environment/bootstrap.sh b/tasks/0041_193_41193082_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_193_41193082_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_193_41193082_qa_3/environment/pull_bucket.py b/tasks/0041_193_41193082_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_193_41193082_qa_3/environment/pull_bucket.py +++ b/tasks/0041_193_41193082_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_193_41193082_qa_3/task.toml b/tasks/0041_193_41193082_qa_3/task.toml index 92d49d00d021337fb4bd054d8bf8b39c778f6ef0..214800b8a57a997c0abdeec48daa313c3cc2393e 100644 --- a/tasks/0041_193_41193082_qa_3/task.toml +++ b/tasks/0041_193_41193082_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_193_41193541_qa_5/environment/bootstrap.sh b/tasks/0041_193_41193541_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_193_41193541_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_193_41193541_qa_5/environment/pull_bucket.py b/tasks/0041_193_41193541_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_193_41193541_qa_5/environment/pull_bucket.py +++ b/tasks/0041_193_41193541_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_193_41193541_qa_5/task.toml b/tasks/0041_193_41193541_qa_5/task.toml index 338f7ef194030c09a6eb76944b52970cd2634d5c..cc34586ba9e55550472711c245ee32ccc214c3fa 100644 --- a/tasks/0041_193_41193541_qa_5/task.toml +++ b/tasks/0041_193_41193541_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_198_41198482_qa_1/environment/bootstrap.sh b/tasks/0041_198_41198482_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_198_41198482_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_198_41198482_qa_1/environment/pull_bucket.py b/tasks/0041_198_41198482_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_198_41198482_qa_1/environment/pull_bucket.py +++ b/tasks/0041_198_41198482_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_198_41198482_qa_1/task.toml b/tasks/0041_198_41198482_qa_1/task.toml index b15d84aaec23e6b14d427bfa7bd4b3b9fce50adc..6a07afe365be8899883ea6875e39d62515540ee7 100644 --- a/tasks/0041_198_41198482_qa_1/task.toml +++ b/tasks/0041_198_41198482_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_214_41214331_qa_1/environment/bootstrap.sh b/tasks/0041_214_41214331_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_214_41214331_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_214_41214331_qa_1/environment/pull_bucket.py b/tasks/0041_214_41214331_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_214_41214331_qa_1/environment/pull_bucket.py +++ b/tasks/0041_214_41214331_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_214_41214331_qa_1/task.toml b/tasks/0041_214_41214331_qa_1/task.toml index b46f24516a1f701e4a04a3cb2d9a0f42cd5112bd..9d552cb4b268f0015366d7399b3fd9ac0fc7c990 100644 --- a/tasks/0041_214_41214331_qa_1/task.toml +++ b/tasks/0041_214_41214331_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_214_41214331_qa_5/environment/bootstrap.sh b/tasks/0041_214_41214331_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_214_41214331_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_214_41214331_qa_5/environment/pull_bucket.py b/tasks/0041_214_41214331_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_214_41214331_qa_5/environment/pull_bucket.py +++ b/tasks/0041_214_41214331_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_214_41214331_qa_5/task.toml b/tasks/0041_214_41214331_qa_5/task.toml index 553bcfb01349900fa7adefb51b561bf071098cd7..0252080069d8b6d2e6ad5cb557204fb3261e9a71 100644 --- a/tasks/0041_214_41214331_qa_5/task.toml +++ b/tasks/0041_214_41214331_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_216_41216352_qa_1/environment/bootstrap.sh b/tasks/0041_216_41216352_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_216_41216352_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_216_41216352_qa_1/environment/pull_bucket.py b/tasks/0041_216_41216352_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_216_41216352_qa_1/environment/pull_bucket.py +++ b/tasks/0041_216_41216352_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_216_41216352_qa_1/task.toml b/tasks/0041_216_41216352_qa_1/task.toml index 96fd708e1178e2c0200948419a8d88e85280df2e..6fd26265baa87b16b99475b1f3bf8c16e562873b 100644 --- a/tasks/0041_216_41216352_qa_1/task.toml +++ b/tasks/0041_216_41216352_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_216_41216352_qa_3/environment/bootstrap.sh b/tasks/0041_216_41216352_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_216_41216352_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_216_41216352_qa_3/environment/pull_bucket.py b/tasks/0041_216_41216352_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_216_41216352_qa_3/environment/pull_bucket.py +++ b/tasks/0041_216_41216352_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_216_41216352_qa_3/task.toml b/tasks/0041_216_41216352_qa_3/task.toml index 7c62d3f0e7f926f05d3be422e33f493820e516b9..c6c3763dccccce28875b7ed68473068145904e1a 100644 --- a/tasks/0041_216_41216352_qa_3/task.toml +++ b/tasks/0041_216_41216352_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_236_41236083_qa_5/environment/bootstrap.sh b/tasks/0041_236_41236083_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_236_41236083_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_236_41236083_qa_5/environment/pull_bucket.py b/tasks/0041_236_41236083_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_236_41236083_qa_5/environment/pull_bucket.py +++ b/tasks/0041_236_41236083_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_236_41236083_qa_5/task.toml b/tasks/0041_236_41236083_qa_5/task.toml index b43e234927aebba312b769d891a14be55c969e9e..98054b6d06d89e2442d4ad448fdf608d820abc19 100644 --- a/tasks/0041_236_41236083_qa_5/task.toml +++ b/tasks/0041_236_41236083_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_236_41236723_qa_3/environment/bootstrap.sh b/tasks/0041_236_41236723_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_236_41236723_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_236_41236723_qa_3/environment/pull_bucket.py b/tasks/0041_236_41236723_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_236_41236723_qa_3/environment/pull_bucket.py +++ b/tasks/0041_236_41236723_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_236_41236723_qa_3/task.toml b/tasks/0041_236_41236723_qa_3/task.toml index d1fad124d0de6ae62c4529bde891a76aec0110ae..a108e86bafbfe55fca4719de01a2dc94b4c074e6 100644 --- a/tasks/0041_236_41236723_qa_3/task.toml +++ b/tasks/0041_236_41236723_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_243_41243008_qa_1/environment/bootstrap.sh b/tasks/0041_243_41243008_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_243_41243008_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_243_41243008_qa_1/environment/pull_bucket.py b/tasks/0041_243_41243008_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_243_41243008_qa_1/environment/pull_bucket.py +++ b/tasks/0041_243_41243008_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_243_41243008_qa_1/task.toml b/tasks/0041_243_41243008_qa_1/task.toml index fa898853af6da454df57e299fcd582cd0af38245..c0e2cbc46da5de40c40bd7fb564352ced201ce86 100644 --- a/tasks/0041_243_41243008_qa_1/task.toml +++ b/tasks/0041_243_41243008_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_243_41243008_qa_3/environment/bootstrap.sh b/tasks/0041_243_41243008_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_243_41243008_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_243_41243008_qa_3/environment/pull_bucket.py b/tasks/0041_243_41243008_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_243_41243008_qa_3/environment/pull_bucket.py +++ b/tasks/0041_243_41243008_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_243_41243008_qa_3/task.toml b/tasks/0041_243_41243008_qa_3/task.toml index 405f8212ec297ce893350881b9a1f964618b54d8..a0219c0b76094c11b2f9b132a07afcb54d4d7ec1 100644 --- a/tasks/0041_243_41243008_qa_3/task.toml +++ b/tasks/0041_243_41243008_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_253_41253749_qa_5/environment/bootstrap.sh b/tasks/0041_253_41253749_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_253_41253749_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_253_41253749_qa_5/environment/pull_bucket.py b/tasks/0041_253_41253749_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_253_41253749_qa_5/environment/pull_bucket.py +++ b/tasks/0041_253_41253749_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_253_41253749_qa_5/task.toml b/tasks/0041_253_41253749_qa_5/task.toml index 8968ce5158da6f867933b62bc75066ca0aeac6f1..6239e6fb60e05e72e9b6b070c0d9b3844acc6ee0 100644 --- a/tasks/0041_253_41253749_qa_5/task.toml +++ b/tasks/0041_253_41253749_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_258_41258552_qa_1/environment/bootstrap.sh b/tasks/0041_258_41258552_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_258_41258552_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_258_41258552_qa_1/environment/pull_bucket.py b/tasks/0041_258_41258552_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_258_41258552_qa_1/environment/pull_bucket.py +++ b/tasks/0041_258_41258552_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_258_41258552_qa_1/task.toml b/tasks/0041_258_41258552_qa_1/task.toml index bd1ca8a69752af152d5eaf5b81e2e8ecafe325fb..eae5e8d47116d3523f0fdfd6fe99da7c33812dd3 100644 --- a/tasks/0041_258_41258552_qa_1/task.toml +++ b/tasks/0041_258_41258552_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_261_41261699_qa_2/environment/bootstrap.sh b/tasks/0041_261_41261699_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_261_41261699_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_261_41261699_qa_2/environment/pull_bucket.py b/tasks/0041_261_41261699_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_261_41261699_qa_2/environment/pull_bucket.py +++ b/tasks/0041_261_41261699_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_261_41261699_qa_2/task.toml b/tasks/0041_261_41261699_qa_2/task.toml index cda41a315a78573b02fde8501359b64c70845737..80df7aa8fc371c6bf66f3eda85d826590c1aa1ec 100644 --- a/tasks/0041_261_41261699_qa_2/task.toml +++ b/tasks/0041_261_41261699_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_268_41268576_qa_1/environment/bootstrap.sh b/tasks/0041_268_41268576_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_268_41268576_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_268_41268576_qa_1/environment/pull_bucket.py b/tasks/0041_268_41268576_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_268_41268576_qa_1/environment/pull_bucket.py +++ b/tasks/0041_268_41268576_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_268_41268576_qa_1/task.toml b/tasks/0041_268_41268576_qa_1/task.toml index c74c9057a8d9cd5697dcea97818d8d2a32d467d1..ebb1628aaa7c23c0d170f763bbefab316ec0a5bd 100644 --- a/tasks/0041_268_41268576_qa_1/task.toml +++ b/tasks/0041_268_41268576_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_314_41314150_qa_1/environment/bootstrap.sh b/tasks/0041_314_41314150_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_314_41314150_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_314_41314150_qa_1/environment/pull_bucket.py b/tasks/0041_314_41314150_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_314_41314150_qa_1/environment/pull_bucket.py +++ b/tasks/0041_314_41314150_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_314_41314150_qa_1/task.toml b/tasks/0041_314_41314150_qa_1/task.toml index 762f7792da0b8e5a80d5a998f713ffe31c5b6b9d..5f8c61fcfee966dffc1b13a863f65aab283f4d5d 100644 --- a/tasks/0041_314_41314150_qa_1/task.toml +++ b/tasks/0041_314_41314150_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_321_41321221_qa_2/environment/bootstrap.sh b/tasks/0041_321_41321221_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_321_41321221_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_321_41321221_qa_2/environment/pull_bucket.py b/tasks/0041_321_41321221_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_321_41321221_qa_2/environment/pull_bucket.py +++ b/tasks/0041_321_41321221_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_321_41321221_qa_2/task.toml b/tasks/0041_321_41321221_qa_2/task.toml index facbd430099821bb5aa3dd7a2a033eec90a1e67f..63c5f23949bb451ebf80ddf4fea028462f65f47d 100644 --- a/tasks/0041_321_41321221_qa_2/task.toml +++ b/tasks/0041_321_41321221_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_321_41321221_qa_3/environment/bootstrap.sh b/tasks/0041_321_41321221_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_321_41321221_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_321_41321221_qa_3/environment/pull_bucket.py b/tasks/0041_321_41321221_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_321_41321221_qa_3/environment/pull_bucket.py +++ b/tasks/0041_321_41321221_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_321_41321221_qa_3/task.toml b/tasks/0041_321_41321221_qa_3/task.toml index 72c7646f3c6227973577fde722d313b1601b1272..655b6f9f0593e2e8badb16942dd8b6b35f5abb91 100644 --- a/tasks/0041_321_41321221_qa_3/task.toml +++ b/tasks/0041_321_41321221_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_321_41321221_qa_4/environment/bootstrap.sh b/tasks/0041_321_41321221_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_321_41321221_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_321_41321221_qa_4/environment/pull_bucket.py b/tasks/0041_321_41321221_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_321_41321221_qa_4/environment/pull_bucket.py +++ b/tasks/0041_321_41321221_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_321_41321221_qa_4/task.toml b/tasks/0041_321_41321221_qa_4/task.toml index c01567e7cafb2e9c03e79f6f4e8b1811b18b6396..660634b5d34ca7f2050794a7c7a8b26cb60dc37f 100644 --- a/tasks/0041_321_41321221_qa_4/task.toml +++ b/tasks/0041_321_41321221_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_323_41323136_qa_2/environment/bootstrap.sh b/tasks/0041_323_41323136_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_323_41323136_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_323_41323136_qa_2/environment/pull_bucket.py b/tasks/0041_323_41323136_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_323_41323136_qa_2/environment/pull_bucket.py +++ b/tasks/0041_323_41323136_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_323_41323136_qa_2/task.toml b/tasks/0041_323_41323136_qa_2/task.toml index bd7ce73069ac53488b40fa3ae6237de29f7366b6..8b1bc6c9ea57cb56c015a25a50c77aa2d98dbef5 100644 --- a/tasks/0041_323_41323136_qa_2/task.toml +++ b/tasks/0041_323_41323136_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_323_41323136_qa_3/environment/bootstrap.sh b/tasks/0041_323_41323136_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_323_41323136_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_323_41323136_qa_3/environment/pull_bucket.py b/tasks/0041_323_41323136_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_323_41323136_qa_3/environment/pull_bucket.py +++ b/tasks/0041_323_41323136_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_323_41323136_qa_3/task.toml b/tasks/0041_323_41323136_qa_3/task.toml index c61081fbabfc3f7435a2a79de3b7b4ca8b6cf105..ca90a11d98f7d19c48e4efa59d27239c8f75519a 100644 --- a/tasks/0041_323_41323136_qa_3/task.toml +++ b/tasks/0041_323_41323136_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_324_41324781_qa_2/environment/bootstrap.sh b/tasks/0041_324_41324781_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_324_41324781_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_324_41324781_qa_2/environment/pull_bucket.py b/tasks/0041_324_41324781_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_324_41324781_qa_2/environment/pull_bucket.py +++ b/tasks/0041_324_41324781_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_324_41324781_qa_2/task.toml b/tasks/0041_324_41324781_qa_2/task.toml index 380a3af5705afc18d74b99f0e62feece84a4d123..9c859b0e086b34659a339857bc0e68863113455d 100644 --- a/tasks/0041_324_41324781_qa_2/task.toml +++ b/tasks/0041_324_41324781_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_421_41421779_qa_5/environment/bootstrap.sh b/tasks/0041_421_41421779_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_421_41421779_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_421_41421779_qa_5/environment/pull_bucket.py b/tasks/0041_421_41421779_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_421_41421779_qa_5/environment/pull_bucket.py +++ b/tasks/0041_421_41421779_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_421_41421779_qa_5/task.toml b/tasks/0041_421_41421779_qa_5/task.toml index 8837ad87cde6103e9b17718f74730f8026cad499..43e48636ae2406699a7bc865701f986f1b13d72c 100644 --- a/tasks/0041_421_41421779_qa_5/task.toml +++ b/tasks/0041_421_41421779_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_451_41451584_qa_1/environment/bootstrap.sh b/tasks/0041_451_41451584_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_451_41451584_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_451_41451584_qa_1/environment/pull_bucket.py b/tasks/0041_451_41451584_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_451_41451584_qa_1/environment/pull_bucket.py +++ b/tasks/0041_451_41451584_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_451_41451584_qa_1/task.toml b/tasks/0041_451_41451584_qa_1/task.toml index 86f06305d1aed2227214674c6459776d7fb36c84..22e4673c4dc31d0fb4bfc3e0508d5d15a3c10261 100644 --- a/tasks/0041_451_41451584_qa_1/task.toml +++ b/tasks/0041_451_41451584_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_451_41451584_qa_5/environment/bootstrap.sh b/tasks/0041_451_41451584_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_451_41451584_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_451_41451584_qa_5/environment/pull_bucket.py b/tasks/0041_451_41451584_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_451_41451584_qa_5/environment/pull_bucket.py +++ b/tasks/0041_451_41451584_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_451_41451584_qa_5/task.toml b/tasks/0041_451_41451584_qa_5/task.toml index fc0785d4c1a63b2a100b8f0a7821f76eda7be5e0..5f0badaf06eb799d273aa75561e07c5b5e2ccb98 100644 --- a/tasks/0041_451_41451584_qa_5/task.toml +++ b/tasks/0041_451_41451584_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_463_41463553_qa_2/environment/bootstrap.sh b/tasks/0041_463_41463553_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_463_41463553_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_463_41463553_qa_2/environment/pull_bucket.py b/tasks/0041_463_41463553_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_463_41463553_qa_2/environment/pull_bucket.py +++ b/tasks/0041_463_41463553_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_463_41463553_qa_2/task.toml b/tasks/0041_463_41463553_qa_2/task.toml index b57a7c346af261a13e98c577f0c9597b8ce2b160..7535d57c851f39967451cd8d254775ee3630a0ef 100644 --- a/tasks/0041_463_41463553_qa_2/task.toml +++ b/tasks/0041_463_41463553_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_501_41501839_qa_5/environment/bootstrap.sh b/tasks/0041_501_41501839_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_501_41501839_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_501_41501839_qa_5/environment/pull_bucket.py b/tasks/0041_501_41501839_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_501_41501839_qa_5/environment/pull_bucket.py +++ b/tasks/0041_501_41501839_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_501_41501839_qa_5/task.toml b/tasks/0041_501_41501839_qa_5/task.toml index fabf6aa58d317794c2927447287d299d04f2993b..2b39b4921b32b49f38a8e676bd25f061e470cb29 100644 --- a/tasks/0041_501_41501839_qa_5/task.toml +++ b/tasks/0041_501_41501839_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_513_41513812_qa_3/environment/bootstrap.sh b/tasks/0041_513_41513812_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_513_41513812_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_513_41513812_qa_3/environment/pull_bucket.py b/tasks/0041_513_41513812_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_513_41513812_qa_3/environment/pull_bucket.py +++ b/tasks/0041_513_41513812_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_513_41513812_qa_3/task.toml b/tasks/0041_513_41513812_qa_3/task.toml index 797dd2614a70cb9cb2e7b704693edbebf7f1c936..c69538444091de7f07db00a5a70bf46e6b97b2a1 100644 --- a/tasks/0041_513_41513812_qa_3/task.toml +++ b/tasks/0041_513_41513812_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_556_41556433_qa_1/environment/bootstrap.sh b/tasks/0041_556_41556433_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_556_41556433_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_556_41556433_qa_1/environment/pull_bucket.py b/tasks/0041_556_41556433_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_556_41556433_qa_1/environment/pull_bucket.py +++ b/tasks/0041_556_41556433_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_556_41556433_qa_1/task.toml b/tasks/0041_556_41556433_qa_1/task.toml index bc4a4e9fcd1b0e622ac716236c040ab75116d0f8..9d96b8ed4ef8e0bf4707920cbe0c8955f73fb559 100644 --- a/tasks/0041_556_41556433_qa_1/task.toml +++ b/tasks/0041_556_41556433_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_560_41560306_qa_2/environment/bootstrap.sh b/tasks/0041_560_41560306_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_560_41560306_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_560_41560306_qa_2/environment/pull_bucket.py b/tasks/0041_560_41560306_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_560_41560306_qa_2/environment/pull_bucket.py +++ b/tasks/0041_560_41560306_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_560_41560306_qa_2/task.toml b/tasks/0041_560_41560306_qa_2/task.toml index 3e98fc36dded0542a686bf40dc7b516a3f693f5c..456a05619217e3d155902ebd4a7fea58214bcb4a 100644 --- a/tasks/0041_560_41560306_qa_2/task.toml +++ b/tasks/0041_560_41560306_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_560_41560306_qa_4/environment/bootstrap.sh b/tasks/0041_560_41560306_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_560_41560306_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_560_41560306_qa_4/environment/pull_bucket.py b/tasks/0041_560_41560306_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_560_41560306_qa_4/environment/pull_bucket.py +++ b/tasks/0041_560_41560306_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_560_41560306_qa_4/task.toml b/tasks/0041_560_41560306_qa_4/task.toml index 121e16a06f31c4e61e407c65008bb4f2a8122aa3..d37fd510e88509d481167e43f1839c26648c1d7f 100644 --- a/tasks/0041_560_41560306_qa_4/task.toml +++ b/tasks/0041_560_41560306_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_571_41571567_qa_1/environment/bootstrap.sh b/tasks/0041_571_41571567_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_571_41571567_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_571_41571567_qa_1/environment/pull_bucket.py b/tasks/0041_571_41571567_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_571_41571567_qa_1/environment/pull_bucket.py +++ b/tasks/0041_571_41571567_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_571_41571567_qa_1/task.toml b/tasks/0041_571_41571567_qa_1/task.toml index 47c3b9f2e3b05903cc036a6a7d985b487f1f5df9..d53d1fa7aacd7d18e353647de030d7cd9cbd0e1a 100644 --- a/tasks/0041_571_41571567_qa_1/task.toml +++ b/tasks/0041_571_41571567_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_571_41571567_qa_4/environment/bootstrap.sh b/tasks/0041_571_41571567_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_571_41571567_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_571_41571567_qa_4/environment/pull_bucket.py b/tasks/0041_571_41571567_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_571_41571567_qa_4/environment/pull_bucket.py +++ b/tasks/0041_571_41571567_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_571_41571567_qa_4/task.toml b/tasks/0041_571_41571567_qa_4/task.toml index 9de5981bde53440a5942e9546e34f0ba2ce7247a..040c3f64eb2a1b99249e9e09cca6da3e09e7b075 100644 --- a/tasks/0041_571_41571567_qa_4/task.toml +++ b/tasks/0041_571_41571567_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_600_41600293_qa_1/environment/bootstrap.sh b/tasks/0041_600_41600293_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_600_41600293_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_600_41600293_qa_1/environment/pull_bucket.py b/tasks/0041_600_41600293_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_600_41600293_qa_1/environment/pull_bucket.py +++ b/tasks/0041_600_41600293_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_600_41600293_qa_1/task.toml b/tasks/0041_600_41600293_qa_1/task.toml index 5f02f896e3c55d840a2354877193c9d0fd236d5a..7a5f0061fddd69851548f868ffa4681cf6e5ebea 100644 --- a/tasks/0041_600_41600293_qa_1/task.toml +++ b/tasks/0041_600_41600293_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_600_41600293_qa_2/environment/bootstrap.sh b/tasks/0041_600_41600293_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_600_41600293_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_600_41600293_qa_2/environment/pull_bucket.py b/tasks/0041_600_41600293_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_600_41600293_qa_2/environment/pull_bucket.py +++ b/tasks/0041_600_41600293_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_600_41600293_qa_2/task.toml b/tasks/0041_600_41600293_qa_2/task.toml index 8216c2429143230bb403e3ec19f6571009e6af80..a62d016b46501f358e9ae65f5ffc5561feedae53 100644 --- a/tasks/0041_600_41600293_qa_2/task.toml +++ b/tasks/0041_600_41600293_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_600_41600293_qa_3/environment/bootstrap.sh b/tasks/0041_600_41600293_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_600_41600293_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_600_41600293_qa_3/environment/pull_bucket.py b/tasks/0041_600_41600293_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_600_41600293_qa_3/environment/pull_bucket.py +++ b/tasks/0041_600_41600293_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_600_41600293_qa_3/task.toml b/tasks/0041_600_41600293_qa_3/task.toml index fc1a35b691c134d1044a1ab328b5805bab0063b6..3ab936bbb24f9e2d062dc0f46af77daf8bfceaa0 100644 --- a/tasks/0041_600_41600293_qa_3/task.toml +++ b/tasks/0041_600_41600293_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_604_41604680_qa_3/environment/bootstrap.sh b/tasks/0041_604_41604680_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_604_41604680_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_604_41604680_qa_3/environment/pull_bucket.py b/tasks/0041_604_41604680_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_604_41604680_qa_3/environment/pull_bucket.py +++ b/tasks/0041_604_41604680_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_604_41604680_qa_3/task.toml b/tasks/0041_604_41604680_qa_3/task.toml index 515422e891c0baedcfe0d9c8b6f41d886976e471..16a4ac5ad7a7e7f5af9867795d3805e4c7a81ec8 100644 --- a/tasks/0041_604_41604680_qa_3/task.toml +++ b/tasks/0041_604_41604680_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_604_41604680_qa_5/environment/bootstrap.sh b/tasks/0041_604_41604680_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_604_41604680_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_604_41604680_qa_5/environment/pull_bucket.py b/tasks/0041_604_41604680_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_604_41604680_qa_5/environment/pull_bucket.py +++ b/tasks/0041_604_41604680_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_604_41604680_qa_5/task.toml b/tasks/0041_604_41604680_qa_5/task.toml index e567b5fd0b532788da29ace61a8fabd15153d955..7eac97e3214ffd726edf5c266634b4dffb6af92d 100644 --- a/tasks/0041_604_41604680_qa_5/task.toml +++ b/tasks/0041_604_41604680_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_604_41604696_qa_3/environment/bootstrap.sh b/tasks/0041_604_41604696_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_604_41604696_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_604_41604696_qa_3/environment/pull_bucket.py b/tasks/0041_604_41604696_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_604_41604696_qa_3/environment/pull_bucket.py +++ b/tasks/0041_604_41604696_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_604_41604696_qa_3/task.toml b/tasks/0041_604_41604696_qa_3/task.toml index 54248c52f511683933638070c90f6dac01eb7ca1..24fb56a0c7ccefe4b1dd3d4038e5b3ee5a671453 100644 --- a/tasks/0041_604_41604696_qa_3/task.toml +++ b/tasks/0041_604_41604696_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_652_41652253_qa_1/environment/bootstrap.sh b/tasks/0041_652_41652253_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_652_41652253_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_652_41652253_qa_1/environment/pull_bucket.py b/tasks/0041_652_41652253_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_652_41652253_qa_1/environment/pull_bucket.py +++ b/tasks/0041_652_41652253_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_652_41652253_qa_1/task.toml b/tasks/0041_652_41652253_qa_1/task.toml index 7167ce740b750d46aa15dd9ba731bc5409244d5f..cd2ced843859537fd3db7f27399709b9380533c6 100644 --- a/tasks/0041_652_41652253_qa_1/task.toml +++ b/tasks/0041_652_41652253_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_658_41658396_qa_4/environment/bootstrap.sh b/tasks/0041_658_41658396_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_658_41658396_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_658_41658396_qa_4/environment/pull_bucket.py b/tasks/0041_658_41658396_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_658_41658396_qa_4/environment/pull_bucket.py +++ b/tasks/0041_658_41658396_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_658_41658396_qa_4/task.toml b/tasks/0041_658_41658396_qa_4/task.toml index ba0a15f92c7acd88c1c3c59f82175ff30127338c..03deee1243fbc0025cb6980d150083e2322254b5 100644 --- a/tasks/0041_658_41658396_qa_4/task.toml +++ b/tasks/0041_658_41658396_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_703_41703265_qa_4/environment/bootstrap.sh b/tasks/0041_703_41703265_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_703_41703265_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_703_41703265_qa_4/environment/pull_bucket.py b/tasks/0041_703_41703265_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_703_41703265_qa_4/environment/pull_bucket.py +++ b/tasks/0041_703_41703265_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_703_41703265_qa_4/task.toml b/tasks/0041_703_41703265_qa_4/task.toml index 3355583806e62f4173a7abf8e11c0a6a9b5ab876..689984365745ccd8ec329a06de96916a3361e6ed 100644 --- a/tasks/0041_703_41703265_qa_4/task.toml +++ b/tasks/0041_703_41703265_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_703_41703265_qa_5/environment/bootstrap.sh b/tasks/0041_703_41703265_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_703_41703265_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_703_41703265_qa_5/environment/pull_bucket.py b/tasks/0041_703_41703265_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_703_41703265_qa_5/environment/pull_bucket.py +++ b/tasks/0041_703_41703265_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_703_41703265_qa_5/task.toml b/tasks/0041_703_41703265_qa_5/task.toml index c0d04264bdbd5b4938290f6c433e29a293d53c2c..9976d4d43a297fd1c941211cfab4c128b9f34ea5 100644 --- a/tasks/0041_703_41703265_qa_5/task.toml +++ b/tasks/0041_703_41703265_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_708_41708867_qa_2/environment/bootstrap.sh b/tasks/0041_708_41708867_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_708_41708867_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_708_41708867_qa_2/environment/pull_bucket.py b/tasks/0041_708_41708867_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_708_41708867_qa_2/environment/pull_bucket.py +++ b/tasks/0041_708_41708867_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_708_41708867_qa_2/task.toml b/tasks/0041_708_41708867_qa_2/task.toml index 8c38aafc835fe0063748c682bf5f39385c415660..b9e10b4753daf21a5da310c3d3ff2d0d19ff1249 100644 --- a/tasks/0041_708_41708867_qa_2/task.toml +++ b/tasks/0041_708_41708867_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_708_41708867_qa_3/environment/bootstrap.sh b/tasks/0041_708_41708867_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_708_41708867_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_708_41708867_qa_3/environment/pull_bucket.py b/tasks/0041_708_41708867_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_708_41708867_qa_3/environment/pull_bucket.py +++ b/tasks/0041_708_41708867_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_708_41708867_qa_3/task.toml b/tasks/0041_708_41708867_qa_3/task.toml index 7718c6e3138282693375f0cd94dadb5f2f175719..71e12cfa4e17cd3f45495a0d662b654c10698f22 100644 --- a/tasks/0041_708_41708867_qa_3/task.toml +++ b/tasks/0041_708_41708867_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_712_41712543_qa_1/environment/bootstrap.sh b/tasks/0041_712_41712543_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_712_41712543_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_712_41712543_qa_1/environment/pull_bucket.py b/tasks/0041_712_41712543_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_712_41712543_qa_1/environment/pull_bucket.py +++ b/tasks/0041_712_41712543_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_712_41712543_qa_1/task.toml b/tasks/0041_712_41712543_qa_1/task.toml index 640c46d0b3909fbbbd46ebde9187d08b5cd1825a..9c993ca91d2d4c50b1e6e32abfb4fc2edfa77301 100644 --- a/tasks/0041_712_41712543_qa_1/task.toml +++ b/tasks/0041_712_41712543_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_712_41712543_qa_2/environment/bootstrap.sh b/tasks/0041_712_41712543_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_712_41712543_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_712_41712543_qa_2/environment/pull_bucket.py b/tasks/0041_712_41712543_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_712_41712543_qa_2/environment/pull_bucket.py +++ b/tasks/0041_712_41712543_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_712_41712543_qa_2/task.toml b/tasks/0041_712_41712543_qa_2/task.toml index ab889e4920db47f277027ce88cb74a1df9649ee3..ef3625cc8de44985a1ad8c0a141ff7a16dd0741b 100644 --- a/tasks/0041_712_41712543_qa_2/task.toml +++ b/tasks/0041_712_41712543_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_714_41714800_qa_3/environment/bootstrap.sh b/tasks/0041_714_41714800_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_714_41714800_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_714_41714800_qa_3/environment/pull_bucket.py b/tasks/0041_714_41714800_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_714_41714800_qa_3/environment/pull_bucket.py +++ b/tasks/0041_714_41714800_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_714_41714800_qa_3/task.toml b/tasks/0041_714_41714800_qa_3/task.toml index 74b3e3745e18963ab2330d3acf24aadb5ff82968..d80b865d15ad7ccd7643fef1075652adada1208e 100644 --- a/tasks/0041_714_41714800_qa_3/task.toml +++ b/tasks/0041_714_41714800_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_758_41758573_qa_1/environment/bootstrap.sh b/tasks/0041_758_41758573_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_758_41758573_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_758_41758573_qa_1/environment/pull_bucket.py b/tasks/0041_758_41758573_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_758_41758573_qa_1/environment/pull_bucket.py +++ b/tasks/0041_758_41758573_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_758_41758573_qa_1/task.toml b/tasks/0041_758_41758573_qa_1/task.toml index 0639cceb19c7d60dc684de24ca2dfaa00980fa00..3c49031c44bae8a16d7dec02c9aff963409796b4 100644 --- a/tasks/0041_758_41758573_qa_1/task.toml +++ b/tasks/0041_758_41758573_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_758_41758573_qa_4/environment/bootstrap.sh b/tasks/0041_758_41758573_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_758_41758573_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_758_41758573_qa_4/environment/pull_bucket.py b/tasks/0041_758_41758573_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_758_41758573_qa_4/environment/pull_bucket.py +++ b/tasks/0041_758_41758573_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_758_41758573_qa_4/task.toml b/tasks/0041_758_41758573_qa_4/task.toml index 2ad00d6591444b9bcfe1377b0d59a9d88984f922..c204d31dbd38eb4fdf9b78c34e0180536d45f2c0 100644 --- a/tasks/0041_758_41758573_qa_4/task.toml +++ b/tasks/0041_758_41758573_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_818_41818748_qa_3/environment/bootstrap.sh b/tasks/0041_818_41818748_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_818_41818748_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_818_41818748_qa_3/environment/pull_bucket.py b/tasks/0041_818_41818748_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_818_41818748_qa_3/environment/pull_bucket.py +++ b/tasks/0041_818_41818748_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_818_41818748_qa_3/task.toml b/tasks/0041_818_41818748_qa_3/task.toml index f39e9c70f7ed13fa00eb0e74cddf93b4de74c1bf..32f434fc431b31933ea2c86f4a0bf9d41531c3fe 100644 --- a/tasks/0041_818_41818748_qa_3/task.toml +++ b/tasks/0041_818_41818748_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_818_41818748_qa_5/environment/bootstrap.sh b/tasks/0041_818_41818748_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_818_41818748_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_818_41818748_qa_5/environment/pull_bucket.py b/tasks/0041_818_41818748_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_818_41818748_qa_5/environment/pull_bucket.py +++ b/tasks/0041_818_41818748_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_818_41818748_qa_5/task.toml b/tasks/0041_818_41818748_qa_5/task.toml index bc6888bdb377346aad1ff793b0ea51fe9c75d1fc..35946731db4f70233247d55d7f2e503c09fb04dc 100644 --- a/tasks/0041_818_41818748_qa_5/task.toml +++ b/tasks/0041_818_41818748_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_838_41838462_qa_1/environment/bootstrap.sh b/tasks/0041_838_41838462_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_838_41838462_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_838_41838462_qa_1/environment/pull_bucket.py b/tasks/0041_838_41838462_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_838_41838462_qa_1/environment/pull_bucket.py +++ b/tasks/0041_838_41838462_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_838_41838462_qa_1/task.toml b/tasks/0041_838_41838462_qa_1/task.toml index 17b2c5acf5b323dc30d7ed94c49c3501de7fc006..63fdffa20c34162d86671e51e95e69da905db9d7 100644 --- a/tasks/0041_838_41838462_qa_1/task.toml +++ b/tasks/0041_838_41838462_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_888_41888820_qa_1/environment/bootstrap.sh b/tasks/0041_888_41888820_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_888_41888820_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_888_41888820_qa_1/environment/pull_bucket.py b/tasks/0041_888_41888820_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_888_41888820_qa_1/environment/pull_bucket.py +++ b/tasks/0041_888_41888820_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_888_41888820_qa_1/task.toml b/tasks/0041_888_41888820_qa_1/task.toml index d913e0533fc000e7133cbcb5df4a711ac74124d1..533b6dd2e3c43d0086e01b494fa9e28ce73a74d2 100644 --- a/tasks/0041_888_41888820_qa_1/task.toml +++ b/tasks/0041_888_41888820_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_888_41888820_qa_2/environment/bootstrap.sh b/tasks/0041_888_41888820_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_888_41888820_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_888_41888820_qa_2/environment/pull_bucket.py b/tasks/0041_888_41888820_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_888_41888820_qa_2/environment/pull_bucket.py +++ b/tasks/0041_888_41888820_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_888_41888820_qa_2/task.toml b/tasks/0041_888_41888820_qa_2/task.toml index 2aa20f80fddb841ab94790fc3e9b369b69759f36..f37c92d70e15899c394ea1f428ff5f921562612d 100644 --- a/tasks/0041_888_41888820_qa_2/task.toml +++ b/tasks/0041_888_41888820_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_914_41914023_qa_3/environment/bootstrap.sh b/tasks/0041_914_41914023_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_914_41914023_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_914_41914023_qa_3/environment/pull_bucket.py b/tasks/0041_914_41914023_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_914_41914023_qa_3/environment/pull_bucket.py +++ b/tasks/0041_914_41914023_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_914_41914023_qa_3/task.toml b/tasks/0041_914_41914023_qa_3/task.toml index 6767c1a886aba3b44e8bd92ff6165fba1d1b16b3..febbbdbba8ba206e346d5093f691608a8d63d950 100644 --- a/tasks/0041_914_41914023_qa_3/task.toml +++ b/tasks/0041_914_41914023_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_914_41914023_qa_5/environment/bootstrap.sh b/tasks/0041_914_41914023_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_914_41914023_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_914_41914023_qa_5/environment/pull_bucket.py b/tasks/0041_914_41914023_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_914_41914023_qa_5/environment/pull_bucket.py +++ b/tasks/0041_914_41914023_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_914_41914023_qa_5/task.toml b/tasks/0041_914_41914023_qa_5/task.toml index dcd34f3733cf49a45c8b2fd1eeab7230ddb13148..ff350808cb4b6c383a960b96a1e361e741b26f48 100644 --- a/tasks/0041_914_41914023_qa_5/task.toml +++ b/tasks/0041_914_41914023_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0041_998_41998385_qa_2/environment/bootstrap.sh b/tasks/0041_998_41998385_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0041_998_41998385_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0041_998_41998385_qa_2/environment/pull_bucket.py b/tasks/0041_998_41998385_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0041_998_41998385_qa_2/environment/pull_bucket.py +++ b/tasks/0041_998_41998385_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0041_998_41998385_qa_2/task.toml b/tasks/0041_998_41998385_qa_2/task.toml index 9cabee30b94e6440830722c6d10ba08584c3b959..95156b0408e66e45b0329f53a4c062907df908ef 100644 --- a/tasks/0041_998_41998385_qa_2/task.toml +++ b/tasks/0041_998_41998385_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_049_42049242_qa_1/environment/bootstrap.sh b/tasks/0042_049_42049242_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_049_42049242_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_049_42049242_qa_1/environment/pull_bucket.py b/tasks/0042_049_42049242_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_049_42049242_qa_1/environment/pull_bucket.py +++ b/tasks/0042_049_42049242_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_049_42049242_qa_1/task.toml b/tasks/0042_049_42049242_qa_1/task.toml index 24f8c645547f516e66b03b5f599f6f584fb438bc..82a2add4f9a6550e72a1eb5f0455307ec8150f31 100644 --- a/tasks/0042_049_42049242_qa_1/task.toml +++ b/tasks/0042_049_42049242_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_102_42102863_qa_1/environment/bootstrap.sh b/tasks/0042_102_42102863_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_102_42102863_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_102_42102863_qa_1/environment/pull_bucket.py b/tasks/0042_102_42102863_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_102_42102863_qa_1/environment/pull_bucket.py +++ b/tasks/0042_102_42102863_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_102_42102863_qa_1/task.toml b/tasks/0042_102_42102863_qa_1/task.toml index a05f149058bbe90fc8fe3d121d1dc8e3e3057d5a..630ac5028d059d645c9a62ee1bf26b9f19af7dae 100644 --- a/tasks/0042_102_42102863_qa_1/task.toml +++ b/tasks/0042_102_42102863_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_102_42102863_qa_4/environment/bootstrap.sh b/tasks/0042_102_42102863_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_102_42102863_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_102_42102863_qa_4/environment/pull_bucket.py b/tasks/0042_102_42102863_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_102_42102863_qa_4/environment/pull_bucket.py +++ b/tasks/0042_102_42102863_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_102_42102863_qa_4/task.toml b/tasks/0042_102_42102863_qa_4/task.toml index 993a4d59cb157542b33fdc1f5431e1dfba042c12..f0ef990e8b72b84e1de33e7351d1b0d88e2b3e29 100644 --- a/tasks/0042_102_42102863_qa_4/task.toml +++ b/tasks/0042_102_42102863_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_106_42106983_qa_5/environment/bootstrap.sh b/tasks/0042_106_42106983_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_106_42106983_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_106_42106983_qa_5/environment/pull_bucket.py b/tasks/0042_106_42106983_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_106_42106983_qa_5/environment/pull_bucket.py +++ b/tasks/0042_106_42106983_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_106_42106983_qa_5/task.toml b/tasks/0042_106_42106983_qa_5/task.toml index 2524c8f794fbb22a4fa6ff31566104133090f85b..9b99fe71598e48e0645ac30c90cbe00235d20c65 100644 --- a/tasks/0042_106_42106983_qa_5/task.toml +++ b/tasks/0042_106_42106983_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_124_42124908_qa_1/environment/bootstrap.sh b/tasks/0042_124_42124908_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_124_42124908_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_124_42124908_qa_1/environment/pull_bucket.py b/tasks/0042_124_42124908_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_124_42124908_qa_1/environment/pull_bucket.py +++ b/tasks/0042_124_42124908_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_124_42124908_qa_1/task.toml b/tasks/0042_124_42124908_qa_1/task.toml index 9a6ffeccd18eb89afdc08726069e8aaa8a893ac0..7de76b92240cad5afa6e037c86d67f0a386b8568 100644 --- a/tasks/0042_124_42124908_qa_1/task.toml +++ b/tasks/0042_124_42124908_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_124_42124908_qa_3/environment/bootstrap.sh b/tasks/0042_124_42124908_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_124_42124908_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_124_42124908_qa_3/environment/pull_bucket.py b/tasks/0042_124_42124908_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_124_42124908_qa_3/environment/pull_bucket.py +++ b/tasks/0042_124_42124908_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_124_42124908_qa_3/task.toml b/tasks/0042_124_42124908_qa_3/task.toml index 2f853fb6ae4b7e4f0d32c5997ccb2d720fb918b9..dfe0b697fdbe7bc6a29110a52c5fe104a8c27a3b 100644 --- a/tasks/0042_124_42124908_qa_3/task.toml +++ b/tasks/0042_124_42124908_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_139_42139358_qa_2/environment/bootstrap.sh b/tasks/0042_139_42139358_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_139_42139358_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_139_42139358_qa_2/environment/pull_bucket.py b/tasks/0042_139_42139358_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_139_42139358_qa_2/environment/pull_bucket.py +++ b/tasks/0042_139_42139358_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_139_42139358_qa_2/task.toml b/tasks/0042_139_42139358_qa_2/task.toml index efea1174a3bbe58707a529258dfe2c34f1bb2147..a7c7e7cf31df9f45aea9503de8c8d03ec0293cee 100644 --- a/tasks/0042_139_42139358_qa_2/task.toml +++ b/tasks/0042_139_42139358_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_170_42170738_qa_2/environment/bootstrap.sh b/tasks/0042_170_42170738_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_170_42170738_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_170_42170738_qa_2/environment/pull_bucket.py b/tasks/0042_170_42170738_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_170_42170738_qa_2/environment/pull_bucket.py +++ b/tasks/0042_170_42170738_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_170_42170738_qa_2/task.toml b/tasks/0042_170_42170738_qa_2/task.toml index 8c215aedd9672083186af0d3a825ae81ea209aba..69e0f24177ec56b9eaf48f0db1ab13fe02b36bbe 100644 --- a/tasks/0042_170_42170738_qa_2/task.toml +++ b/tasks/0042_170_42170738_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_170_42170738_qa_4/environment/bootstrap.sh b/tasks/0042_170_42170738_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_170_42170738_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_170_42170738_qa_4/environment/pull_bucket.py b/tasks/0042_170_42170738_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_170_42170738_qa_4/environment/pull_bucket.py +++ b/tasks/0042_170_42170738_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_170_42170738_qa_4/task.toml b/tasks/0042_170_42170738_qa_4/task.toml index f1a8853f78ebbf71b318c3a5e8dd994ffc1146a0..ba0129cfcd05a30986dcf0c5179d42ec62df1c48 100644 --- a/tasks/0042_170_42170738_qa_4/task.toml +++ b/tasks/0042_170_42170738_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_372_42372757_qa_1/environment/bootstrap.sh b/tasks/0042_372_42372757_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_372_42372757_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_372_42372757_qa_1/environment/pull_bucket.py b/tasks/0042_372_42372757_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_372_42372757_qa_1/environment/pull_bucket.py +++ b/tasks/0042_372_42372757_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_372_42372757_qa_1/task.toml b/tasks/0042_372_42372757_qa_1/task.toml index 4a83b0bc45d741b6e44cd9e656eba710534e2219..3bf94487ea0ba36d6ad8561369f16eb5a9bfe95e 100644 --- a/tasks/0042_372_42372757_qa_1/task.toml +++ b/tasks/0042_372_42372757_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_372_42372757_qa_5/environment/bootstrap.sh b/tasks/0042_372_42372757_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_372_42372757_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_372_42372757_qa_5/environment/pull_bucket.py b/tasks/0042_372_42372757_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_372_42372757_qa_5/environment/pull_bucket.py +++ b/tasks/0042_372_42372757_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_372_42372757_qa_5/task.toml b/tasks/0042_372_42372757_qa_5/task.toml index a33be48865d4ae17527c85a7476fa10fdc285be1..4992b15d974925c0c7f9452dd872426f6421c56b 100644 --- a/tasks/0042_372_42372757_qa_5/task.toml +++ b/tasks/0042_372_42372757_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_378_42378330_qa_5/environment/bootstrap.sh b/tasks/0042_378_42378330_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_378_42378330_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_378_42378330_qa_5/environment/pull_bucket.py b/tasks/0042_378_42378330_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_378_42378330_qa_5/environment/pull_bucket.py +++ b/tasks/0042_378_42378330_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_378_42378330_qa_5/task.toml b/tasks/0042_378_42378330_qa_5/task.toml index 3304eeda38b962dd45c128ed2dd18127573a16a4..c85ebfc879e87040f388efbf3f32389edc5ca43d 100644 --- a/tasks/0042_378_42378330_qa_5/task.toml +++ b/tasks/0042_378_42378330_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_383_42383310_qa_2/environment/bootstrap.sh b/tasks/0042_383_42383310_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_383_42383310_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_383_42383310_qa_2/environment/pull_bucket.py b/tasks/0042_383_42383310_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_383_42383310_qa_2/environment/pull_bucket.py +++ b/tasks/0042_383_42383310_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_383_42383310_qa_2/task.toml b/tasks/0042_383_42383310_qa_2/task.toml index 2489b668efb397927c6232940b9c44215efb0a9b..5e35aa4e54ef111ea582e8a2a6d5dae97058ecf7 100644 --- a/tasks/0042_383_42383310_qa_2/task.toml +++ b/tasks/0042_383_42383310_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_384_42384112_qa_4/environment/bootstrap.sh b/tasks/0042_384_42384112_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_384_42384112_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_384_42384112_qa_4/environment/pull_bucket.py b/tasks/0042_384_42384112_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_384_42384112_qa_4/environment/pull_bucket.py +++ b/tasks/0042_384_42384112_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_384_42384112_qa_4/task.toml b/tasks/0042_384_42384112_qa_4/task.toml index 2a0f2233939710b6575d7ff89695de03a6f9bac6..334a37e35f75acaac366cfcbcdf0898ceb42e37f 100644 --- a/tasks/0042_384_42384112_qa_4/task.toml +++ b/tasks/0042_384_42384112_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_414_42414264_qa_2/environment/bootstrap.sh b/tasks/0042_414_42414264_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_414_42414264_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_414_42414264_qa_2/environment/pull_bucket.py b/tasks/0042_414_42414264_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_414_42414264_qa_2/environment/pull_bucket.py +++ b/tasks/0042_414_42414264_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_414_42414264_qa_2/task.toml b/tasks/0042_414_42414264_qa_2/task.toml index b8e50779bb19306ec42bdf9c87ed1a3595b3abba..32a57bf94b7fec45b880bf996fc7d33773406f65 100644 --- a/tasks/0042_414_42414264_qa_2/task.toml +++ b/tasks/0042_414_42414264_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_446_42446239_qa_1/environment/bootstrap.sh b/tasks/0042_446_42446239_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_446_42446239_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_446_42446239_qa_1/environment/pull_bucket.py b/tasks/0042_446_42446239_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_446_42446239_qa_1/environment/pull_bucket.py +++ b/tasks/0042_446_42446239_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_446_42446239_qa_1/task.toml b/tasks/0042_446_42446239_qa_1/task.toml index 0932cf0f5224fe75a45ed6f749a25129c2800d63..47d99cb1b97e51c47a09e32d084274c42b43d105 100644 --- a/tasks/0042_446_42446239_qa_1/task.toml +++ b/tasks/0042_446_42446239_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_446_42446776_qa_4/environment/bootstrap.sh b/tasks/0042_446_42446776_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_446_42446776_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_446_42446776_qa_4/environment/pull_bucket.py b/tasks/0042_446_42446776_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_446_42446776_qa_4/environment/pull_bucket.py +++ b/tasks/0042_446_42446776_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_446_42446776_qa_4/task.toml b/tasks/0042_446_42446776_qa_4/task.toml index 61b8da51e8241a8c6b5b101b94636aafb59ded80..3c6a011c1e7e9a76575bc5e7e6943fe5deb8b9e2 100644 --- a/tasks/0042_446_42446776_qa_4/task.toml +++ b/tasks/0042_446_42446776_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_446_42446776_qa_5/environment/bootstrap.sh b/tasks/0042_446_42446776_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_446_42446776_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_446_42446776_qa_5/environment/pull_bucket.py b/tasks/0042_446_42446776_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_446_42446776_qa_5/environment/pull_bucket.py +++ b/tasks/0042_446_42446776_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_446_42446776_qa_5/task.toml b/tasks/0042_446_42446776_qa_5/task.toml index 25d17011bc90dcd5bc6a46d9508fdc28530a6b0b..6242fb845fae26c616aae14c3707e47230d3ed9a 100644 --- a/tasks/0042_446_42446776_qa_5/task.toml +++ b/tasks/0042_446_42446776_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_455_42455252_qa_1/environment/bootstrap.sh b/tasks/0042_455_42455252_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_455_42455252_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_455_42455252_qa_1/environment/pull_bucket.py b/tasks/0042_455_42455252_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_455_42455252_qa_1/environment/pull_bucket.py +++ b/tasks/0042_455_42455252_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_455_42455252_qa_1/task.toml b/tasks/0042_455_42455252_qa_1/task.toml index 0eeb2b3b74bfbc14d7b9cb50cd00724df6db5dea..4f3b75c3f5cb801666badc456bd79962788e24b6 100644 --- a/tasks/0042_455_42455252_qa_1/task.toml +++ b/tasks/0042_455_42455252_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_455_42455252_qa_2/environment/bootstrap.sh b/tasks/0042_455_42455252_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_455_42455252_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_455_42455252_qa_2/environment/pull_bucket.py b/tasks/0042_455_42455252_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_455_42455252_qa_2/environment/pull_bucket.py +++ b/tasks/0042_455_42455252_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_455_42455252_qa_2/task.toml b/tasks/0042_455_42455252_qa_2/task.toml index 3b26f1f73d7649d32b6ac6eefb6c71425474de61..3847c2f07beb7ececfb829ffc57e6e7468fdb1c3 100644 --- a/tasks/0042_455_42455252_qa_2/task.toml +++ b/tasks/0042_455_42455252_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_480_42480581_qa_3/environment/bootstrap.sh b/tasks/0042_480_42480581_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_480_42480581_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_480_42480581_qa_3/environment/pull_bucket.py b/tasks/0042_480_42480581_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_480_42480581_qa_3/environment/pull_bucket.py +++ b/tasks/0042_480_42480581_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_480_42480581_qa_3/task.toml b/tasks/0042_480_42480581_qa_3/task.toml index 887598ee3e9eb01205b80c87df5e8e6322e62e3c..8b80981d7cf35998a504a7c8e1152119cbe42f18 100644 --- a/tasks/0042_480_42480581_qa_3/task.toml +++ b/tasks/0042_480_42480581_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_485_42485813_qa_5/environment/bootstrap.sh b/tasks/0042_485_42485813_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_485_42485813_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_485_42485813_qa_5/environment/pull_bucket.py b/tasks/0042_485_42485813_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_485_42485813_qa_5/environment/pull_bucket.py +++ b/tasks/0042_485_42485813_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_485_42485813_qa_5/task.toml b/tasks/0042_485_42485813_qa_5/task.toml index 38ca5d9f828916cf1f699bd763efcfbe5707659d..3b623e3584be8a5dade999e5d4df7439d7f13673 100644 --- a/tasks/0042_485_42485813_qa_5/task.toml +++ b/tasks/0042_485_42485813_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_488_42488023_qa_2/environment/bootstrap.sh b/tasks/0042_488_42488023_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_488_42488023_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_488_42488023_qa_2/environment/pull_bucket.py b/tasks/0042_488_42488023_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_488_42488023_qa_2/environment/pull_bucket.py +++ b/tasks/0042_488_42488023_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_488_42488023_qa_2/task.toml b/tasks/0042_488_42488023_qa_2/task.toml index b4072389dc52a7657dba248824f0404ba6de059f..aae6adc0dd4025391c24297db0ada8ebe6675abb 100644 --- a/tasks/0042_488_42488023_qa_2/task.toml +++ b/tasks/0042_488_42488023_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_488_42488023_qa_4/environment/bootstrap.sh b/tasks/0042_488_42488023_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_488_42488023_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_488_42488023_qa_4/environment/pull_bucket.py b/tasks/0042_488_42488023_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_488_42488023_qa_4/environment/pull_bucket.py +++ b/tasks/0042_488_42488023_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_488_42488023_qa_4/task.toml b/tasks/0042_488_42488023_qa_4/task.toml index 5589d9f7e90587efc4f42ffe22b07756225464ca..e74b1f3d6ac26e7a444e985145610d4f5dfbbdee 100644 --- a/tasks/0042_488_42488023_qa_4/task.toml +++ b/tasks/0042_488_42488023_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_488_42488426_qa_1/environment/bootstrap.sh b/tasks/0042_488_42488426_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_488_42488426_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_488_42488426_qa_1/environment/pull_bucket.py b/tasks/0042_488_42488426_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_488_42488426_qa_1/environment/pull_bucket.py +++ b/tasks/0042_488_42488426_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_488_42488426_qa_1/task.toml b/tasks/0042_488_42488426_qa_1/task.toml index 56f4e23537d17d3cc4bf5e50d67165f7b7ed1d6e..6b932fb8327ce784511cc1dbd75f97e663a87989 100644 --- a/tasks/0042_488_42488426_qa_1/task.toml +++ b/tasks/0042_488_42488426_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_488_42488426_qa_2/environment/bootstrap.sh b/tasks/0042_488_42488426_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_488_42488426_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_488_42488426_qa_2/environment/pull_bucket.py b/tasks/0042_488_42488426_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_488_42488426_qa_2/environment/pull_bucket.py +++ b/tasks/0042_488_42488426_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_488_42488426_qa_2/task.toml b/tasks/0042_488_42488426_qa_2/task.toml index 1d88fd6ca85af89a1e5ff67b10f22ad8eb1f66c3..57bf8433688cd19d089e2b750909fb92c495f640 100644 --- a/tasks/0042_488_42488426_qa_2/task.toml +++ b/tasks/0042_488_42488426_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_488_42488426_qa_3/environment/bootstrap.sh b/tasks/0042_488_42488426_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_488_42488426_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_488_42488426_qa_3/environment/pull_bucket.py b/tasks/0042_488_42488426_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_488_42488426_qa_3/environment/pull_bucket.py +++ b/tasks/0042_488_42488426_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_488_42488426_qa_3/task.toml b/tasks/0042_488_42488426_qa_3/task.toml index d887d5793e9a246e52406d4532541e4de90d4ef4..bda898a482121ed7f987a46102742bd775ba0c6c 100644 --- a/tasks/0042_488_42488426_qa_3/task.toml +++ b/tasks/0042_488_42488426_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_492_42492005_qa_3/environment/bootstrap.sh b/tasks/0042_492_42492005_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_492_42492005_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_492_42492005_qa_3/environment/pull_bucket.py b/tasks/0042_492_42492005_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_492_42492005_qa_3/environment/pull_bucket.py +++ b/tasks/0042_492_42492005_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_492_42492005_qa_3/task.toml b/tasks/0042_492_42492005_qa_3/task.toml index 0ce553f9f7d5dc803e82afe3f0a4274715096c41..c35c3433712ce55d08a3a6dd1a987e83f4250cc9 100644 --- a/tasks/0042_492_42492005_qa_3/task.toml +++ b/tasks/0042_492_42492005_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_501_42501868_qa_1/environment/bootstrap.sh b/tasks/0042_501_42501868_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_501_42501868_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_501_42501868_qa_1/environment/pull_bucket.py b/tasks/0042_501_42501868_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_501_42501868_qa_1/environment/pull_bucket.py +++ b/tasks/0042_501_42501868_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_501_42501868_qa_1/task.toml b/tasks/0042_501_42501868_qa_1/task.toml index 528633dce613f44fdf0059b4d58f85cb1e173353..d984b59fce8c583840928d2ad773bb3c14889f92 100644 --- a/tasks/0042_501_42501868_qa_1/task.toml +++ b/tasks/0042_501_42501868_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_501_42501868_qa_2/environment/bootstrap.sh b/tasks/0042_501_42501868_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_501_42501868_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_501_42501868_qa_2/environment/pull_bucket.py b/tasks/0042_501_42501868_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_501_42501868_qa_2/environment/pull_bucket.py +++ b/tasks/0042_501_42501868_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_501_42501868_qa_2/task.toml b/tasks/0042_501_42501868_qa_2/task.toml index e116faa11287d02e8db3e5d6ffe702240f7cbb4c..ca64ce39f7d8cce9281e72e4e8ac1213ac0e5f44 100644 --- a/tasks/0042_501_42501868_qa_2/task.toml +++ b/tasks/0042_501_42501868_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_503_42503346_qa_4/environment/bootstrap.sh b/tasks/0042_503_42503346_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_503_42503346_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_503_42503346_qa_4/environment/pull_bucket.py b/tasks/0042_503_42503346_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_503_42503346_qa_4/environment/pull_bucket.py +++ b/tasks/0042_503_42503346_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_503_42503346_qa_4/task.toml b/tasks/0042_503_42503346_qa_4/task.toml index 6aa929c7e7fa3381bde1e395aa1a7a578588ee4b..a5b11b53bf0595044ba826c801ad61427973f645 100644 --- a/tasks/0042_503_42503346_qa_4/task.toml +++ b/tasks/0042_503_42503346_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_528_42528802_qa_3/environment/bootstrap.sh b/tasks/0042_528_42528802_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_528_42528802_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_528_42528802_qa_3/environment/pull_bucket.py b/tasks/0042_528_42528802_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_528_42528802_qa_3/environment/pull_bucket.py +++ b/tasks/0042_528_42528802_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_528_42528802_qa_3/task.toml b/tasks/0042_528_42528802_qa_3/task.toml index 125c9b51a02794bca38f051e70d94679de1722a3..8d54b053d11330b47a69386df5cb3a53268a553b 100644 --- a/tasks/0042_528_42528802_qa_3/task.toml +++ b/tasks/0042_528_42528802_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_569_42569940_qa_1/environment/bootstrap.sh b/tasks/0042_569_42569940_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_569_42569940_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_569_42569940_qa_1/environment/pull_bucket.py b/tasks/0042_569_42569940_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_569_42569940_qa_1/environment/pull_bucket.py +++ b/tasks/0042_569_42569940_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_569_42569940_qa_1/task.toml b/tasks/0042_569_42569940_qa_1/task.toml index de14c1608cd61b2787660cae21c0b79920f63671..bf141cf05d36326c55217f36c3079f5cec6ef6c4 100644 --- a/tasks/0042_569_42569940_qa_1/task.toml +++ b/tasks/0042_569_42569940_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_590_42590102_qa_4/environment/bootstrap.sh b/tasks/0042_590_42590102_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_590_42590102_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_590_42590102_qa_4/environment/pull_bucket.py b/tasks/0042_590_42590102_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_590_42590102_qa_4/environment/pull_bucket.py +++ b/tasks/0042_590_42590102_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_590_42590102_qa_4/task.toml b/tasks/0042_590_42590102_qa_4/task.toml index 92e0761a4987cdf372568ed9144014282d582604..b75323e1ad9a45f94f19c46c9b248737ea9b98ff 100644 --- a/tasks/0042_590_42590102_qa_4/task.toml +++ b/tasks/0042_590_42590102_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_635_42635249_qa_3/environment/bootstrap.sh b/tasks/0042_635_42635249_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_635_42635249_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_635_42635249_qa_3/environment/pull_bucket.py b/tasks/0042_635_42635249_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_635_42635249_qa_3/environment/pull_bucket.py +++ b/tasks/0042_635_42635249_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_635_42635249_qa_3/task.toml b/tasks/0042_635_42635249_qa_3/task.toml index d8e3403cc0808dea2c865f6340e33e1fa6e88ae6..b8eb7f5338aedd598ca531b2afb7f749468f78a8 100644 --- a/tasks/0042_635_42635249_qa_3/task.toml +++ b/tasks/0042_635_42635249_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_642_42642764_qa_2/environment/bootstrap.sh b/tasks/0042_642_42642764_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_642_42642764_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_642_42642764_qa_2/environment/pull_bucket.py b/tasks/0042_642_42642764_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_642_42642764_qa_2/environment/pull_bucket.py +++ b/tasks/0042_642_42642764_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_642_42642764_qa_2/task.toml b/tasks/0042_642_42642764_qa_2/task.toml index 680e9e43a6549abc8ad2078071127b83aa059255..84510bcb1a66317eb922558e89bb31a6cd2be287 100644 --- a/tasks/0042_642_42642764_qa_2/task.toml +++ b/tasks/0042_642_42642764_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_642_42642764_qa_3/environment/bootstrap.sh b/tasks/0042_642_42642764_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_642_42642764_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_642_42642764_qa_3/environment/pull_bucket.py b/tasks/0042_642_42642764_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_642_42642764_qa_3/environment/pull_bucket.py +++ b/tasks/0042_642_42642764_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_642_42642764_qa_3/task.toml b/tasks/0042_642_42642764_qa_3/task.toml index bbd9ad87bc74f763a35f31f377247d63603aea96..0a89c2c2cba74f04b6cda4c15f9ff1b65d2c9616 100644 --- a/tasks/0042_642_42642764_qa_3/task.toml +++ b/tasks/0042_642_42642764_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_644_42644185_qa_2/environment/bootstrap.sh b/tasks/0042_644_42644185_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_644_42644185_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_644_42644185_qa_2/environment/pull_bucket.py b/tasks/0042_644_42644185_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_644_42644185_qa_2/environment/pull_bucket.py +++ b/tasks/0042_644_42644185_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_644_42644185_qa_2/task.toml b/tasks/0042_644_42644185_qa_2/task.toml index 8e3b2416a3e53f211e86910366377b99f16581bc..0a4136c5a372b85122cf2bf26551c456936314d4 100644 --- a/tasks/0042_644_42644185_qa_2/task.toml +++ b/tasks/0042_644_42644185_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_684_42684548_qa_4/environment/bootstrap.sh b/tasks/0042_684_42684548_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_684_42684548_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_684_42684548_qa_4/environment/pull_bucket.py b/tasks/0042_684_42684548_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_684_42684548_qa_4/environment/pull_bucket.py +++ b/tasks/0042_684_42684548_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_684_42684548_qa_4/task.toml b/tasks/0042_684_42684548_qa_4/task.toml index 61811b18ed04e0aa54173194874e8b596c7b9413..1029e20012407b98427e0b15f860bda809ad4565 100644 --- a/tasks/0042_684_42684548_qa_4/task.toml +++ b/tasks/0042_684_42684548_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_738_42738840_qa_1/environment/bootstrap.sh b/tasks/0042_738_42738840_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_738_42738840_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_738_42738840_qa_1/environment/pull_bucket.py b/tasks/0042_738_42738840_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_738_42738840_qa_1/environment/pull_bucket.py +++ b/tasks/0042_738_42738840_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_738_42738840_qa_1/task.toml b/tasks/0042_738_42738840_qa_1/task.toml index 3f55e1b5112d3828379a48aed244d41654b77ce8..0a2413489b9ecd499088e8bb89788c3d21ed38f1 100644 --- a/tasks/0042_738_42738840_qa_1/task.toml +++ b/tasks/0042_738_42738840_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_738_42738840_qa_2/environment/bootstrap.sh b/tasks/0042_738_42738840_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_738_42738840_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_738_42738840_qa_2/environment/pull_bucket.py b/tasks/0042_738_42738840_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_738_42738840_qa_2/environment/pull_bucket.py +++ b/tasks/0042_738_42738840_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_738_42738840_qa_2/task.toml b/tasks/0042_738_42738840_qa_2/task.toml index 88c35d1cb60c27a63327557d71766a294fcc3fa3..15a4f449d33beacd18d7ca1d996b9f5e6cdfcab2 100644 --- a/tasks/0042_738_42738840_qa_2/task.toml +++ b/tasks/0042_738_42738840_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_750_42750016_qa_1/environment/bootstrap.sh b/tasks/0042_750_42750016_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_750_42750016_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_750_42750016_qa_1/environment/pull_bucket.py b/tasks/0042_750_42750016_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_750_42750016_qa_1/environment/pull_bucket.py +++ b/tasks/0042_750_42750016_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_750_42750016_qa_1/task.toml b/tasks/0042_750_42750016_qa_1/task.toml index 8ae223ea1f5cd1c9d7a073b1a298002f57755b4c..0402c0110a9fd525def98da6de67c8ee2b53df45 100644 --- a/tasks/0042_750_42750016_qa_1/task.toml +++ b/tasks/0042_750_42750016_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_773_42773926_qa_2/environment/bootstrap.sh b/tasks/0042_773_42773926_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_773_42773926_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_773_42773926_qa_2/environment/pull_bucket.py b/tasks/0042_773_42773926_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_773_42773926_qa_2/environment/pull_bucket.py +++ b/tasks/0042_773_42773926_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_773_42773926_qa_2/task.toml b/tasks/0042_773_42773926_qa_2/task.toml index a23509fa573743ebe7617564c0515aeddee414b8..9775a72313f42bdf1aefa7a4fd663a2a12167e04 100644 --- a/tasks/0042_773_42773926_qa_2/task.toml +++ b/tasks/0042_773_42773926_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_773_42773926_qa_3/environment/bootstrap.sh b/tasks/0042_773_42773926_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_773_42773926_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_773_42773926_qa_3/environment/pull_bucket.py b/tasks/0042_773_42773926_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_773_42773926_qa_3/environment/pull_bucket.py +++ b/tasks/0042_773_42773926_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_773_42773926_qa_3/task.toml b/tasks/0042_773_42773926_qa_3/task.toml index 14cabf9226df352b6edf153be6c1765f80a877d2..da068d019cf0202e1a04fcf2780a8d56f7ee2559 100644 --- a/tasks/0042_773_42773926_qa_3/task.toml +++ b/tasks/0042_773_42773926_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_806_42806362_qa_1/environment/bootstrap.sh b/tasks/0042_806_42806362_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_806_42806362_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_806_42806362_qa_1/environment/pull_bucket.py b/tasks/0042_806_42806362_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_806_42806362_qa_1/environment/pull_bucket.py +++ b/tasks/0042_806_42806362_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_806_42806362_qa_1/task.toml b/tasks/0042_806_42806362_qa_1/task.toml index 3c4ad9a2fdab65de5076269ed52f5039cae1f0db..7aff525df3ed97030134bd109b9e3b562ec7789c 100644 --- a/tasks/0042_806_42806362_qa_1/task.toml +++ b/tasks/0042_806_42806362_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_836_42836971_qa_3/environment/bootstrap.sh b/tasks/0042_836_42836971_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_836_42836971_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_836_42836971_qa_3/environment/pull_bucket.py b/tasks/0042_836_42836971_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_836_42836971_qa_3/environment/pull_bucket.py +++ b/tasks/0042_836_42836971_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_836_42836971_qa_3/task.toml b/tasks/0042_836_42836971_qa_3/task.toml index ee1a950e2741206b9f8adb2daa21dd13b0773b39..66817233619b51ab4a14ae73d955f7d8da935593 100644 --- a/tasks/0042_836_42836971_qa_3/task.toml +++ b/tasks/0042_836_42836971_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_857_42857956_qa_5/environment/bootstrap.sh b/tasks/0042_857_42857956_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_857_42857956_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_857_42857956_qa_5/environment/pull_bucket.py b/tasks/0042_857_42857956_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_857_42857956_qa_5/environment/pull_bucket.py +++ b/tasks/0042_857_42857956_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_857_42857956_qa_5/task.toml b/tasks/0042_857_42857956_qa_5/task.toml index 12882feef78ab631b182a947162b0a3eff323318..33d61b2f70e9801d9be6e11fb78fe9ea850fdd30 100644 --- a/tasks/0042_857_42857956_qa_5/task.toml +++ b/tasks/0042_857_42857956_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_902_42902013_qa_3/environment/bootstrap.sh b/tasks/0042_902_42902013_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_902_42902013_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_902_42902013_qa_3/environment/pull_bucket.py b/tasks/0042_902_42902013_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_902_42902013_qa_3/environment/pull_bucket.py +++ b/tasks/0042_902_42902013_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_902_42902013_qa_3/task.toml b/tasks/0042_902_42902013_qa_3/task.toml index 736f26b072ccf3286fbd31dea9108bb1c5437326..e2c8548fb8e3879de21ca665a235cf2e39bb574c 100644 --- a/tasks/0042_902_42902013_qa_3/task.toml +++ b/tasks/0042_902_42902013_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_903_42903883_qa_1/environment/bootstrap.sh b/tasks/0042_903_42903883_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_903_42903883_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_903_42903883_qa_1/environment/pull_bucket.py b/tasks/0042_903_42903883_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_903_42903883_qa_1/environment/pull_bucket.py +++ b/tasks/0042_903_42903883_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_903_42903883_qa_1/task.toml b/tasks/0042_903_42903883_qa_1/task.toml index 75b369bb76b68af36aa9457da5cb3f5272a8136b..e0db7843683c4ced5ffcb159b721afe05d685980 100644 --- a/tasks/0042_903_42903883_qa_1/task.toml +++ b/tasks/0042_903_42903883_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_911_42911036_qa_1/environment/bootstrap.sh b/tasks/0042_911_42911036_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_911_42911036_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_911_42911036_qa_1/environment/pull_bucket.py b/tasks/0042_911_42911036_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_911_42911036_qa_1/environment/pull_bucket.py +++ b/tasks/0042_911_42911036_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_911_42911036_qa_1/task.toml b/tasks/0042_911_42911036_qa_1/task.toml index e51ade068d11dd499445734f30c2891a9c5d7fac..ba2f22c979585e8b0a4f00e1b5bb106c7f3d5106 100644 --- a/tasks/0042_911_42911036_qa_1/task.toml +++ b/tasks/0042_911_42911036_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_911_42911036_qa_2/environment/bootstrap.sh b/tasks/0042_911_42911036_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_911_42911036_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_911_42911036_qa_2/environment/pull_bucket.py b/tasks/0042_911_42911036_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_911_42911036_qa_2/environment/pull_bucket.py +++ b/tasks/0042_911_42911036_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_911_42911036_qa_2/task.toml b/tasks/0042_911_42911036_qa_2/task.toml index bfc776d45029d3288b7f98d4940294a8fa1fe386..f61d35ad15072c2f3f20c99099284697f7ee491b 100644 --- a/tasks/0042_911_42911036_qa_2/task.toml +++ b/tasks/0042_911_42911036_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_917_42917087_qa_1/environment/bootstrap.sh b/tasks/0042_917_42917087_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_917_42917087_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_917_42917087_qa_1/environment/pull_bucket.py b/tasks/0042_917_42917087_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_917_42917087_qa_1/environment/pull_bucket.py +++ b/tasks/0042_917_42917087_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_917_42917087_qa_1/task.toml b/tasks/0042_917_42917087_qa_1/task.toml index 76a67f0e4220983fd7e5768e1d28e56f61c19162..54903465458e89e569cdef66a9fe96c610320221 100644 --- a/tasks/0042_917_42917087_qa_1/task.toml +++ b/tasks/0042_917_42917087_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_928_42928888_qa_1/environment/bootstrap.sh b/tasks/0042_928_42928888_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_928_42928888_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_928_42928888_qa_1/environment/pull_bucket.py b/tasks/0042_928_42928888_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_928_42928888_qa_1/environment/pull_bucket.py +++ b/tasks/0042_928_42928888_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_928_42928888_qa_1/task.toml b/tasks/0042_928_42928888_qa_1/task.toml index db27938e127fd564c7cbaa664c2f6003b9d57533..136e49b0612b5dafd889c8cba5598c68ce412db0 100644 --- a/tasks/0042_928_42928888_qa_1/task.toml +++ b/tasks/0042_928_42928888_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_941_42941100_qa_2/environment/bootstrap.sh b/tasks/0042_941_42941100_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_941_42941100_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_941_42941100_qa_2/environment/pull_bucket.py b/tasks/0042_941_42941100_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_941_42941100_qa_2/environment/pull_bucket.py +++ b/tasks/0042_941_42941100_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_941_42941100_qa_2/task.toml b/tasks/0042_941_42941100_qa_2/task.toml index 382402b1e3a0bdbd631a1fbde387a440b511c8e5..a234e7ebcd194f24bf1f1502594567a5049fd9e5 100644 --- a/tasks/0042_941_42941100_qa_2/task.toml +++ b/tasks/0042_941_42941100_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_973_42973076_qa_1/environment/bootstrap.sh b/tasks/0042_973_42973076_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_973_42973076_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_973_42973076_qa_1/environment/pull_bucket.py b/tasks/0042_973_42973076_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_973_42973076_qa_1/environment/pull_bucket.py +++ b/tasks/0042_973_42973076_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_973_42973076_qa_1/task.toml b/tasks/0042_973_42973076_qa_1/task.toml index dfca1b53d87670ff90e3f61338dc1f16c3ef5866..baf0bfeff22bd220a0743e1df097bc2f7d922130 100644 --- a/tasks/0042_973_42973076_qa_1/task.toml +++ b/tasks/0042_973_42973076_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_973_42973076_qa_4/environment/bootstrap.sh b/tasks/0042_973_42973076_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_973_42973076_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_973_42973076_qa_4/environment/pull_bucket.py b/tasks/0042_973_42973076_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_973_42973076_qa_4/environment/pull_bucket.py +++ b/tasks/0042_973_42973076_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_973_42973076_qa_4/task.toml b/tasks/0042_973_42973076_qa_4/task.toml index 2c9b46136b95abf5e64d8a436c77eaf44c2ff3e2..a7c144562736edef994ef3cf705c6d9f45acd855 100644 --- a/tasks/0042_973_42973076_qa_4/task.toml +++ b/tasks/0042_973_42973076_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_973_42973076_qa_5/environment/bootstrap.sh b/tasks/0042_973_42973076_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_973_42973076_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_973_42973076_qa_5/environment/pull_bucket.py b/tasks/0042_973_42973076_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_973_42973076_qa_5/environment/pull_bucket.py +++ b/tasks/0042_973_42973076_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_973_42973076_qa_5/task.toml b/tasks/0042_973_42973076_qa_5/task.toml index f2e8cdbdcc6378a4680afe81d17467aea489a668..c3fb6a7361405e5eb1867f4f99b695734d5dd277 100644 --- a/tasks/0042_973_42973076_qa_5/task.toml +++ b/tasks/0042_973_42973076_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_991_42991381_qa_5/environment/bootstrap.sh b/tasks/0042_991_42991381_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_991_42991381_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_991_42991381_qa_5/environment/pull_bucket.py b/tasks/0042_991_42991381_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_991_42991381_qa_5/environment/pull_bucket.py +++ b/tasks/0042_991_42991381_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_991_42991381_qa_5/task.toml b/tasks/0042_991_42991381_qa_5/task.toml index eb4a59420bb67812c0f3ac37063a24393d4d9716..67181c3f11fcfe0ba573471019674231fd39f0eb 100644 --- a/tasks/0042_991_42991381_qa_5/task.toml +++ b/tasks/0042_991_42991381_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0042_993_42993650_qa_1/environment/bootstrap.sh b/tasks/0042_993_42993650_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0042_993_42993650_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0042_993_42993650_qa_1/environment/pull_bucket.py b/tasks/0042_993_42993650_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0042_993_42993650_qa_1/environment/pull_bucket.py +++ b/tasks/0042_993_42993650_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0042_993_42993650_qa_1/task.toml b/tasks/0042_993_42993650_qa_1/task.toml index 986496e29126c3f64d6f61c7a368c48a3c5f8dfa..83fe770acdbe755f6162ceafbda4eecb3ec68312 100644 --- a/tasks/0042_993_42993650_qa_1/task.toml +++ b/tasks/0042_993_42993650_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_029_43029106_qa_1/environment/bootstrap.sh b/tasks/0043_029_43029106_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_029_43029106_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_029_43029106_qa_1/environment/pull_bucket.py b/tasks/0043_029_43029106_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_029_43029106_qa_1/environment/pull_bucket.py +++ b/tasks/0043_029_43029106_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_029_43029106_qa_1/task.toml b/tasks/0043_029_43029106_qa_1/task.toml index 3b75638533952da3a8219376ec7dceb97431695d..dfb7b9d8fe362c3820a27e24566e42436cba77d1 100644 --- a/tasks/0043_029_43029106_qa_1/task.toml +++ b/tasks/0043_029_43029106_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_032_43032812_qa_4/environment/bootstrap.sh b/tasks/0043_032_43032812_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_032_43032812_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_032_43032812_qa_4/environment/pull_bucket.py b/tasks/0043_032_43032812_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_032_43032812_qa_4/environment/pull_bucket.py +++ b/tasks/0043_032_43032812_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_032_43032812_qa_4/task.toml b/tasks/0043_032_43032812_qa_4/task.toml index 21c5e95476c398d1c25db832ce6ef5c036567ca9..7276088c18d1a8daa946c49841899a3430f32fea 100644 --- a/tasks/0043_032_43032812_qa_4/task.toml +++ b/tasks/0043_032_43032812_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_043_43043497_qa_2/environment/bootstrap.sh b/tasks/0043_043_43043497_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_043_43043497_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_043_43043497_qa_2/environment/pull_bucket.py b/tasks/0043_043_43043497_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_043_43043497_qa_2/environment/pull_bucket.py +++ b/tasks/0043_043_43043497_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_043_43043497_qa_2/task.toml b/tasks/0043_043_43043497_qa_2/task.toml index 7f3044e8cc3832bbf177cc4501a9c2addd2ef60e..7d532b0b2121df9f2738c7b144ba9a141a955b57 100644 --- a/tasks/0043_043_43043497_qa_2/task.toml +++ b/tasks/0043_043_43043497_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_069_43069626_qa_1/environment/bootstrap.sh b/tasks/0043_069_43069626_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_069_43069626_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_069_43069626_qa_1/environment/pull_bucket.py b/tasks/0043_069_43069626_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_069_43069626_qa_1/environment/pull_bucket.py +++ b/tasks/0043_069_43069626_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_069_43069626_qa_1/task.toml b/tasks/0043_069_43069626_qa_1/task.toml index f0205e8fe960d91a2aed7e3cfc57fd6af9630722..ebba9346c36525311b5fc460563e12f69ed13f92 100644 --- a/tasks/0043_069_43069626_qa_1/task.toml +++ b/tasks/0043_069_43069626_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_069_43069626_qa_4/environment/bootstrap.sh b/tasks/0043_069_43069626_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_069_43069626_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_069_43069626_qa_4/environment/pull_bucket.py b/tasks/0043_069_43069626_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_069_43069626_qa_4/environment/pull_bucket.py +++ b/tasks/0043_069_43069626_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_069_43069626_qa_4/task.toml b/tasks/0043_069_43069626_qa_4/task.toml index 56d6a5969a2bad42bde98d309f25cc05f057591e..023c1d92c4386f5e374683235e21cd8dd8a62b47 100644 --- a/tasks/0043_069_43069626_qa_4/task.toml +++ b/tasks/0043_069_43069626_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_124_43124508_qa_1/environment/bootstrap.sh b/tasks/0043_124_43124508_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_124_43124508_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_124_43124508_qa_1/environment/pull_bucket.py b/tasks/0043_124_43124508_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_124_43124508_qa_1/environment/pull_bucket.py +++ b/tasks/0043_124_43124508_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_124_43124508_qa_1/task.toml b/tasks/0043_124_43124508_qa_1/task.toml index 42faf37f48a354e2061ea730d453afef60a0a511..d3414438c7296eacb2c6e5f5e98bc565a78196b6 100644 --- a/tasks/0043_124_43124508_qa_1/task.toml +++ b/tasks/0043_124_43124508_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_124_43124508_qa_2/environment/bootstrap.sh b/tasks/0043_124_43124508_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_124_43124508_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_124_43124508_qa_2/environment/pull_bucket.py b/tasks/0043_124_43124508_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_124_43124508_qa_2/environment/pull_bucket.py +++ b/tasks/0043_124_43124508_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_124_43124508_qa_2/task.toml b/tasks/0043_124_43124508_qa_2/task.toml index 92f040d636fe760b2da5f344150c9f49b64b8310..b47ded9f4fd18269c7b21b0c50122d89bc1bef02 100644 --- a/tasks/0043_124_43124508_qa_2/task.toml +++ b/tasks/0043_124_43124508_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_124_43124508_qa_3/environment/bootstrap.sh b/tasks/0043_124_43124508_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_124_43124508_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_124_43124508_qa_3/environment/pull_bucket.py b/tasks/0043_124_43124508_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_124_43124508_qa_3/environment/pull_bucket.py +++ b/tasks/0043_124_43124508_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_124_43124508_qa_3/task.toml b/tasks/0043_124_43124508_qa_3/task.toml index 9c042a0c503e3c81366754a0c74fe432d61d1033..b05748002f01e6d7371b839933639513782a7600 100644 --- a/tasks/0043_124_43124508_qa_3/task.toml +++ b/tasks/0043_124_43124508_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_124_43124508_qa_4/environment/bootstrap.sh b/tasks/0043_124_43124508_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_124_43124508_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_124_43124508_qa_4/environment/pull_bucket.py b/tasks/0043_124_43124508_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_124_43124508_qa_4/environment/pull_bucket.py +++ b/tasks/0043_124_43124508_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_124_43124508_qa_4/task.toml b/tasks/0043_124_43124508_qa_4/task.toml index 044fc623bbe3b77d3b6753606c3a9f3870d08fdf..7c3b90ff11efa65bcb77bddea90efce6a46a9ab1 100644 --- a/tasks/0043_124_43124508_qa_4/task.toml +++ b/tasks/0043_124_43124508_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_303_43303678_qa_3/environment/bootstrap.sh b/tasks/0043_303_43303678_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_303_43303678_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_303_43303678_qa_3/environment/pull_bucket.py b/tasks/0043_303_43303678_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_303_43303678_qa_3/environment/pull_bucket.py +++ b/tasks/0043_303_43303678_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_303_43303678_qa_3/task.toml b/tasks/0043_303_43303678_qa_3/task.toml index e4f78f331876bbd8cc76c6ed77b2d440945836a0..6ecb53b71025e520896aa39a5fd8da3e2de3e897 100644 --- a/tasks/0043_303_43303678_qa_3/task.toml +++ b/tasks/0043_303_43303678_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_305_43305320_qa_2/environment/bootstrap.sh b/tasks/0043_305_43305320_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_305_43305320_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_305_43305320_qa_2/environment/pull_bucket.py b/tasks/0043_305_43305320_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_305_43305320_qa_2/environment/pull_bucket.py +++ b/tasks/0043_305_43305320_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_305_43305320_qa_2/task.toml b/tasks/0043_305_43305320_qa_2/task.toml index c15a581fc147bd757d4782d5e7a2ed6d33b7252c..7e93aea30881d88f1554d115c33db373903fdf9a 100644 --- a/tasks/0043_305_43305320_qa_2/task.toml +++ b/tasks/0043_305_43305320_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_305_43305320_qa_4/environment/bootstrap.sh b/tasks/0043_305_43305320_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_305_43305320_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_305_43305320_qa_4/environment/pull_bucket.py b/tasks/0043_305_43305320_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_305_43305320_qa_4/environment/pull_bucket.py +++ b/tasks/0043_305_43305320_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_305_43305320_qa_4/task.toml b/tasks/0043_305_43305320_qa_4/task.toml index 0038db90e304d92f352c98f2e8a48c9d6ed7c5f3..3b7de2884d722bc0cd093c12da3835c886485ef6 100644 --- a/tasks/0043_305_43305320_qa_4/task.toml +++ b/tasks/0043_305_43305320_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_309_43309435_qa_3/environment/bootstrap.sh b/tasks/0043_309_43309435_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_309_43309435_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_309_43309435_qa_3/environment/pull_bucket.py b/tasks/0043_309_43309435_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_309_43309435_qa_3/environment/pull_bucket.py +++ b/tasks/0043_309_43309435_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_309_43309435_qa_3/task.toml b/tasks/0043_309_43309435_qa_3/task.toml index 9d66f04abb761bf598c9eb6d40bc4910f88848ec..67e48db167f087a3d83eff0a76ebc922b9c853a5 100644 --- a/tasks/0043_309_43309435_qa_3/task.toml +++ b/tasks/0043_309_43309435_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_309_43309435_qa_5/environment/bootstrap.sh b/tasks/0043_309_43309435_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_309_43309435_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_309_43309435_qa_5/environment/pull_bucket.py b/tasks/0043_309_43309435_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_309_43309435_qa_5/environment/pull_bucket.py +++ b/tasks/0043_309_43309435_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_309_43309435_qa_5/task.toml b/tasks/0043_309_43309435_qa_5/task.toml index fb0b31d9df2ad5850a74e61e2990e2b4f566fc91..d5b7a90c049273d3d5c3051ef68d747579b78816 100644 --- a/tasks/0043_309_43309435_qa_5/task.toml +++ b/tasks/0043_309_43309435_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_313_43313326_qa_1/environment/bootstrap.sh b/tasks/0043_313_43313326_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_313_43313326_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_313_43313326_qa_1/environment/pull_bucket.py b/tasks/0043_313_43313326_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_313_43313326_qa_1/environment/pull_bucket.py +++ b/tasks/0043_313_43313326_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_313_43313326_qa_1/task.toml b/tasks/0043_313_43313326_qa_1/task.toml index b5dd288570715b31fee61ef857b04a5ac13516f4..9e35c8419ec3f7a1228eedb4e3af1564df6a780b 100644 --- a/tasks/0043_313_43313326_qa_1/task.toml +++ b/tasks/0043_313_43313326_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_313_43313326_qa_2/environment/bootstrap.sh b/tasks/0043_313_43313326_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_313_43313326_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_313_43313326_qa_2/environment/pull_bucket.py b/tasks/0043_313_43313326_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_313_43313326_qa_2/environment/pull_bucket.py +++ b/tasks/0043_313_43313326_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_313_43313326_qa_2/task.toml b/tasks/0043_313_43313326_qa_2/task.toml index 19ff9c8628bbeca4736e2f10195afc83e4f71281..c65f10d34d8b8e22ad8ef43fa5ce4d4ecea67702 100644 --- a/tasks/0043_313_43313326_qa_2/task.toml +++ b/tasks/0043_313_43313326_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_313_43313326_qa_5/environment/bootstrap.sh b/tasks/0043_313_43313326_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_313_43313326_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_313_43313326_qa_5/environment/pull_bucket.py b/tasks/0043_313_43313326_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_313_43313326_qa_5/environment/pull_bucket.py +++ b/tasks/0043_313_43313326_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_313_43313326_qa_5/task.toml b/tasks/0043_313_43313326_qa_5/task.toml index 95605e3a8f4346ca91ea378032a246dc1fa486cc..9f3e6ced92c767e9b189b96b6ff727b8a072a93c 100644 --- a/tasks/0043_313_43313326_qa_5/task.toml +++ b/tasks/0043_313_43313326_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_338_43338909_qa_1/environment/bootstrap.sh b/tasks/0043_338_43338909_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_338_43338909_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_338_43338909_qa_1/environment/pull_bucket.py b/tasks/0043_338_43338909_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_338_43338909_qa_1/environment/pull_bucket.py +++ b/tasks/0043_338_43338909_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_338_43338909_qa_1/task.toml b/tasks/0043_338_43338909_qa_1/task.toml index 49799c77666965b7a9c5245fc215990b1fae5df2..6d0d8bc62e25814f0327ec0ffe6d9853280f8c67 100644 --- a/tasks/0043_338_43338909_qa_1/task.toml +++ b/tasks/0043_338_43338909_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_338_43338909_qa_3/environment/bootstrap.sh b/tasks/0043_338_43338909_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_338_43338909_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_338_43338909_qa_3/environment/pull_bucket.py b/tasks/0043_338_43338909_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_338_43338909_qa_3/environment/pull_bucket.py +++ b/tasks/0043_338_43338909_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_338_43338909_qa_3/task.toml b/tasks/0043_338_43338909_qa_3/task.toml index c89fa8cd6578a0bfbdae2699e0f05a98db39d0e9..8c8e6bc24d3aa2a5b7a77bb8b3b384399f7c9423 100644 --- a/tasks/0043_338_43338909_qa_3/task.toml +++ b/tasks/0043_338_43338909_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_348_43348851_qa_1/environment/bootstrap.sh b/tasks/0043_348_43348851_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_348_43348851_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_348_43348851_qa_1/environment/pull_bucket.py b/tasks/0043_348_43348851_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_348_43348851_qa_1/environment/pull_bucket.py +++ b/tasks/0043_348_43348851_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_348_43348851_qa_1/task.toml b/tasks/0043_348_43348851_qa_1/task.toml index 43a83728b24b85e7948bd948bfd360bb8b77a047..4e7c07526d70552c3df3e13a7750499def392057 100644 --- a/tasks/0043_348_43348851_qa_1/task.toml +++ b/tasks/0043_348_43348851_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_373_43373918_qa_4/environment/bootstrap.sh b/tasks/0043_373_43373918_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_373_43373918_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_373_43373918_qa_4/environment/pull_bucket.py b/tasks/0043_373_43373918_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_373_43373918_qa_4/environment/pull_bucket.py +++ b/tasks/0043_373_43373918_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_373_43373918_qa_4/task.toml b/tasks/0043_373_43373918_qa_4/task.toml index f3e3f6821f67d799b220ed9fef775e005a0ce125..ca5c0eb193a9a0092ff77528b8af88cfbc8d944b 100644 --- a/tasks/0043_373_43373918_qa_4/task.toml +++ b/tasks/0043_373_43373918_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_374_43374447_qa_2/environment/bootstrap.sh b/tasks/0043_374_43374447_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_374_43374447_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_374_43374447_qa_2/environment/pull_bucket.py b/tasks/0043_374_43374447_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_374_43374447_qa_2/environment/pull_bucket.py +++ b/tasks/0043_374_43374447_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_374_43374447_qa_2/task.toml b/tasks/0043_374_43374447_qa_2/task.toml index b597755c5640fb2161ec169b08312669a1abd40a..0910fe650f8efab9d13b1290480782f826b27961 100644 --- a/tasks/0043_374_43374447_qa_2/task.toml +++ b/tasks/0043_374_43374447_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_376_43376696_qa_2/environment/bootstrap.sh b/tasks/0043_376_43376696_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_376_43376696_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_376_43376696_qa_2/environment/pull_bucket.py b/tasks/0043_376_43376696_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_376_43376696_qa_2/environment/pull_bucket.py +++ b/tasks/0043_376_43376696_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_376_43376696_qa_2/task.toml b/tasks/0043_376_43376696_qa_2/task.toml index 680f009204611f7b7111398379ea1710ee13afaf..ee02181151cdbff1a1058fda1846b8c413c51427 100644 --- a/tasks/0043_376_43376696_qa_2/task.toml +++ b/tasks/0043_376_43376696_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_419_43419580_qa_1/environment/bootstrap.sh b/tasks/0043_419_43419580_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_419_43419580_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_419_43419580_qa_1/environment/pull_bucket.py b/tasks/0043_419_43419580_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_419_43419580_qa_1/environment/pull_bucket.py +++ b/tasks/0043_419_43419580_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_419_43419580_qa_1/task.toml b/tasks/0043_419_43419580_qa_1/task.toml index 2d901ac1e29c395af454a67d2ff4cbbebde4c31f..4f55900c27a38ef1eb98cdd9c019320508838d8a 100644 --- a/tasks/0043_419_43419580_qa_1/task.toml +++ b/tasks/0043_419_43419580_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_419_43419580_qa_2/environment/bootstrap.sh b/tasks/0043_419_43419580_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_419_43419580_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_419_43419580_qa_2/environment/pull_bucket.py b/tasks/0043_419_43419580_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_419_43419580_qa_2/environment/pull_bucket.py +++ b/tasks/0043_419_43419580_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_419_43419580_qa_2/task.toml b/tasks/0043_419_43419580_qa_2/task.toml index c2cda75e04bda17a7320733d396969d70d9638ab..7a46e7f1d2eac87830580aeb29c87e26fde80c4d 100644 --- a/tasks/0043_419_43419580_qa_2/task.toml +++ b/tasks/0043_419_43419580_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_437_43437842_qa_3/environment/bootstrap.sh b/tasks/0043_437_43437842_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_437_43437842_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_437_43437842_qa_3/environment/pull_bucket.py b/tasks/0043_437_43437842_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_437_43437842_qa_3/environment/pull_bucket.py +++ b/tasks/0043_437_43437842_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_437_43437842_qa_3/task.toml b/tasks/0043_437_43437842_qa_3/task.toml index 5d15e682348b0be47a194840087a6fe816cb0e21..80aa83512b0be0ba879220213915e8b50ccead64 100644 --- a/tasks/0043_437_43437842_qa_3/task.toml +++ b/tasks/0043_437_43437842_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_510_43510597_qa_3/environment/bootstrap.sh b/tasks/0043_510_43510597_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_510_43510597_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_510_43510597_qa_3/environment/pull_bucket.py b/tasks/0043_510_43510597_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_510_43510597_qa_3/environment/pull_bucket.py +++ b/tasks/0043_510_43510597_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_510_43510597_qa_3/task.toml b/tasks/0043_510_43510597_qa_3/task.toml index bc406d92e8ad55721a7b708c9f5f33b9012b71fc..574b4184bf8733d5913729adcdbca76b975cd267 100644 --- a/tasks/0043_510_43510597_qa_3/task.toml +++ b/tasks/0043_510_43510597_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_512_43512047_qa_1/environment/bootstrap.sh b/tasks/0043_512_43512047_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_512_43512047_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_512_43512047_qa_1/environment/pull_bucket.py b/tasks/0043_512_43512047_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_512_43512047_qa_1/environment/pull_bucket.py +++ b/tasks/0043_512_43512047_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_512_43512047_qa_1/task.toml b/tasks/0043_512_43512047_qa_1/task.toml index 99d52b76fb17325418608a2c3a350e5eae9757f9..4eeef316dfa2187ac7c9786eef5e3e6ddd63a827 100644 --- a/tasks/0043_512_43512047_qa_1/task.toml +++ b/tasks/0043_512_43512047_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_512_43512681_qa_2/environment/bootstrap.sh b/tasks/0043_512_43512681_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_512_43512681_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_512_43512681_qa_2/environment/pull_bucket.py b/tasks/0043_512_43512681_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_512_43512681_qa_2/environment/pull_bucket.py +++ b/tasks/0043_512_43512681_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_512_43512681_qa_2/task.toml b/tasks/0043_512_43512681_qa_2/task.toml index 826770166e16d9f776f68741781add90eeb5f081..cc9439aeac33b63a629ac16d713dd2c4045c048d 100644 --- a/tasks/0043_512_43512681_qa_2/task.toml +++ b/tasks/0043_512_43512681_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_512_43512681_qa_5/environment/bootstrap.sh b/tasks/0043_512_43512681_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_512_43512681_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_512_43512681_qa_5/environment/pull_bucket.py b/tasks/0043_512_43512681_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_512_43512681_qa_5/environment/pull_bucket.py +++ b/tasks/0043_512_43512681_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_512_43512681_qa_5/task.toml b/tasks/0043_512_43512681_qa_5/task.toml index b3f32ce44f387856f4f67710711510379d701b66..9f1c0a5c217c6f9816503fcd58648defec59aa26 100644 --- a/tasks/0043_512_43512681_qa_5/task.toml +++ b/tasks/0043_512_43512681_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_524_43524264_qa_1/environment/bootstrap.sh b/tasks/0043_524_43524264_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_524_43524264_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_524_43524264_qa_1/environment/pull_bucket.py b/tasks/0043_524_43524264_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_524_43524264_qa_1/environment/pull_bucket.py +++ b/tasks/0043_524_43524264_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_524_43524264_qa_1/task.toml b/tasks/0043_524_43524264_qa_1/task.toml index 878e284faabc621a0f4fc01e72afdd05ece12a23..0aeda281b7216bbf42ae51e1d91c186f222e9a49 100644 --- a/tasks/0043_524_43524264_qa_1/task.toml +++ b/tasks/0043_524_43524264_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_528_43528813_qa_2/environment/bootstrap.sh b/tasks/0043_528_43528813_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_528_43528813_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_528_43528813_qa_2/environment/pull_bucket.py b/tasks/0043_528_43528813_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_528_43528813_qa_2/environment/pull_bucket.py +++ b/tasks/0043_528_43528813_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_528_43528813_qa_2/task.toml b/tasks/0043_528_43528813_qa_2/task.toml index 6e7d6a727a5254e305a0492896e8cb81f36420d2..ae7b9ccbc4732f6b0f1081a9e725eb09cffe09fa 100644 --- a/tasks/0043_528_43528813_qa_2/task.toml +++ b/tasks/0043_528_43528813_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_544_43544384_qa_2/environment/bootstrap.sh b/tasks/0043_544_43544384_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_544_43544384_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_544_43544384_qa_2/environment/pull_bucket.py b/tasks/0043_544_43544384_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_544_43544384_qa_2/environment/pull_bucket.py +++ b/tasks/0043_544_43544384_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_544_43544384_qa_2/task.toml b/tasks/0043_544_43544384_qa_2/task.toml index d8d0aa62ff67d97601d32b98524d0742b37e6439..1b7cbb69923f422585d6c036af6e34b38d719663 100644 --- a/tasks/0043_544_43544384_qa_2/task.toml +++ b/tasks/0043_544_43544384_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_544_43544384_qa_4/environment/bootstrap.sh b/tasks/0043_544_43544384_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_544_43544384_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_544_43544384_qa_4/environment/pull_bucket.py b/tasks/0043_544_43544384_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_544_43544384_qa_4/environment/pull_bucket.py +++ b/tasks/0043_544_43544384_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_544_43544384_qa_4/task.toml b/tasks/0043_544_43544384_qa_4/task.toml index 3875c2f03ff59f4be1fa1974c32e658ea1da758e..bb4e75c1d5587418f40b2d66d53f91fd6f2604c9 100644 --- a/tasks/0043_544_43544384_qa_4/task.toml +++ b/tasks/0043_544_43544384_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_551_43551294_qa_3/environment/bootstrap.sh b/tasks/0043_551_43551294_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_551_43551294_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_551_43551294_qa_3/environment/pull_bucket.py b/tasks/0043_551_43551294_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_551_43551294_qa_3/environment/pull_bucket.py +++ b/tasks/0043_551_43551294_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_551_43551294_qa_3/task.toml b/tasks/0043_551_43551294_qa_3/task.toml index b8fd8159da251d4abca229366d1fdc94674c68f2..4f3bac74c4bd515b6ae0c0aed35d458273c9f345 100644 --- a/tasks/0043_551_43551294_qa_3/task.toml +++ b/tasks/0043_551_43551294_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_591_43591690_qa_2/environment/bootstrap.sh b/tasks/0043_591_43591690_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_591_43591690_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_591_43591690_qa_2/environment/pull_bucket.py b/tasks/0043_591_43591690_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_591_43591690_qa_2/environment/pull_bucket.py +++ b/tasks/0043_591_43591690_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_591_43591690_qa_2/task.toml b/tasks/0043_591_43591690_qa_2/task.toml index 97d374ee16ac8e32057153df503a37c20ae260f2..78d96cf900ed5a8e85e1526ecd88772312cc5556 100644 --- a/tasks/0043_591_43591690_qa_2/task.toml +++ b/tasks/0043_591_43591690_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_591_43591690_qa_3/environment/bootstrap.sh b/tasks/0043_591_43591690_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_591_43591690_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_591_43591690_qa_3/environment/pull_bucket.py b/tasks/0043_591_43591690_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_591_43591690_qa_3/environment/pull_bucket.py +++ b/tasks/0043_591_43591690_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_591_43591690_qa_3/task.toml b/tasks/0043_591_43591690_qa_3/task.toml index 8304de91ed5236fd62e54d98dd60d4ec3bbf664f..7f61fb3d7bc83084b28d80ce07b77ffc304c4986 100644 --- a/tasks/0043_591_43591690_qa_3/task.toml +++ b/tasks/0043_591_43591690_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_591_43591690_qa_5/environment/bootstrap.sh b/tasks/0043_591_43591690_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_591_43591690_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_591_43591690_qa_5/environment/pull_bucket.py b/tasks/0043_591_43591690_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_591_43591690_qa_5/environment/pull_bucket.py +++ b/tasks/0043_591_43591690_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_591_43591690_qa_5/task.toml b/tasks/0043_591_43591690_qa_5/task.toml index 86eb350c932e42764d894ef0ddf1ab72cfa71a04..529c1989012c72a1ebacd816321e2d91be970985 100644 --- a/tasks/0043_591_43591690_qa_5/task.toml +++ b/tasks/0043_591_43591690_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_639_43639268_qa_1/environment/bootstrap.sh b/tasks/0043_639_43639268_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_639_43639268_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_639_43639268_qa_1/environment/pull_bucket.py b/tasks/0043_639_43639268_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_639_43639268_qa_1/environment/pull_bucket.py +++ b/tasks/0043_639_43639268_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_639_43639268_qa_1/task.toml b/tasks/0043_639_43639268_qa_1/task.toml index 6423b0f0c9dd1a3ae8061a25d660b82aba36cd79..5e9b5f68d71370997e60ae15340746dfb29af664 100644 --- a/tasks/0043_639_43639268_qa_1/task.toml +++ b/tasks/0043_639_43639268_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_642_43642810_qa_1/environment/bootstrap.sh b/tasks/0043_642_43642810_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_642_43642810_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_642_43642810_qa_1/environment/pull_bucket.py b/tasks/0043_642_43642810_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_642_43642810_qa_1/environment/pull_bucket.py +++ b/tasks/0043_642_43642810_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_642_43642810_qa_1/task.toml b/tasks/0043_642_43642810_qa_1/task.toml index cde028f5e28f3d03c2a59a529a6d46f8f0585f34..2094e4fbba3b9356bfa460e6a5f1c52752d6f39e 100644 --- a/tasks/0043_642_43642810_qa_1/task.toml +++ b/tasks/0043_642_43642810_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_644_43644485_qa_5/environment/bootstrap.sh b/tasks/0043_644_43644485_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_644_43644485_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_644_43644485_qa_5/environment/pull_bucket.py b/tasks/0043_644_43644485_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_644_43644485_qa_5/environment/pull_bucket.py +++ b/tasks/0043_644_43644485_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_644_43644485_qa_5/task.toml b/tasks/0043_644_43644485_qa_5/task.toml index 9b9fe969ae3b25887eab9d2dbf1e493297fdb34f..b12539d169b36fd1e77b988d62eb863dab4451f7 100644 --- a/tasks/0043_644_43644485_qa_5/task.toml +++ b/tasks/0043_644_43644485_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_694_43694920_qa_1/environment/bootstrap.sh b/tasks/0043_694_43694920_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_694_43694920_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_694_43694920_qa_1/environment/pull_bucket.py b/tasks/0043_694_43694920_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_694_43694920_qa_1/environment/pull_bucket.py +++ b/tasks/0043_694_43694920_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_694_43694920_qa_1/task.toml b/tasks/0043_694_43694920_qa_1/task.toml index 2983955da8dd656d3a0fd6906d02fb4648599f88..db86a0a535f64a56261aadbb041610282b4b6c14 100644 --- a/tasks/0043_694_43694920_qa_1/task.toml +++ b/tasks/0043_694_43694920_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_694_43694920_qa_5/environment/bootstrap.sh b/tasks/0043_694_43694920_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_694_43694920_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_694_43694920_qa_5/environment/pull_bucket.py b/tasks/0043_694_43694920_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_694_43694920_qa_5/environment/pull_bucket.py +++ b/tasks/0043_694_43694920_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_694_43694920_qa_5/task.toml b/tasks/0043_694_43694920_qa_5/task.toml index 932e2a76cf62a5e2e3588a9af70d9eccd1b3ba79..baf57b936be6500d48bc9a438655aad00163758e 100644 --- a/tasks/0043_694_43694920_qa_5/task.toml +++ b/tasks/0043_694_43694920_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_720_43720895_qa_2/environment/bootstrap.sh b/tasks/0043_720_43720895_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_720_43720895_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_720_43720895_qa_2/environment/pull_bucket.py b/tasks/0043_720_43720895_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_720_43720895_qa_2/environment/pull_bucket.py +++ b/tasks/0043_720_43720895_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_720_43720895_qa_2/task.toml b/tasks/0043_720_43720895_qa_2/task.toml index eee0260e2e3d915bd5c1ce0a56920f568118dcc9..d8be65f464faf6b66ac3f7f08bebd63ba9906690 100644 --- a/tasks/0043_720_43720895_qa_2/task.toml +++ b/tasks/0043_720_43720895_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_759_43759429_qa_1/environment/bootstrap.sh b/tasks/0043_759_43759429_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_759_43759429_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_759_43759429_qa_1/environment/pull_bucket.py b/tasks/0043_759_43759429_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_759_43759429_qa_1/environment/pull_bucket.py +++ b/tasks/0043_759_43759429_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_759_43759429_qa_1/task.toml b/tasks/0043_759_43759429_qa_1/task.toml index b4d3b3cc1d429e62a6af0288cdbfef1244ebd306..9c4e8b635bc26c0a589f51f33d7778b24cb39ddd 100644 --- a/tasks/0043_759_43759429_qa_1/task.toml +++ b/tasks/0043_759_43759429_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_773_43773059_qa_2/environment/bootstrap.sh b/tasks/0043_773_43773059_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_773_43773059_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_773_43773059_qa_2/environment/pull_bucket.py b/tasks/0043_773_43773059_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_773_43773059_qa_2/environment/pull_bucket.py +++ b/tasks/0043_773_43773059_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_773_43773059_qa_2/task.toml b/tasks/0043_773_43773059_qa_2/task.toml index 1526c0d33e5bcb47f5a82c438f600d7206977e38..1874c507032f02dc90fb7eb28ae20ab1e90d66d1 100644 --- a/tasks/0043_773_43773059_qa_2/task.toml +++ b/tasks/0043_773_43773059_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_773_43773059_qa_4/environment/bootstrap.sh b/tasks/0043_773_43773059_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_773_43773059_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_773_43773059_qa_4/environment/pull_bucket.py b/tasks/0043_773_43773059_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_773_43773059_qa_4/environment/pull_bucket.py +++ b/tasks/0043_773_43773059_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_773_43773059_qa_4/task.toml b/tasks/0043_773_43773059_qa_4/task.toml index 2f072354e5c9e0f2a188529744dcf5c38975e993..7937cb8c81a21f561990cf2c05deb7e970d0d306 100644 --- a/tasks/0043_773_43773059_qa_4/task.toml +++ b/tasks/0043_773_43773059_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_774_43774308_qa_1/environment/bootstrap.sh b/tasks/0043_774_43774308_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_774_43774308_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_774_43774308_qa_1/environment/pull_bucket.py b/tasks/0043_774_43774308_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_774_43774308_qa_1/environment/pull_bucket.py +++ b/tasks/0043_774_43774308_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_774_43774308_qa_1/task.toml b/tasks/0043_774_43774308_qa_1/task.toml index 5cf5ca793a941bbffde498be779dc665c3c6f61b..0a298fd11dc52928893e84dc1ad489d88ad1f9c0 100644 --- a/tasks/0043_774_43774308_qa_1/task.toml +++ b/tasks/0043_774_43774308_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_783_43783786_qa_2/environment/bootstrap.sh b/tasks/0043_783_43783786_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_783_43783786_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_783_43783786_qa_2/environment/pull_bucket.py b/tasks/0043_783_43783786_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_783_43783786_qa_2/environment/pull_bucket.py +++ b/tasks/0043_783_43783786_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_783_43783786_qa_2/task.toml b/tasks/0043_783_43783786_qa_2/task.toml index 8f5620e6bcf72b679550e82ffe0f7d1ca53d921e..2971a8ec03b08f3985c985651d7ed2f472e4c5bd 100644 --- a/tasks/0043_783_43783786_qa_2/task.toml +++ b/tasks/0043_783_43783786_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_783_43783786_qa_3/environment/bootstrap.sh b/tasks/0043_783_43783786_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_783_43783786_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_783_43783786_qa_3/environment/pull_bucket.py b/tasks/0043_783_43783786_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_783_43783786_qa_3/environment/pull_bucket.py +++ b/tasks/0043_783_43783786_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_783_43783786_qa_3/task.toml b/tasks/0043_783_43783786_qa_3/task.toml index c96b5d7e56a75fea6228c3a090b3703449f40b34..c79280944a9fbee4da3eb31be52e2bb391eef6dd 100644 --- a/tasks/0043_783_43783786_qa_3/task.toml +++ b/tasks/0043_783_43783786_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_826_43826331_qa_2/environment/bootstrap.sh b/tasks/0043_826_43826331_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_826_43826331_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_826_43826331_qa_2/environment/pull_bucket.py b/tasks/0043_826_43826331_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_826_43826331_qa_2/environment/pull_bucket.py +++ b/tasks/0043_826_43826331_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_826_43826331_qa_2/task.toml b/tasks/0043_826_43826331_qa_2/task.toml index d44c99089868a36bdc333b5fd77b8335c22256f9..fe032970142957f8f0f1c53c2fb8ac7197f996be 100644 --- a/tasks/0043_826_43826331_qa_2/task.toml +++ b/tasks/0043_826_43826331_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_829_43829102_qa_2/environment/bootstrap.sh b/tasks/0043_829_43829102_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_829_43829102_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_829_43829102_qa_2/environment/pull_bucket.py b/tasks/0043_829_43829102_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_829_43829102_qa_2/environment/pull_bucket.py +++ b/tasks/0043_829_43829102_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_829_43829102_qa_2/task.toml b/tasks/0043_829_43829102_qa_2/task.toml index 3c9927a26db88d653dfb9e519ca953c9a719c0eb..c443303e3dc520b8ff2d814230f346d2d24c2f36 100644 --- a/tasks/0043_829_43829102_qa_2/task.toml +++ b/tasks/0043_829_43829102_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_829_43829102_qa_5/environment/bootstrap.sh b/tasks/0043_829_43829102_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_829_43829102_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_829_43829102_qa_5/environment/pull_bucket.py b/tasks/0043_829_43829102_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_829_43829102_qa_5/environment/pull_bucket.py +++ b/tasks/0043_829_43829102_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_829_43829102_qa_5/task.toml b/tasks/0043_829_43829102_qa_5/task.toml index 916a7fb6b25fc9a3fe77335ace4aab709861c05e..cf91f01602e288f999cc1010b4ff5e813b8a144e 100644 --- a/tasks/0043_829_43829102_qa_5/task.toml +++ b/tasks/0043_829_43829102_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_869_43869885_qa_5/environment/bootstrap.sh b/tasks/0043_869_43869885_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_869_43869885_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_869_43869885_qa_5/environment/pull_bucket.py b/tasks/0043_869_43869885_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_869_43869885_qa_5/environment/pull_bucket.py +++ b/tasks/0043_869_43869885_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_869_43869885_qa_5/task.toml b/tasks/0043_869_43869885_qa_5/task.toml index 9a187e7513c59733b60e4176cfadf5e2a69d208e..e3f5141445fae7dcb702b138f39a3b00fcc2eac7 100644 --- a/tasks/0043_869_43869885_qa_5/task.toml +++ b/tasks/0043_869_43869885_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_889_43889204_qa_5/environment/bootstrap.sh b/tasks/0043_889_43889204_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_889_43889204_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_889_43889204_qa_5/environment/pull_bucket.py b/tasks/0043_889_43889204_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_889_43889204_qa_5/environment/pull_bucket.py +++ b/tasks/0043_889_43889204_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_889_43889204_qa_5/task.toml b/tasks/0043_889_43889204_qa_5/task.toml index 5092d525776daff6df725f3666071c84359eabe2..d9dffce49b6765364fc083e71ffd192cc6a55a3a 100644 --- a/tasks/0043_889_43889204_qa_5/task.toml +++ b/tasks/0043_889_43889204_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_936_43936231_qa_1/environment/bootstrap.sh b/tasks/0043_936_43936231_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_936_43936231_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_936_43936231_qa_1/environment/pull_bucket.py b/tasks/0043_936_43936231_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_936_43936231_qa_1/environment/pull_bucket.py +++ b/tasks/0043_936_43936231_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_936_43936231_qa_1/task.toml b/tasks/0043_936_43936231_qa_1/task.toml index 204c09ad8ed50b351d80cbd4b4036d8535da6677..5ad4eb2891c235039fb72939af560fdccba02e6b 100644 --- a/tasks/0043_936_43936231_qa_1/task.toml +++ b/tasks/0043_936_43936231_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_936_43936231_qa_2/environment/bootstrap.sh b/tasks/0043_936_43936231_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_936_43936231_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_936_43936231_qa_2/environment/pull_bucket.py b/tasks/0043_936_43936231_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_936_43936231_qa_2/environment/pull_bucket.py +++ b/tasks/0043_936_43936231_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_936_43936231_qa_2/task.toml b/tasks/0043_936_43936231_qa_2/task.toml index f957a3cc3702256bcbc2ec7fb1714a2ca7ea107e..1b7a346699b58f443f2cbce2ec15a88e9d711476 100644 --- a/tasks/0043_936_43936231_qa_2/task.toml +++ b/tasks/0043_936_43936231_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_936_43936231_qa_3/environment/bootstrap.sh b/tasks/0043_936_43936231_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_936_43936231_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_936_43936231_qa_3/environment/pull_bucket.py b/tasks/0043_936_43936231_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_936_43936231_qa_3/environment/pull_bucket.py +++ b/tasks/0043_936_43936231_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_936_43936231_qa_3/task.toml b/tasks/0043_936_43936231_qa_3/task.toml index 4b371f5bf41170b10b35901584160e05597ed106..40eeb22612ea3be4e25dc6438652ca62e68b1162 100644 --- a/tasks/0043_936_43936231_qa_3/task.toml +++ b/tasks/0043_936_43936231_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_969_43969595_qa_4/environment/bootstrap.sh b/tasks/0043_969_43969595_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_969_43969595_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_969_43969595_qa_4/environment/pull_bucket.py b/tasks/0043_969_43969595_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_969_43969595_qa_4/environment/pull_bucket.py +++ b/tasks/0043_969_43969595_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_969_43969595_qa_4/task.toml b/tasks/0043_969_43969595_qa_4/task.toml index 6e83b787e954b30ad679069de3075532cc4876ce..7992ad6ce946b68c897b362bccf2cdcb5da81061 100644 --- a/tasks/0043_969_43969595_qa_4/task.toml +++ b/tasks/0043_969_43969595_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0043_969_43969595_qa_5/environment/bootstrap.sh b/tasks/0043_969_43969595_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0043_969_43969595_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0043_969_43969595_qa_5/environment/pull_bucket.py b/tasks/0043_969_43969595_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0043_969_43969595_qa_5/environment/pull_bucket.py +++ b/tasks/0043_969_43969595_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0043_969_43969595_qa_5/task.toml b/tasks/0043_969_43969595_qa_5/task.toml index 8d09f8812681bf8f54cb4cd122fc17a160d783c9..ce3d79062ef2447d408db8db61acaf6d1f3d3077 100644 --- a/tasks/0043_969_43969595_qa_5/task.toml +++ b/tasks/0043_969_43969595_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_001_44001840_qa_1/environment/bootstrap.sh b/tasks/0044_001_44001840_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_001_44001840_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_001_44001840_qa_1/environment/pull_bucket.py b/tasks/0044_001_44001840_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_001_44001840_qa_1/environment/pull_bucket.py +++ b/tasks/0044_001_44001840_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_001_44001840_qa_1/task.toml b/tasks/0044_001_44001840_qa_1/task.toml index 41d492bfddef3228d21253d9dff729adf5874ae1..82b0050cb40a63cae6b3c107c1a33fe931ac6bdf 100644 --- a/tasks/0044_001_44001840_qa_1/task.toml +++ b/tasks/0044_001_44001840_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_103_44103052_qa_1/environment/bootstrap.sh b/tasks/0044_103_44103052_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_103_44103052_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_103_44103052_qa_1/environment/pull_bucket.py b/tasks/0044_103_44103052_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_103_44103052_qa_1/environment/pull_bucket.py +++ b/tasks/0044_103_44103052_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_103_44103052_qa_1/task.toml b/tasks/0044_103_44103052_qa_1/task.toml index 67a3cf415852159a838b5a47a17e48aa99c38959..48c866cbf98a50c0c264b45c2c529f88c8e0f50e 100644 --- a/tasks/0044_103_44103052_qa_1/task.toml +++ b/tasks/0044_103_44103052_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_103_44103052_qa_5/environment/bootstrap.sh b/tasks/0044_103_44103052_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_103_44103052_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_103_44103052_qa_5/environment/pull_bucket.py b/tasks/0044_103_44103052_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_103_44103052_qa_5/environment/pull_bucket.py +++ b/tasks/0044_103_44103052_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_103_44103052_qa_5/task.toml b/tasks/0044_103_44103052_qa_5/task.toml index b4817389f4ab56c14bd44024fe6487f00c2398f7..a88b537d98205da0723af09ecc9ab15113bf548f 100644 --- a/tasks/0044_103_44103052_qa_5/task.toml +++ b/tasks/0044_103_44103052_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_107_44107622_qa_1/environment/bootstrap.sh b/tasks/0044_107_44107622_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_107_44107622_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_107_44107622_qa_1/environment/pull_bucket.py b/tasks/0044_107_44107622_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_107_44107622_qa_1/environment/pull_bucket.py +++ b/tasks/0044_107_44107622_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_107_44107622_qa_1/task.toml b/tasks/0044_107_44107622_qa_1/task.toml index bb86871a8f7f31176bd0e2de61690cb5abca32ea..ffbbafbaf5f1fcea8fd75155479ecc0168cadded 100644 --- a/tasks/0044_107_44107622_qa_1/task.toml +++ b/tasks/0044_107_44107622_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_107_44107622_qa_5/environment/bootstrap.sh b/tasks/0044_107_44107622_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_107_44107622_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_107_44107622_qa_5/environment/pull_bucket.py b/tasks/0044_107_44107622_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_107_44107622_qa_5/environment/pull_bucket.py +++ b/tasks/0044_107_44107622_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_107_44107622_qa_5/task.toml b/tasks/0044_107_44107622_qa_5/task.toml index 8bcb26c2b5159643f7dba641a0a22f99130777af..90f31c8929e603ba3e92341e9b57cc3c64f4cfa0 100644 --- a/tasks/0044_107_44107622_qa_5/task.toml +++ b/tasks/0044_107_44107622_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_141_44141679_qa_3/environment/bootstrap.sh b/tasks/0044_141_44141679_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_141_44141679_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_141_44141679_qa_3/environment/pull_bucket.py b/tasks/0044_141_44141679_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_141_44141679_qa_3/environment/pull_bucket.py +++ b/tasks/0044_141_44141679_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_141_44141679_qa_3/task.toml b/tasks/0044_141_44141679_qa_3/task.toml index aff738f8602b9ab64505a0c542cc33f41802fb29..878425c34f5b55e637550e68714742d9635013e6 100644 --- a/tasks/0044_141_44141679_qa_3/task.toml +++ b/tasks/0044_141_44141679_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_153_44153291_qa_2/environment/bootstrap.sh b/tasks/0044_153_44153291_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_153_44153291_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_153_44153291_qa_2/environment/pull_bucket.py b/tasks/0044_153_44153291_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_153_44153291_qa_2/environment/pull_bucket.py +++ b/tasks/0044_153_44153291_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_153_44153291_qa_2/task.toml b/tasks/0044_153_44153291_qa_2/task.toml index bf32c2a6795d7eb62e52019de5a3ea2ef347ce78..2043c8515b70be77419617359d7a678afc329a79 100644 --- a/tasks/0044_153_44153291_qa_2/task.toml +++ b/tasks/0044_153_44153291_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_153_44153291_qa_4/environment/bootstrap.sh b/tasks/0044_153_44153291_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_153_44153291_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_153_44153291_qa_4/environment/pull_bucket.py b/tasks/0044_153_44153291_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_153_44153291_qa_4/environment/pull_bucket.py +++ b/tasks/0044_153_44153291_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_153_44153291_qa_4/task.toml b/tasks/0044_153_44153291_qa_4/task.toml index 298dbbf4f19f3066515a226d92ec63ac65bfc297..9f43ac01e28f57b4dc51233e8ec1eef4d07fe8a4 100644 --- a/tasks/0044_153_44153291_qa_4/task.toml +++ b/tasks/0044_153_44153291_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_155_44155408_qa_1/environment/bootstrap.sh b/tasks/0044_155_44155408_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_155_44155408_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_155_44155408_qa_1/environment/pull_bucket.py b/tasks/0044_155_44155408_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_155_44155408_qa_1/environment/pull_bucket.py +++ b/tasks/0044_155_44155408_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_155_44155408_qa_1/task.toml b/tasks/0044_155_44155408_qa_1/task.toml index d506b0029828c1a8bce875b2e6ae30caa522dc98..8defe1d1d25af21b073587a0b6b2dc8a32045a53 100644 --- a/tasks/0044_155_44155408_qa_1/task.toml +++ b/tasks/0044_155_44155408_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_155_44155408_qa_2/environment/bootstrap.sh b/tasks/0044_155_44155408_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_155_44155408_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_155_44155408_qa_2/environment/pull_bucket.py b/tasks/0044_155_44155408_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_155_44155408_qa_2/environment/pull_bucket.py +++ b/tasks/0044_155_44155408_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_155_44155408_qa_2/task.toml b/tasks/0044_155_44155408_qa_2/task.toml index 346aaccb1248765914ee5ab50b4900ab6305f595..fb2213a1f0f8a65dc020ba75b9a7b5f89dbffbd9 100644 --- a/tasks/0044_155_44155408_qa_2/task.toml +++ b/tasks/0044_155_44155408_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_175_44175301_qa_3/environment/bootstrap.sh b/tasks/0044_175_44175301_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_175_44175301_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_175_44175301_qa_3/environment/pull_bucket.py b/tasks/0044_175_44175301_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_175_44175301_qa_3/environment/pull_bucket.py +++ b/tasks/0044_175_44175301_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_175_44175301_qa_3/task.toml b/tasks/0044_175_44175301_qa_3/task.toml index eedc9f948c3443c38c8e13edf2f832cbc36a21b1..bf883b2e235ff9ac5e722d2d42ab3230af6331bd 100644 --- a/tasks/0044_175_44175301_qa_3/task.toml +++ b/tasks/0044_175_44175301_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_193_44193489_qa_1/environment/bootstrap.sh b/tasks/0044_193_44193489_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_193_44193489_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_193_44193489_qa_1/environment/pull_bucket.py b/tasks/0044_193_44193489_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_193_44193489_qa_1/environment/pull_bucket.py +++ b/tasks/0044_193_44193489_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_193_44193489_qa_1/task.toml b/tasks/0044_193_44193489_qa_1/task.toml index f5d67862f40109ad06fc4f6a07c084235df1c6c9..73fd16425c4c02b514ecaf127093d443592605e3 100644 --- a/tasks/0044_193_44193489_qa_1/task.toml +++ b/tasks/0044_193_44193489_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_251_44251119_qa_3/environment/bootstrap.sh b/tasks/0044_251_44251119_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_251_44251119_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_251_44251119_qa_3/environment/pull_bucket.py b/tasks/0044_251_44251119_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_251_44251119_qa_3/environment/pull_bucket.py +++ b/tasks/0044_251_44251119_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_251_44251119_qa_3/task.toml b/tasks/0044_251_44251119_qa_3/task.toml index 7aaa224a236f78f705c2acd64a9e98f99fc8440f..686ded3dc02981ae92cca9d37bdcd6070f7d8084 100644 --- a/tasks/0044_251_44251119_qa_3/task.toml +++ b/tasks/0044_251_44251119_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_270_44270596_qa_1/environment/bootstrap.sh b/tasks/0044_270_44270596_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_270_44270596_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_270_44270596_qa_1/environment/pull_bucket.py b/tasks/0044_270_44270596_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_270_44270596_qa_1/environment/pull_bucket.py +++ b/tasks/0044_270_44270596_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_270_44270596_qa_1/task.toml b/tasks/0044_270_44270596_qa_1/task.toml index 3c0b01f9ad3121076c1f1f7df1b96dfd0536e00d..7ff022ad02408b1161dcbb2f8c2723c77e62ec9d 100644 --- a/tasks/0044_270_44270596_qa_1/task.toml +++ b/tasks/0044_270_44270596_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_270_44270596_qa_4/environment/bootstrap.sh b/tasks/0044_270_44270596_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_270_44270596_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_270_44270596_qa_4/environment/pull_bucket.py b/tasks/0044_270_44270596_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_270_44270596_qa_4/environment/pull_bucket.py +++ b/tasks/0044_270_44270596_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_270_44270596_qa_4/task.toml b/tasks/0044_270_44270596_qa_4/task.toml index 886d05e57021a63af2b13191cbda6fb792601e46..c34b17281abe6adfbcb2f864c2e8389fe1c31778 100644 --- a/tasks/0044_270_44270596_qa_4/task.toml +++ b/tasks/0044_270_44270596_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_352_44352035_qa_4/environment/bootstrap.sh b/tasks/0044_352_44352035_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_352_44352035_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_352_44352035_qa_4/environment/pull_bucket.py b/tasks/0044_352_44352035_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_352_44352035_qa_4/environment/pull_bucket.py +++ b/tasks/0044_352_44352035_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_352_44352035_qa_4/task.toml b/tasks/0044_352_44352035_qa_4/task.toml index 891f10edd6391a9e14804c2afcc03d1faebabfff..c55cf7d5124be80b086de6994e64503950d24c59 100644 --- a/tasks/0044_352_44352035_qa_4/task.toml +++ b/tasks/0044_352_44352035_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_352_44352035_qa_5/environment/bootstrap.sh b/tasks/0044_352_44352035_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_352_44352035_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_352_44352035_qa_5/environment/pull_bucket.py b/tasks/0044_352_44352035_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_352_44352035_qa_5/environment/pull_bucket.py +++ b/tasks/0044_352_44352035_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_352_44352035_qa_5/task.toml b/tasks/0044_352_44352035_qa_5/task.toml index 0d65a683cc1f787b431344290f47d0c2df1a2fd5..049fbfcef543202de17729fc024f1288ccc3fcbb 100644 --- a/tasks/0044_352_44352035_qa_5/task.toml +++ b/tasks/0044_352_44352035_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_367_44367279_qa_2/environment/bootstrap.sh b/tasks/0044_367_44367279_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_367_44367279_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_367_44367279_qa_2/environment/pull_bucket.py b/tasks/0044_367_44367279_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_367_44367279_qa_2/environment/pull_bucket.py +++ b/tasks/0044_367_44367279_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_367_44367279_qa_2/task.toml b/tasks/0044_367_44367279_qa_2/task.toml index 1e2667799f61fb0e806b749368f553be36fdddba..56e1c9ae410daae590f7ca9975cd120833d96b1b 100644 --- a/tasks/0044_367_44367279_qa_2/task.toml +++ b/tasks/0044_367_44367279_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_367_44367279_qa_3/environment/bootstrap.sh b/tasks/0044_367_44367279_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_367_44367279_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_367_44367279_qa_3/environment/pull_bucket.py b/tasks/0044_367_44367279_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_367_44367279_qa_3/environment/pull_bucket.py +++ b/tasks/0044_367_44367279_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_367_44367279_qa_3/task.toml b/tasks/0044_367_44367279_qa_3/task.toml index b5225ea5991c364999f369035c08398c171545ad..c31a7ff49f0cd5f22ed53ab54697b57ed7d77ebe 100644 --- a/tasks/0044_367_44367279_qa_3/task.toml +++ b/tasks/0044_367_44367279_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_367_44367279_qa_5/environment/bootstrap.sh b/tasks/0044_367_44367279_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_367_44367279_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_367_44367279_qa_5/environment/pull_bucket.py b/tasks/0044_367_44367279_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_367_44367279_qa_5/environment/pull_bucket.py +++ b/tasks/0044_367_44367279_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_367_44367279_qa_5/task.toml b/tasks/0044_367_44367279_qa_5/task.toml index 689cc5f7bb8b57b3c38d07fb3230ae16dacc3e4f..5f0538d2bdbe3a16e5e3576c998f7c761635efcf 100644 --- a/tasks/0044_367_44367279_qa_5/task.toml +++ b/tasks/0044_367_44367279_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_401_44401900_qa_2/environment/bootstrap.sh b/tasks/0044_401_44401900_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_401_44401900_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_401_44401900_qa_2/environment/pull_bucket.py b/tasks/0044_401_44401900_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_401_44401900_qa_2/environment/pull_bucket.py +++ b/tasks/0044_401_44401900_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_401_44401900_qa_2/task.toml b/tasks/0044_401_44401900_qa_2/task.toml index cc9cea7edd3ddcc1de5cd5a89835959aa6e191aa..0cf5100e4dd3ea2ecf8e8c619994d8e647b66cbb 100644 --- a/tasks/0044_401_44401900_qa_2/task.toml +++ b/tasks/0044_401_44401900_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_401_44401900_qa_3/environment/bootstrap.sh b/tasks/0044_401_44401900_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_401_44401900_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_401_44401900_qa_3/environment/pull_bucket.py b/tasks/0044_401_44401900_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_401_44401900_qa_3/environment/pull_bucket.py +++ b/tasks/0044_401_44401900_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_401_44401900_qa_3/task.toml b/tasks/0044_401_44401900_qa_3/task.toml index 82f0f422b9ab28fe301d5e7b1a99efca56bfa025..fdb837037715acd30f65f020322cf2e1f5237d12 100644 --- a/tasks/0044_401_44401900_qa_3/task.toml +++ b/tasks/0044_401_44401900_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_406_44406244_qa_1/environment/bootstrap.sh b/tasks/0044_406_44406244_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_406_44406244_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_406_44406244_qa_1/environment/pull_bucket.py b/tasks/0044_406_44406244_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_406_44406244_qa_1/environment/pull_bucket.py +++ b/tasks/0044_406_44406244_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_406_44406244_qa_1/task.toml b/tasks/0044_406_44406244_qa_1/task.toml index dd91ab3632e46e8537ea0b48b7b828b467579ac7..35043c5b94750ed855d55f91c4e0a9eeb7f5b93b 100644 --- a/tasks/0044_406_44406244_qa_1/task.toml +++ b/tasks/0044_406_44406244_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_406_44406244_qa_5/environment/bootstrap.sh b/tasks/0044_406_44406244_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_406_44406244_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_406_44406244_qa_5/environment/pull_bucket.py b/tasks/0044_406_44406244_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_406_44406244_qa_5/environment/pull_bucket.py +++ b/tasks/0044_406_44406244_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_406_44406244_qa_5/task.toml b/tasks/0044_406_44406244_qa_5/task.toml index 02d91d6f1eaea40119e1c54e33205f0c0ed7f996..3e1c0cc74bf8bb192229cfff46e05264e17aab9e 100644 --- a/tasks/0044_406_44406244_qa_5/task.toml +++ b/tasks/0044_406_44406244_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_412_44412230_qa_1/environment/bootstrap.sh b/tasks/0044_412_44412230_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_412_44412230_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_412_44412230_qa_1/environment/pull_bucket.py b/tasks/0044_412_44412230_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_412_44412230_qa_1/environment/pull_bucket.py +++ b/tasks/0044_412_44412230_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_412_44412230_qa_1/task.toml b/tasks/0044_412_44412230_qa_1/task.toml index 0f0cbbe055336dbc6cb383c7b7899880cdb5b982..a5e3800cf6fc434621726b83dfe2c30d1e8e412e 100644 --- a/tasks/0044_412_44412230_qa_1/task.toml +++ b/tasks/0044_412_44412230_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_466_44466723_qa_4/environment/bootstrap.sh b/tasks/0044_466_44466723_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_466_44466723_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_466_44466723_qa_4/environment/pull_bucket.py b/tasks/0044_466_44466723_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_466_44466723_qa_4/environment/pull_bucket.py +++ b/tasks/0044_466_44466723_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_466_44466723_qa_4/task.toml b/tasks/0044_466_44466723_qa_4/task.toml index 7861205ab4888e58adc640f944fafcbaf6c091c1..5740ce69053b72ebe0c7ca8ca3a627bc6a053952 100644 --- a/tasks/0044_466_44466723_qa_4/task.toml +++ b/tasks/0044_466_44466723_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_466_44466723_qa_5/environment/bootstrap.sh b/tasks/0044_466_44466723_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_466_44466723_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_466_44466723_qa_5/environment/pull_bucket.py b/tasks/0044_466_44466723_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_466_44466723_qa_5/environment/pull_bucket.py +++ b/tasks/0044_466_44466723_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_466_44466723_qa_5/task.toml b/tasks/0044_466_44466723_qa_5/task.toml index 99148cea1f2e200895ebef259d3fd2f3bd27761e..4fa43806f618a4f854a9500694e84edbe21af33b 100644 --- a/tasks/0044_466_44466723_qa_5/task.toml +++ b/tasks/0044_466_44466723_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_505_44505990_qa_5/environment/bootstrap.sh b/tasks/0044_505_44505990_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_505_44505990_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_505_44505990_qa_5/environment/pull_bucket.py b/tasks/0044_505_44505990_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_505_44505990_qa_5/environment/pull_bucket.py +++ b/tasks/0044_505_44505990_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_505_44505990_qa_5/task.toml b/tasks/0044_505_44505990_qa_5/task.toml index 0a632cc8eaddd8acc486fc0528cd7ce10b3076fa..5cb0eefd96f7972f0acbfedc9305b22b0091ad08 100644 --- a/tasks/0044_505_44505990_qa_5/task.toml +++ b/tasks/0044_505_44505990_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_572_44572407_qa_4/environment/bootstrap.sh b/tasks/0044_572_44572407_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_572_44572407_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_572_44572407_qa_4/environment/pull_bucket.py b/tasks/0044_572_44572407_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_572_44572407_qa_4/environment/pull_bucket.py +++ b/tasks/0044_572_44572407_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_572_44572407_qa_4/task.toml b/tasks/0044_572_44572407_qa_4/task.toml index 565fcfc338ab59f6df9cf5188a9a94d625ee9909..bbb0ff2519c2927255a6f7c452a9054482cd07a0 100644 --- a/tasks/0044_572_44572407_qa_4/task.toml +++ b/tasks/0044_572_44572407_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_575_44575268_qa_1/environment/bootstrap.sh b/tasks/0044_575_44575268_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_575_44575268_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_575_44575268_qa_1/environment/pull_bucket.py b/tasks/0044_575_44575268_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_575_44575268_qa_1/environment/pull_bucket.py +++ b/tasks/0044_575_44575268_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_575_44575268_qa_1/task.toml b/tasks/0044_575_44575268_qa_1/task.toml index cb75c1c70ac975567cf9625db58d95a39a8e7cd8..8a24365b210319a843c576749b6a1431ab513758 100644 --- a/tasks/0044_575_44575268_qa_1/task.toml +++ b/tasks/0044_575_44575268_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_575_44575651_qa_2/environment/bootstrap.sh b/tasks/0044_575_44575651_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_575_44575651_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_575_44575651_qa_2/environment/pull_bucket.py b/tasks/0044_575_44575651_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_575_44575651_qa_2/environment/pull_bucket.py +++ b/tasks/0044_575_44575651_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_575_44575651_qa_2/task.toml b/tasks/0044_575_44575651_qa_2/task.toml index 9e1f75a01e74511695984d524691f0f3c5fed1df..9b631ebf6370751f4cf3b68276213feabba57c1e 100644 --- a/tasks/0044_575_44575651_qa_2/task.toml +++ b/tasks/0044_575_44575651_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_575_44575651_qa_3/environment/bootstrap.sh b/tasks/0044_575_44575651_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_575_44575651_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_575_44575651_qa_3/environment/pull_bucket.py b/tasks/0044_575_44575651_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_575_44575651_qa_3/environment/pull_bucket.py +++ b/tasks/0044_575_44575651_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_575_44575651_qa_3/task.toml b/tasks/0044_575_44575651_qa_3/task.toml index ad5403723d8f34d6abe6016e9917c981216d6051..6a6d4ceb37c2497692de36dcff1c149c24ba426d 100644 --- a/tasks/0044_575_44575651_qa_3/task.toml +++ b/tasks/0044_575_44575651_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_609_44609132_qa_3/environment/bootstrap.sh b/tasks/0044_609_44609132_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_609_44609132_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_609_44609132_qa_3/environment/pull_bucket.py b/tasks/0044_609_44609132_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_609_44609132_qa_3/environment/pull_bucket.py +++ b/tasks/0044_609_44609132_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_609_44609132_qa_3/task.toml b/tasks/0044_609_44609132_qa_3/task.toml index 8ea6a174ef5e705cbadce0055a715fb8b1ddebfc..c63ecba4c857a88b304cffdde20cdb38aaa31d01 100644 --- a/tasks/0044_609_44609132_qa_3/task.toml +++ b/tasks/0044_609_44609132_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_708_44708511_qa_4/environment/bootstrap.sh b/tasks/0044_708_44708511_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_708_44708511_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_708_44708511_qa_4/environment/pull_bucket.py b/tasks/0044_708_44708511_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_708_44708511_qa_4/environment/pull_bucket.py +++ b/tasks/0044_708_44708511_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_708_44708511_qa_4/task.toml b/tasks/0044_708_44708511_qa_4/task.toml index 47a632a07fcf7eecbb243e0f88ebacb0d7471de8..8850ac048cc52a70a03059d913a20c22cbecbac1 100644 --- a/tasks/0044_708_44708511_qa_4/task.toml +++ b/tasks/0044_708_44708511_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_721_44721454_qa_1/environment/bootstrap.sh b/tasks/0044_721_44721454_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_721_44721454_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_721_44721454_qa_1/environment/pull_bucket.py b/tasks/0044_721_44721454_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_721_44721454_qa_1/environment/pull_bucket.py +++ b/tasks/0044_721_44721454_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_721_44721454_qa_1/task.toml b/tasks/0044_721_44721454_qa_1/task.toml index 8067dd487f4689873acfd610dfa204507cc99224..3d6a30513fcec9b71369c3ce533edff83f44ed07 100644 --- a/tasks/0044_721_44721454_qa_1/task.toml +++ b/tasks/0044_721_44721454_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_727_44727189_qa_1/environment/bootstrap.sh b/tasks/0044_727_44727189_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_727_44727189_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_727_44727189_qa_1/environment/pull_bucket.py b/tasks/0044_727_44727189_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_727_44727189_qa_1/environment/pull_bucket.py +++ b/tasks/0044_727_44727189_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_727_44727189_qa_1/task.toml b/tasks/0044_727_44727189_qa_1/task.toml index 4324a7b6e4f1c96a42ed565ae8c6cf980b842cc4..57f5a5d74cbf3ce345004492238ac8e66433d15e 100644 --- a/tasks/0044_727_44727189_qa_1/task.toml +++ b/tasks/0044_727_44727189_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_766_44766802_qa_2/environment/bootstrap.sh b/tasks/0044_766_44766802_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_766_44766802_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_766_44766802_qa_2/environment/pull_bucket.py b/tasks/0044_766_44766802_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_766_44766802_qa_2/environment/pull_bucket.py +++ b/tasks/0044_766_44766802_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_766_44766802_qa_2/task.toml b/tasks/0044_766_44766802_qa_2/task.toml index aba2662c5edcc39ea852c430421b76af29e86565..ff7ffea3c36e8ef6dc02447fc4ba8ba6363f83f1 100644 --- a/tasks/0044_766_44766802_qa_2/task.toml +++ b/tasks/0044_766_44766802_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_860_44860367_qa_5/environment/bootstrap.sh b/tasks/0044_860_44860367_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_860_44860367_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_860_44860367_qa_5/environment/pull_bucket.py b/tasks/0044_860_44860367_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_860_44860367_qa_5/environment/pull_bucket.py +++ b/tasks/0044_860_44860367_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_860_44860367_qa_5/task.toml b/tasks/0044_860_44860367_qa_5/task.toml index 49793b3e89257758fdd45c965539d63e67ff9d45..9dfe5d871764da21d5b4646b46d46e1cbe3a7d25 100644 --- a/tasks/0044_860_44860367_qa_5/task.toml +++ b/tasks/0044_860_44860367_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_867_44867555_qa_3/environment/bootstrap.sh b/tasks/0044_867_44867555_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_867_44867555_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_867_44867555_qa_3/environment/pull_bucket.py b/tasks/0044_867_44867555_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_867_44867555_qa_3/environment/pull_bucket.py +++ b/tasks/0044_867_44867555_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_867_44867555_qa_3/task.toml b/tasks/0044_867_44867555_qa_3/task.toml index ff2524a8a2b77af0eafece3d2ede0a83b934410d..485fccc9c6d38ec218e7c59c477b60f7603bde44 100644 --- a/tasks/0044_867_44867555_qa_3/task.toml +++ b/tasks/0044_867_44867555_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_867_44867555_qa_4/environment/bootstrap.sh b/tasks/0044_867_44867555_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_867_44867555_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_867_44867555_qa_4/environment/pull_bucket.py b/tasks/0044_867_44867555_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_867_44867555_qa_4/environment/pull_bucket.py +++ b/tasks/0044_867_44867555_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_867_44867555_qa_4/task.toml b/tasks/0044_867_44867555_qa_4/task.toml index add76f38ee9ae592a4b78c5ea7bbc61a420a8edf..e7dd19cc750887885b5ded7f9161df118fe0b72c 100644 --- a/tasks/0044_867_44867555_qa_4/task.toml +++ b/tasks/0044_867_44867555_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_869_44869617_qa_3/environment/bootstrap.sh b/tasks/0044_869_44869617_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_869_44869617_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_869_44869617_qa_3/environment/pull_bucket.py b/tasks/0044_869_44869617_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_869_44869617_qa_3/environment/pull_bucket.py +++ b/tasks/0044_869_44869617_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_869_44869617_qa_3/task.toml b/tasks/0044_869_44869617_qa_3/task.toml index d936adc78defd7db0f47db40d13387adccfa6b50..5a322ce46547bb3f76dec1d3e2b0cf24a1276bb4 100644 --- a/tasks/0044_869_44869617_qa_3/task.toml +++ b/tasks/0044_869_44869617_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_873_44873237_qa_3/environment/bootstrap.sh b/tasks/0044_873_44873237_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_873_44873237_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_873_44873237_qa_3/environment/pull_bucket.py b/tasks/0044_873_44873237_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_873_44873237_qa_3/environment/pull_bucket.py +++ b/tasks/0044_873_44873237_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_873_44873237_qa_3/task.toml b/tasks/0044_873_44873237_qa_3/task.toml index 423731e44dff66f58fa57c276792af43510371fe..8c637530a321d0389543a46c49d624f48c279ca1 100644 --- a/tasks/0044_873_44873237_qa_3/task.toml +++ b/tasks/0044_873_44873237_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_954_44954372_qa_1/environment/bootstrap.sh b/tasks/0044_954_44954372_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_954_44954372_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_954_44954372_qa_1/environment/pull_bucket.py b/tasks/0044_954_44954372_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_954_44954372_qa_1/environment/pull_bucket.py +++ b/tasks/0044_954_44954372_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_954_44954372_qa_1/task.toml b/tasks/0044_954_44954372_qa_1/task.toml index b1474404c072e6b9f7c14d96980f62ba342d0fae..e509a5e789fcc84de32be6a0af29fbf9dd2a3216 100644 --- a/tasks/0044_954_44954372_qa_1/task.toml +++ b/tasks/0044_954_44954372_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_954_44954372_qa_2/environment/bootstrap.sh b/tasks/0044_954_44954372_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_954_44954372_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_954_44954372_qa_2/environment/pull_bucket.py b/tasks/0044_954_44954372_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_954_44954372_qa_2/environment/pull_bucket.py +++ b/tasks/0044_954_44954372_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_954_44954372_qa_2/task.toml b/tasks/0044_954_44954372_qa_2/task.toml index 02f6288a6b8979abac6a9f0583b0caa4d78bdb3b..d8fa996731ecde3cb63b04079ff8069dbb04d705 100644 --- a/tasks/0044_954_44954372_qa_2/task.toml +++ b/tasks/0044_954_44954372_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_977_44977269_qa_5/environment/bootstrap.sh b/tasks/0044_977_44977269_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_977_44977269_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_977_44977269_qa_5/environment/pull_bucket.py b/tasks/0044_977_44977269_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_977_44977269_qa_5/environment/pull_bucket.py +++ b/tasks/0044_977_44977269_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_977_44977269_qa_5/task.toml b/tasks/0044_977_44977269_qa_5/task.toml index c1b0d9c6cac9e48ea103b79912624e6dd3956860..49a9ce880cac9b88700fe8caff63b26a0e35f302 100644 --- a/tasks/0044_977_44977269_qa_5/task.toml +++ b/tasks/0044_977_44977269_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_988_44988061_qa_5/environment/bootstrap.sh b/tasks/0044_988_44988061_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_988_44988061_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_988_44988061_qa_5/environment/pull_bucket.py b/tasks/0044_988_44988061_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_988_44988061_qa_5/environment/pull_bucket.py +++ b/tasks/0044_988_44988061_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_988_44988061_qa_5/task.toml b/tasks/0044_988_44988061_qa_5/task.toml index e8a4c80cd0e771ff7162f5c69aae32d31c477ccd..21f20dbd1dc3658fc02e0ae66124794655a529be 100644 --- a/tasks/0044_988_44988061_qa_5/task.toml +++ b/tasks/0044_988_44988061_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0044_993_44993292_qa_1/environment/bootstrap.sh b/tasks/0044_993_44993292_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0044_993_44993292_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0044_993_44993292_qa_1/environment/pull_bucket.py b/tasks/0044_993_44993292_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0044_993_44993292_qa_1/environment/pull_bucket.py +++ b/tasks/0044_993_44993292_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0044_993_44993292_qa_1/task.toml b/tasks/0044_993_44993292_qa_1/task.toml index 2da6d4e55e20bb690e9151c10631ffb1509ced6f..1f7ad1dc7a3421a989d343cfed2a4ce1696c18c3 100644 --- a/tasks/0044_993_44993292_qa_1/task.toml +++ b/tasks/0044_993_44993292_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_006_45006527_qa_2/environment/bootstrap.sh b/tasks/0045_006_45006527_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_006_45006527_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_006_45006527_qa_2/environment/pull_bucket.py b/tasks/0045_006_45006527_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_006_45006527_qa_2/environment/pull_bucket.py +++ b/tasks/0045_006_45006527_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_006_45006527_qa_2/task.toml b/tasks/0045_006_45006527_qa_2/task.toml index b2f6108d05fd10e8bb49b8f961714e9ff4500501..0153d0743a190dddd638671f86e8e53590e6f7b7 100644 --- a/tasks/0045_006_45006527_qa_2/task.toml +++ b/tasks/0045_006_45006527_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_024_45024257_qa_3/environment/bootstrap.sh b/tasks/0045_024_45024257_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_024_45024257_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_024_45024257_qa_3/environment/pull_bucket.py b/tasks/0045_024_45024257_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_024_45024257_qa_3/environment/pull_bucket.py +++ b/tasks/0045_024_45024257_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_024_45024257_qa_3/task.toml b/tasks/0045_024_45024257_qa_3/task.toml index 705dcb6a99857c84c6765089a116c61a5f859e5e..d0f427c4f419b93d3bb91ca412ef66223c5ecefc 100644 --- a/tasks/0045_024_45024257_qa_3/task.toml +++ b/tasks/0045_024_45024257_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_024_45024257_qa_5/environment/bootstrap.sh b/tasks/0045_024_45024257_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_024_45024257_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_024_45024257_qa_5/environment/pull_bucket.py b/tasks/0045_024_45024257_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_024_45024257_qa_5/environment/pull_bucket.py +++ b/tasks/0045_024_45024257_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_024_45024257_qa_5/task.toml b/tasks/0045_024_45024257_qa_5/task.toml index bae27c149066f37914758c8beb43fb916a0d149b..1a2b1aed2f64ff7d370aabb0bf1ed40a0c069602 100644 --- a/tasks/0045_024_45024257_qa_5/task.toml +++ b/tasks/0045_024_45024257_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_032_45032719_qa_5/environment/bootstrap.sh b/tasks/0045_032_45032719_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_032_45032719_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_032_45032719_qa_5/environment/pull_bucket.py b/tasks/0045_032_45032719_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_032_45032719_qa_5/environment/pull_bucket.py +++ b/tasks/0045_032_45032719_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_032_45032719_qa_5/task.toml b/tasks/0045_032_45032719_qa_5/task.toml index f5e3fe310306a8b7f1bb0de1632bcfc4e3a9e598..bd86a3d01b7772d6415569c1d7d97746876bc8d1 100644 --- a/tasks/0045_032_45032719_qa_5/task.toml +++ b/tasks/0045_032_45032719_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_056_45056822_qa_5/environment/bootstrap.sh b/tasks/0045_056_45056822_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_056_45056822_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_056_45056822_qa_5/environment/pull_bucket.py b/tasks/0045_056_45056822_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_056_45056822_qa_5/environment/pull_bucket.py +++ b/tasks/0045_056_45056822_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_056_45056822_qa_5/task.toml b/tasks/0045_056_45056822_qa_5/task.toml index e5cf488846bbb9a98d86751a2cccb3122b68863a..df0c248edf84a3bdddf19b7dc5b92b7f573eadd2 100644 --- a/tasks/0045_056_45056822_qa_5/task.toml +++ b/tasks/0045_056_45056822_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_065_45065521_qa_2/environment/bootstrap.sh b/tasks/0045_065_45065521_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_065_45065521_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_065_45065521_qa_2/environment/pull_bucket.py b/tasks/0045_065_45065521_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_065_45065521_qa_2/environment/pull_bucket.py +++ b/tasks/0045_065_45065521_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_065_45065521_qa_2/task.toml b/tasks/0045_065_45065521_qa_2/task.toml index 22331a0408ce1308015ac2de456d64a1e9817545..cc58670d864fef042a0562306b6bb74d8cd0b723 100644 --- a/tasks/0045_065_45065521_qa_2/task.toml +++ b/tasks/0045_065_45065521_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_067_45067031_qa_3/environment/bootstrap.sh b/tasks/0045_067_45067031_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_067_45067031_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_067_45067031_qa_3/environment/pull_bucket.py b/tasks/0045_067_45067031_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_067_45067031_qa_3/environment/pull_bucket.py +++ b/tasks/0045_067_45067031_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_067_45067031_qa_3/task.toml b/tasks/0045_067_45067031_qa_3/task.toml index 7b6d2b170f3d3140c30e7ad5e1a932dad7dff769..3fe0d68c8778a80ec58b519adfdc6d65e8d0559e 100644 --- a/tasks/0045_067_45067031_qa_3/task.toml +++ b/tasks/0045_067_45067031_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_071_45071899_qa_5/environment/bootstrap.sh b/tasks/0045_071_45071899_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_071_45071899_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_071_45071899_qa_5/environment/pull_bucket.py b/tasks/0045_071_45071899_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_071_45071899_qa_5/environment/pull_bucket.py +++ b/tasks/0045_071_45071899_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_071_45071899_qa_5/task.toml b/tasks/0045_071_45071899_qa_5/task.toml index 88e8b490a7028bdbad94b6a5c612bbe789cb14b4..467ef2a057ec6832c604bcbdc441686aa9a3b1d7 100644 --- a/tasks/0045_071_45071899_qa_5/task.toml +++ b/tasks/0045_071_45071899_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_100_45100270_qa_4/environment/bootstrap.sh b/tasks/0045_100_45100270_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_100_45100270_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_100_45100270_qa_4/environment/pull_bucket.py b/tasks/0045_100_45100270_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_100_45100270_qa_4/environment/pull_bucket.py +++ b/tasks/0045_100_45100270_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_100_45100270_qa_4/task.toml b/tasks/0045_100_45100270_qa_4/task.toml index 702ff557d04bb07d5ae805c7d40380b4c3c12e07..773018ba0b3c306077faf9e477e853832535acdc 100644 --- a/tasks/0045_100_45100270_qa_4/task.toml +++ b/tasks/0045_100_45100270_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_118_45118642_qa_2/environment/bootstrap.sh b/tasks/0045_118_45118642_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_118_45118642_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_118_45118642_qa_2/environment/pull_bucket.py b/tasks/0045_118_45118642_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_118_45118642_qa_2/environment/pull_bucket.py +++ b/tasks/0045_118_45118642_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_118_45118642_qa_2/task.toml b/tasks/0045_118_45118642_qa_2/task.toml index 05be60b8ae3f37bcab103e7342cde82e9fcdde41..c1dbab1de0010144d846cfc917fa13ec1475e76c 100644 --- a/tasks/0045_118_45118642_qa_2/task.toml +++ b/tasks/0045_118_45118642_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_136_45136493_qa_3/environment/bootstrap.sh b/tasks/0045_136_45136493_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_136_45136493_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_136_45136493_qa_3/environment/pull_bucket.py b/tasks/0045_136_45136493_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_136_45136493_qa_3/environment/pull_bucket.py +++ b/tasks/0045_136_45136493_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_136_45136493_qa_3/task.toml b/tasks/0045_136_45136493_qa_3/task.toml index 3e7e70eeaa6966cf48565024e99e477190762400..e0e35434001e07eec271083e28c864056e152847 100644 --- a/tasks/0045_136_45136493_qa_3/task.toml +++ b/tasks/0045_136_45136493_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_136_45136728_qa_1/environment/bootstrap.sh b/tasks/0045_136_45136728_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_136_45136728_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_136_45136728_qa_1/environment/pull_bucket.py b/tasks/0045_136_45136728_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_136_45136728_qa_1/environment/pull_bucket.py +++ b/tasks/0045_136_45136728_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_136_45136728_qa_1/task.toml b/tasks/0045_136_45136728_qa_1/task.toml index 8289c2e748cf31e03ae5e11a0fadb3d1768ee839..87c640d2240722c940045ab89ffb47a6978262fc 100644 --- a/tasks/0045_136_45136728_qa_1/task.toml +++ b/tasks/0045_136_45136728_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_138_45138042_qa_4/environment/bootstrap.sh b/tasks/0045_138_45138042_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_138_45138042_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_138_45138042_qa_4/environment/pull_bucket.py b/tasks/0045_138_45138042_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_138_45138042_qa_4/environment/pull_bucket.py +++ b/tasks/0045_138_45138042_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_138_45138042_qa_4/task.toml b/tasks/0045_138_45138042_qa_4/task.toml index d1a5b40194e2346d437bf2fab71af83f3c76622a..6639dcaa99c99664177b665b065e059e6d72ef93 100644 --- a/tasks/0045_138_45138042_qa_4/task.toml +++ b/tasks/0045_138_45138042_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_142_45142290_qa_4/environment/bootstrap.sh b/tasks/0045_142_45142290_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_142_45142290_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_142_45142290_qa_4/environment/pull_bucket.py b/tasks/0045_142_45142290_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_142_45142290_qa_4/environment/pull_bucket.py +++ b/tasks/0045_142_45142290_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_142_45142290_qa_4/task.toml b/tasks/0045_142_45142290_qa_4/task.toml index 58a0ebab68bab4d27cce44ef674fd8e524fe1565..97714dbb7c7de6d13669ad5d4252e12dbb615eb4 100644 --- a/tasks/0045_142_45142290_qa_4/task.toml +++ b/tasks/0045_142_45142290_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_142_45142290_qa_5/environment/bootstrap.sh b/tasks/0045_142_45142290_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_142_45142290_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_142_45142290_qa_5/environment/pull_bucket.py b/tasks/0045_142_45142290_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_142_45142290_qa_5/environment/pull_bucket.py +++ b/tasks/0045_142_45142290_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_142_45142290_qa_5/task.toml b/tasks/0045_142_45142290_qa_5/task.toml index 2f0f19e70a3b969995ed402eac23f243c6861744..ab925a05ff086d5a843a8486b0c2ca35e12d1b5e 100644 --- a/tasks/0045_142_45142290_qa_5/task.toml +++ b/tasks/0045_142_45142290_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_162_45162455_qa_3/environment/bootstrap.sh b/tasks/0045_162_45162455_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_162_45162455_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_162_45162455_qa_3/environment/pull_bucket.py b/tasks/0045_162_45162455_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_162_45162455_qa_3/environment/pull_bucket.py +++ b/tasks/0045_162_45162455_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_162_45162455_qa_3/task.toml b/tasks/0045_162_45162455_qa_3/task.toml index 1ca4602906ed125317a8862704480f733ef985f2..3e02e34faf1f8af02fee4f1a18701eb3e0345721 100644 --- a/tasks/0045_162_45162455_qa_3/task.toml +++ b/tasks/0045_162_45162455_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_174_45174378_qa_1/environment/bootstrap.sh b/tasks/0045_174_45174378_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_174_45174378_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_174_45174378_qa_1/environment/pull_bucket.py b/tasks/0045_174_45174378_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_174_45174378_qa_1/environment/pull_bucket.py +++ b/tasks/0045_174_45174378_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_174_45174378_qa_1/task.toml b/tasks/0045_174_45174378_qa_1/task.toml index f94e20194aeea952dc490a8b8de5ea8a401defd5..d8750e04ec4a225caa529aaf115d1ee6a39e71ba 100644 --- a/tasks/0045_174_45174378_qa_1/task.toml +++ b/tasks/0045_174_45174378_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_190_45190323_qa_2/environment/bootstrap.sh b/tasks/0045_190_45190323_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_190_45190323_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_190_45190323_qa_2/environment/pull_bucket.py b/tasks/0045_190_45190323_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_190_45190323_qa_2/environment/pull_bucket.py +++ b/tasks/0045_190_45190323_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_190_45190323_qa_2/task.toml b/tasks/0045_190_45190323_qa_2/task.toml index e7cd8adff52eece604a6d22a233df8f701872818..82741f0c56d005075778bcf6ae1b723cc3e983a7 100644 --- a/tasks/0045_190_45190323_qa_2/task.toml +++ b/tasks/0045_190_45190323_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_190_45190323_qa_5/environment/bootstrap.sh b/tasks/0045_190_45190323_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_190_45190323_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_190_45190323_qa_5/environment/pull_bucket.py b/tasks/0045_190_45190323_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_190_45190323_qa_5/environment/pull_bucket.py +++ b/tasks/0045_190_45190323_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_190_45190323_qa_5/task.toml b/tasks/0045_190_45190323_qa_5/task.toml index ad3d662d12e3fdff30705d7882a5a60844ccb764..66c0625af8e5fbc0dd79f9f81a244a9d8953dd01 100644 --- a/tasks/0045_190_45190323_qa_5/task.toml +++ b/tasks/0045_190_45190323_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_378_45378696_qa_2/environment/bootstrap.sh b/tasks/0045_378_45378696_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_378_45378696_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_378_45378696_qa_2/environment/pull_bucket.py b/tasks/0045_378_45378696_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_378_45378696_qa_2/environment/pull_bucket.py +++ b/tasks/0045_378_45378696_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_378_45378696_qa_2/task.toml b/tasks/0045_378_45378696_qa_2/task.toml index 1110592a2318df00ae95e6daa66efd5f743c460d..65bd89806fc8ddff4004ced7f45b05252965eb9a 100644 --- a/tasks/0045_378_45378696_qa_2/task.toml +++ b/tasks/0045_378_45378696_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_378_45378696_qa_3/environment/bootstrap.sh b/tasks/0045_378_45378696_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_378_45378696_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_378_45378696_qa_3/environment/pull_bucket.py b/tasks/0045_378_45378696_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_378_45378696_qa_3/environment/pull_bucket.py +++ b/tasks/0045_378_45378696_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_378_45378696_qa_3/task.toml b/tasks/0045_378_45378696_qa_3/task.toml index a8122fede5d5b1f5700450fef7683b87d23978a0..ea4aac91614d5dad32119e442f4eb3a806fba924 100644 --- a/tasks/0045_378_45378696_qa_3/task.toml +++ b/tasks/0045_378_45378696_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_385_45385383_qa_4/environment/bootstrap.sh b/tasks/0045_385_45385383_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_385_45385383_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_385_45385383_qa_4/environment/pull_bucket.py b/tasks/0045_385_45385383_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_385_45385383_qa_4/environment/pull_bucket.py +++ b/tasks/0045_385_45385383_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_385_45385383_qa_4/task.toml b/tasks/0045_385_45385383_qa_4/task.toml index 76ecf79d47b0ca4c22e33e0633bdab8492fbbdba..c3379e7eb79541865b15e4fca9bcdb5327e4d0b1 100644 --- a/tasks/0045_385_45385383_qa_4/task.toml +++ b/tasks/0045_385_45385383_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_409_45409591_qa_1/environment/bootstrap.sh b/tasks/0045_409_45409591_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_409_45409591_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_409_45409591_qa_1/environment/pull_bucket.py b/tasks/0045_409_45409591_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_409_45409591_qa_1/environment/pull_bucket.py +++ b/tasks/0045_409_45409591_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_409_45409591_qa_1/task.toml b/tasks/0045_409_45409591_qa_1/task.toml index 081cc65f24857d9c15e0f881e82340e399443ba8..a7c6d71c37c366bdb266644e37e3bee6031a6db1 100644 --- a/tasks/0045_409_45409591_qa_1/task.toml +++ b/tasks/0045_409_45409591_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_409_45409591_qa_2/environment/bootstrap.sh b/tasks/0045_409_45409591_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_409_45409591_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_409_45409591_qa_2/environment/pull_bucket.py b/tasks/0045_409_45409591_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_409_45409591_qa_2/environment/pull_bucket.py +++ b/tasks/0045_409_45409591_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_409_45409591_qa_2/task.toml b/tasks/0045_409_45409591_qa_2/task.toml index f8b93da8a92ab62b49f670254df60789c683308d..4f2e5d95ccaf3adc86204004b7bc32557825bc81 100644 --- a/tasks/0045_409_45409591_qa_2/task.toml +++ b/tasks/0045_409_45409591_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_409_45409591_qa_4/environment/bootstrap.sh b/tasks/0045_409_45409591_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_409_45409591_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_409_45409591_qa_4/environment/pull_bucket.py b/tasks/0045_409_45409591_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_409_45409591_qa_4/environment/pull_bucket.py +++ b/tasks/0045_409_45409591_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_409_45409591_qa_4/task.toml b/tasks/0045_409_45409591_qa_4/task.toml index 11865a4510219c349ae323d44590a589822cc587..1e6142441fbb9845d2c567c385ce3925a947f710 100644 --- a/tasks/0045_409_45409591_qa_4/task.toml +++ b/tasks/0045_409_45409591_qa_4/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_433_45433575_qa_3/environment/bootstrap.sh b/tasks/0045_433_45433575_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_433_45433575_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_433_45433575_qa_3/environment/pull_bucket.py b/tasks/0045_433_45433575_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_433_45433575_qa_3/environment/pull_bucket.py +++ b/tasks/0045_433_45433575_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_433_45433575_qa_3/task.toml b/tasks/0045_433_45433575_qa_3/task.toml index 75bc1e55c5fbe6a8545f3c5dbd0f596090c8a0ce..184a5b329bbe0f57ed790b687842ab9616df3d1c 100644 --- a/tasks/0045_433_45433575_qa_3/task.toml +++ b/tasks/0045_433_45433575_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_452_45452619_qa_3/environment/bootstrap.sh b/tasks/0045_452_45452619_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_452_45452619_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_452_45452619_qa_3/environment/pull_bucket.py b/tasks/0045_452_45452619_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_452_45452619_qa_3/environment/pull_bucket.py +++ b/tasks/0045_452_45452619_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_452_45452619_qa_3/task.toml b/tasks/0045_452_45452619_qa_3/task.toml index 0ee86567070c3bf4b6abe09c64ef344b5561908d..0039ac8ed16005be4b2372d5cb1222aab0add8c6 100644 --- a/tasks/0045_452_45452619_qa_3/task.toml +++ b/tasks/0045_452_45452619_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_454_45454053_qa_3/environment/bootstrap.sh b/tasks/0045_454_45454053_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_454_45454053_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_454_45454053_qa_3/environment/pull_bucket.py b/tasks/0045_454_45454053_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_454_45454053_qa_3/environment/pull_bucket.py +++ b/tasks/0045_454_45454053_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_454_45454053_qa_3/task.toml b/tasks/0045_454_45454053_qa_3/task.toml index 40a632e36e53a59b6482d19c21ba98c11c3836f8..3bc58b655597c26633c94e2b31fe3e44afd502c4 100644 --- a/tasks/0045_454_45454053_qa_3/task.toml +++ b/tasks/0045_454_45454053_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_466_45466628_qa_3/environment/bootstrap.sh b/tasks/0045_466_45466628_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_466_45466628_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_466_45466628_qa_3/environment/pull_bucket.py b/tasks/0045_466_45466628_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_466_45466628_qa_3/environment/pull_bucket.py +++ b/tasks/0045_466_45466628_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_466_45466628_qa_3/task.toml b/tasks/0045_466_45466628_qa_3/task.toml index 7833fea88781b5550cd25c99d634f6ef817d6918..4bb9b9fa90ac096d9c1ea56f4a96f44228651cc3 100644 --- a/tasks/0045_466_45466628_qa_3/task.toml +++ b/tasks/0045_466_45466628_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_476_45476147_qa_3/environment/bootstrap.sh b/tasks/0045_476_45476147_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_476_45476147_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_476_45476147_qa_3/environment/pull_bucket.py b/tasks/0045_476_45476147_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_476_45476147_qa_3/environment/pull_bucket.py +++ b/tasks/0045_476_45476147_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_476_45476147_qa_3/task.toml b/tasks/0045_476_45476147_qa_3/task.toml index 6c8a88cae56d6ed3b890a1f6c921e9cf892d7774..5c99a9acfbfa94ebc89d64d2fc75a263d42c9f40 100644 --- a/tasks/0045_476_45476147_qa_3/task.toml +++ b/tasks/0045_476_45476147_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_605_45605559_qa_1/environment/bootstrap.sh b/tasks/0045_605_45605559_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_605_45605559_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_605_45605559_qa_1/environment/pull_bucket.py b/tasks/0045_605_45605559_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_605_45605559_qa_1/environment/pull_bucket.py +++ b/tasks/0045_605_45605559_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_605_45605559_qa_1/task.toml b/tasks/0045_605_45605559_qa_1/task.toml index 95b5a27166ea91ac60d078cdaabcfc6912264a29..3bfbabd72cacfda1620c19433f5210a8f638d135 100644 --- a/tasks/0045_605_45605559_qa_1/task.toml +++ b/tasks/0045_605_45605559_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_605_45605559_qa_4/environment/bootstrap.sh b/tasks/0045_605_45605559_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_605_45605559_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_605_45605559_qa_4/environment/pull_bucket.py b/tasks/0045_605_45605559_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_605_45605559_qa_4/environment/pull_bucket.py +++ b/tasks/0045_605_45605559_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_605_45605559_qa_4/task.toml b/tasks/0045_605_45605559_qa_4/task.toml index 6cf95021ba59d02e69ce6cea181670a02f1c59cc..5b215b423c3d764af73fde7772e1062a50c9072a 100644 --- a/tasks/0045_605_45605559_qa_4/task.toml +++ b/tasks/0045_605_45605559_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_668_45668013_qa_2/environment/bootstrap.sh b/tasks/0045_668_45668013_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_668_45668013_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_668_45668013_qa_2/environment/pull_bucket.py b/tasks/0045_668_45668013_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_668_45668013_qa_2/environment/pull_bucket.py +++ b/tasks/0045_668_45668013_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_668_45668013_qa_2/task.toml b/tasks/0045_668_45668013_qa_2/task.toml index 8bd0f445e160186108d90592dadf418893d144f6..e49b7af6c97ddbc858bcff549cc0600de4467a85 100644 --- a/tasks/0045_668_45668013_qa_2/task.toml +++ b/tasks/0045_668_45668013_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_670_45670809_qa_3/environment/bootstrap.sh b/tasks/0045_670_45670809_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_670_45670809_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_670_45670809_qa_3/environment/pull_bucket.py b/tasks/0045_670_45670809_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_670_45670809_qa_3/environment/pull_bucket.py +++ b/tasks/0045_670_45670809_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_670_45670809_qa_3/task.toml b/tasks/0045_670_45670809_qa_3/task.toml index 7ac6c00efb8da90cc0eaf8121681b32216feda66..bb22336489fad2d3bcb74ad1e88f97f4a7851855 100644 --- a/tasks/0045_670_45670809_qa_3/task.toml +++ b/tasks/0045_670_45670809_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_675_45675145_qa_5/environment/bootstrap.sh b/tasks/0045_675_45675145_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_675_45675145_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_675_45675145_qa_5/environment/pull_bucket.py b/tasks/0045_675_45675145_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_675_45675145_qa_5/environment/pull_bucket.py +++ b/tasks/0045_675_45675145_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_675_45675145_qa_5/task.toml b/tasks/0045_675_45675145_qa_5/task.toml index 617f53d68eb5d031c6a206346785018ea12624e6..4393f54df8475320a061d73b31c3265b743d4adf 100644 --- a/tasks/0045_675_45675145_qa_5/task.toml +++ b/tasks/0045_675_45675145_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_738_45738362_qa_2/environment/bootstrap.sh b/tasks/0045_738_45738362_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_738_45738362_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_738_45738362_qa_2/environment/pull_bucket.py b/tasks/0045_738_45738362_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_738_45738362_qa_2/environment/pull_bucket.py +++ b/tasks/0045_738_45738362_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_738_45738362_qa_2/task.toml b/tasks/0045_738_45738362_qa_2/task.toml index 119e2bf011efa17021d2cda2474db500a15c11fa..73c643894ee2d1d880e2fa172d4c161b1b58be08 100644 --- a/tasks/0045_738_45738362_qa_2/task.toml +++ b/tasks/0045_738_45738362_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_738_45738362_qa_4/environment/bootstrap.sh b/tasks/0045_738_45738362_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_738_45738362_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_738_45738362_qa_4/environment/pull_bucket.py b/tasks/0045_738_45738362_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_738_45738362_qa_4/environment/pull_bucket.py +++ b/tasks/0045_738_45738362_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_738_45738362_qa_4/task.toml b/tasks/0045_738_45738362_qa_4/task.toml index 1dc373b6a98c45f0da629d1fff41cf86b706f905..b5feed8bd80cb502a3faa7adc3630d24d23bdf10 100644 --- a/tasks/0045_738_45738362_qa_4/task.toml +++ b/tasks/0045_738_45738362_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_754_45754674_qa_5/environment/bootstrap.sh b/tasks/0045_754_45754674_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_754_45754674_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_754_45754674_qa_5/environment/pull_bucket.py b/tasks/0045_754_45754674_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_754_45754674_qa_5/environment/pull_bucket.py +++ b/tasks/0045_754_45754674_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_754_45754674_qa_5/task.toml b/tasks/0045_754_45754674_qa_5/task.toml index 44ace73e2f920814300f463ab5bc63cf85bff9f4..d02f89e38f2b051beecef3f1fb8dd24d6080b22d 100644 --- a/tasks/0045_754_45754674_qa_5/task.toml +++ b/tasks/0045_754_45754674_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_758_45758482_qa_3/environment/bootstrap.sh b/tasks/0045_758_45758482_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_758_45758482_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_758_45758482_qa_3/environment/pull_bucket.py b/tasks/0045_758_45758482_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_758_45758482_qa_3/environment/pull_bucket.py +++ b/tasks/0045_758_45758482_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_758_45758482_qa_3/task.toml b/tasks/0045_758_45758482_qa_3/task.toml index db70f8679b9462fe2c26a9ee0aacee76e895e16b..c251056327ed36f65a3664fb819c0bbf9798bcc6 100644 --- a/tasks/0045_758_45758482_qa_3/task.toml +++ b/tasks/0045_758_45758482_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_818_45818362_qa_4/environment/bootstrap.sh b/tasks/0045_818_45818362_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_818_45818362_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_818_45818362_qa_4/environment/pull_bucket.py b/tasks/0045_818_45818362_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_818_45818362_qa_4/environment/pull_bucket.py +++ b/tasks/0045_818_45818362_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_818_45818362_qa_4/task.toml b/tasks/0045_818_45818362_qa_4/task.toml index 4c4e2e68eb954774a431ea75c43edbbce681ca57..b4f1a568342800980d9d5ea92c2d3c95552103fa 100644 --- a/tasks/0045_818_45818362_qa_4/task.toml +++ b/tasks/0045_818_45818362_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_821_45821165_qa_2/environment/bootstrap.sh b/tasks/0045_821_45821165_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_821_45821165_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_821_45821165_qa_2/environment/pull_bucket.py b/tasks/0045_821_45821165_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_821_45821165_qa_2/environment/pull_bucket.py +++ b/tasks/0045_821_45821165_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_821_45821165_qa_2/task.toml b/tasks/0045_821_45821165_qa_2/task.toml index 14cb54753d0c71b0180e21e14826fc8c05b534b6..eb45aa14390cd3122742def2cb3eb62cf2b57a9d 100644 --- a/tasks/0045_821_45821165_qa_2/task.toml +++ b/tasks/0045_821_45821165_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_821_45821165_qa_3/environment/bootstrap.sh b/tasks/0045_821_45821165_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_821_45821165_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_821_45821165_qa_3/environment/pull_bucket.py b/tasks/0045_821_45821165_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_821_45821165_qa_3/environment/pull_bucket.py +++ b/tasks/0045_821_45821165_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_821_45821165_qa_3/task.toml b/tasks/0045_821_45821165_qa_3/task.toml index 1920b7d3842b9e4b6d6ec8314721a464963c0308..85c17c99194094ecab66d2c8cb863345cf707c7e 100644 --- a/tasks/0045_821_45821165_qa_3/task.toml +++ b/tasks/0045_821_45821165_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_821_45821165_qa_5/environment/bootstrap.sh b/tasks/0045_821_45821165_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_821_45821165_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_821_45821165_qa_5/environment/pull_bucket.py b/tasks/0045_821_45821165_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_821_45821165_qa_5/environment/pull_bucket.py +++ b/tasks/0045_821_45821165_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_821_45821165_qa_5/task.toml b/tasks/0045_821_45821165_qa_5/task.toml index 9a11fcfff639cd53996da37e16eefad6124b4a82..ed28abf1e1255bb954d808f563b6917e7d57ef86 100644 --- a/tasks/0045_821_45821165_qa_5/task.toml +++ b/tasks/0045_821_45821165_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_874_45874370_qa_5/environment/bootstrap.sh b/tasks/0045_874_45874370_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_874_45874370_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_874_45874370_qa_5/environment/pull_bucket.py b/tasks/0045_874_45874370_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_874_45874370_qa_5/environment/pull_bucket.py +++ b/tasks/0045_874_45874370_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_874_45874370_qa_5/task.toml b/tasks/0045_874_45874370_qa_5/task.toml index de3c2c85ec4e3bdcc5378a566d3b3f784808d571..9b484f8303de626a1fbb6c94c6776e6252e59494 100644 --- a/tasks/0045_874_45874370_qa_5/task.toml +++ b/tasks/0045_874_45874370_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_880_45880804_qa_5/environment/bootstrap.sh b/tasks/0045_880_45880804_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_880_45880804_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_880_45880804_qa_5/environment/pull_bucket.py b/tasks/0045_880_45880804_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_880_45880804_qa_5/environment/pull_bucket.py +++ b/tasks/0045_880_45880804_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_880_45880804_qa_5/task.toml b/tasks/0045_880_45880804_qa_5/task.toml index f95d46f6a2997d9afb1e74bc70e4604d1f416449..6140d7245b55866d6a7cbb0176996405454a2443 100644 --- a/tasks/0045_880_45880804_qa_5/task.toml +++ b/tasks/0045_880_45880804_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_892_45892166_qa_5/environment/bootstrap.sh b/tasks/0045_892_45892166_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_892_45892166_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_892_45892166_qa_5/environment/pull_bucket.py b/tasks/0045_892_45892166_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_892_45892166_qa_5/environment/pull_bucket.py +++ b/tasks/0045_892_45892166_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_892_45892166_qa_5/task.toml b/tasks/0045_892_45892166_qa_5/task.toml index 2c76def69e43d0f9ae2a2bae081edf57b6c12070..302204864353396fa22209011d8714605f902a07 100644 --- a/tasks/0045_892_45892166_qa_5/task.toml +++ b/tasks/0045_892_45892166_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_913_45913671_qa_3/environment/bootstrap.sh b/tasks/0045_913_45913671_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_913_45913671_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_913_45913671_qa_3/environment/pull_bucket.py b/tasks/0045_913_45913671_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_913_45913671_qa_3/environment/pull_bucket.py +++ b/tasks/0045_913_45913671_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_913_45913671_qa_3/task.toml b/tasks/0045_913_45913671_qa_3/task.toml index 7ce572a33e5ba1f1b7d0961210e98e143abe668e..3d51bb583273aaf7e5945eea577ace0029a3da51 100644 --- a/tasks/0045_913_45913671_qa_3/task.toml +++ b/tasks/0045_913_45913671_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_943_45943372_qa_5/environment/bootstrap.sh b/tasks/0045_943_45943372_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_943_45943372_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_943_45943372_qa_5/environment/pull_bucket.py b/tasks/0045_943_45943372_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_943_45943372_qa_5/environment/pull_bucket.py +++ b/tasks/0045_943_45943372_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_943_45943372_qa_5/task.toml b/tasks/0045_943_45943372_qa_5/task.toml index fd403e78aa0ea75807ef02b0c708caf259937084..c894ade6257923cedb35f3e65c6e3734fdac1a3e 100644 --- a/tasks/0045_943_45943372_qa_5/task.toml +++ b/tasks/0045_943_45943372_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_969_45969290_qa_1/environment/bootstrap.sh b/tasks/0045_969_45969290_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_969_45969290_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_969_45969290_qa_1/environment/pull_bucket.py b/tasks/0045_969_45969290_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_969_45969290_qa_1/environment/pull_bucket.py +++ b/tasks/0045_969_45969290_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_969_45969290_qa_1/task.toml b/tasks/0045_969_45969290_qa_1/task.toml index dab88734e1e24b6c8c4fe2cbc09b7bb5b87e6ec2..35e8f087e3e64a5ba3cc2487b609ba6737731958 100644 --- a/tasks/0045_969_45969290_qa_1/task.toml +++ b/tasks/0045_969_45969290_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0045_969_45969290_qa_2/environment/bootstrap.sh b/tasks/0045_969_45969290_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0045_969_45969290_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0045_969_45969290_qa_2/environment/pull_bucket.py b/tasks/0045_969_45969290_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0045_969_45969290_qa_2/environment/pull_bucket.py +++ b/tasks/0045_969_45969290_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0045_969_45969290_qa_2/task.toml b/tasks/0045_969_45969290_qa_2/task.toml index 5d0f00d8c346354bba29801ea25eefedbad6d995..c73d16cca2a536a6d88ed7801d07e57b678a12d2 100644 --- a/tasks/0045_969_45969290_qa_2/task.toml +++ b/tasks/0045_969_45969290_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_035_46035466_qa_1/environment/bootstrap.sh b/tasks/0046_035_46035466_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_035_46035466_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_035_46035466_qa_1/environment/pull_bucket.py b/tasks/0046_035_46035466_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_035_46035466_qa_1/environment/pull_bucket.py +++ b/tasks/0046_035_46035466_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_035_46035466_qa_1/task.toml b/tasks/0046_035_46035466_qa_1/task.toml index b5b0b1dd48182df08ef1d6af9cbfd043e423a87d..2fd132ec04ee0a6853d1cc9d65a6d6103bb6e818 100644 --- a/tasks/0046_035_46035466_qa_1/task.toml +++ b/tasks/0046_035_46035466_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_035_46035466_qa_2/environment/bootstrap.sh b/tasks/0046_035_46035466_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_035_46035466_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_035_46035466_qa_2/environment/pull_bucket.py b/tasks/0046_035_46035466_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_035_46035466_qa_2/environment/pull_bucket.py +++ b/tasks/0046_035_46035466_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_035_46035466_qa_2/task.toml b/tasks/0046_035_46035466_qa_2/task.toml index d34baf275b95afa09c0777840ab716e28d3d2fd0..1d39e85a28d116ac64682bab3f81c82e855b7948 100644 --- a/tasks/0046_035_46035466_qa_2/task.toml +++ b/tasks/0046_035_46035466_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_103_46103508_qa_2/environment/bootstrap.sh b/tasks/0046_103_46103508_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_103_46103508_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_103_46103508_qa_2/environment/pull_bucket.py b/tasks/0046_103_46103508_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_103_46103508_qa_2/environment/pull_bucket.py +++ b/tasks/0046_103_46103508_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_103_46103508_qa_2/task.toml b/tasks/0046_103_46103508_qa_2/task.toml index 9b9d341190fce0e2c19de6649729a53882448d5d..1d8230ba25752f9322b9f588956580c96e9038a1 100644 --- a/tasks/0046_103_46103508_qa_2/task.toml +++ b/tasks/0046_103_46103508_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_112_46112628_qa_3/environment/bootstrap.sh b/tasks/0046_112_46112628_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_112_46112628_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_112_46112628_qa_3/environment/pull_bucket.py b/tasks/0046_112_46112628_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_112_46112628_qa_3/environment/pull_bucket.py +++ b/tasks/0046_112_46112628_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_112_46112628_qa_3/task.toml b/tasks/0046_112_46112628_qa_3/task.toml index 829174f8d7995fc03b1a3d94068b7878b049f08f..288466bd074e076f74f8a17624ca352a7e22bc48 100644 --- a/tasks/0046_112_46112628_qa_3/task.toml +++ b/tasks/0046_112_46112628_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_113_46113496_qa_1/environment/bootstrap.sh b/tasks/0046_113_46113496_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_113_46113496_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_113_46113496_qa_1/environment/pull_bucket.py b/tasks/0046_113_46113496_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_113_46113496_qa_1/environment/pull_bucket.py +++ b/tasks/0046_113_46113496_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_113_46113496_qa_1/task.toml b/tasks/0046_113_46113496_qa_1/task.toml index 5cf66306800fca613bc05ec31f246491014af4b2..a87be0ec6f75748a6e2d5ba7772720b5e4bc90d1 100644 --- a/tasks/0046_113_46113496_qa_1/task.toml +++ b/tasks/0046_113_46113496_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_113_46113496_qa_2/environment/bootstrap.sh b/tasks/0046_113_46113496_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_113_46113496_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_113_46113496_qa_2/environment/pull_bucket.py b/tasks/0046_113_46113496_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_113_46113496_qa_2/environment/pull_bucket.py +++ b/tasks/0046_113_46113496_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_113_46113496_qa_2/task.toml b/tasks/0046_113_46113496_qa_2/task.toml index c3d782ec7278f8de90eff649734cce94ecf15b6a..6dc5322c5ace20ca344a22acdd9997713f250298 100644 --- a/tasks/0046_113_46113496_qa_2/task.toml +++ b/tasks/0046_113_46113496_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_115_46115058_qa_5/environment/bootstrap.sh b/tasks/0046_115_46115058_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_115_46115058_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_115_46115058_qa_5/environment/pull_bucket.py b/tasks/0046_115_46115058_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_115_46115058_qa_5/environment/pull_bucket.py +++ b/tasks/0046_115_46115058_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_115_46115058_qa_5/task.toml b/tasks/0046_115_46115058_qa_5/task.toml index 7f0e4c1241b21aa642109ab6300d5d26f51e05a6..bb1f25fff18976ab0da35731bac2b492cde7764d 100644 --- a/tasks/0046_115_46115058_qa_5/task.toml +++ b/tasks/0046_115_46115058_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_178_46178687_qa_2/environment/bootstrap.sh b/tasks/0046_178_46178687_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_178_46178687_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_178_46178687_qa_2/environment/pull_bucket.py b/tasks/0046_178_46178687_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_178_46178687_qa_2/environment/pull_bucket.py +++ b/tasks/0046_178_46178687_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_178_46178687_qa_2/task.toml b/tasks/0046_178_46178687_qa_2/task.toml index e2f61bac205361e94de7acea64ea9dfc95d16095..f3f5ddc6c587678b680e8c4533aa92948aa067e4 100644 --- a/tasks/0046_178_46178687_qa_2/task.toml +++ b/tasks/0046_178_46178687_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_178_46178687_qa_4/environment/bootstrap.sh b/tasks/0046_178_46178687_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_178_46178687_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_178_46178687_qa_4/environment/pull_bucket.py b/tasks/0046_178_46178687_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_178_46178687_qa_4/environment/pull_bucket.py +++ b/tasks/0046_178_46178687_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_178_46178687_qa_4/task.toml b/tasks/0046_178_46178687_qa_4/task.toml index c8d338b6722666c99f9c2234033e9c999e0bfc03..884bdec29d329d322c5e4fd24167663c833622d8 100644 --- a/tasks/0046_178_46178687_qa_4/task.toml +++ b/tasks/0046_178_46178687_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_263_46263849_qa_1/environment/bootstrap.sh b/tasks/0046_263_46263849_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_263_46263849_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_263_46263849_qa_1/environment/pull_bucket.py b/tasks/0046_263_46263849_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_263_46263849_qa_1/environment/pull_bucket.py +++ b/tasks/0046_263_46263849_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_263_46263849_qa_1/task.toml b/tasks/0046_263_46263849_qa_1/task.toml index 0bf2014ffdc5b76f943220775e7c5a38007650b0..275d5c7eac592b513a4cbdcbc529f7d006b070d3 100644 --- a/tasks/0046_263_46263849_qa_1/task.toml +++ b/tasks/0046_263_46263849_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_267_46267192_qa_3/environment/bootstrap.sh b/tasks/0046_267_46267192_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_267_46267192_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_267_46267192_qa_3/environment/pull_bucket.py b/tasks/0046_267_46267192_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_267_46267192_qa_3/environment/pull_bucket.py +++ b/tasks/0046_267_46267192_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_267_46267192_qa_3/task.toml b/tasks/0046_267_46267192_qa_3/task.toml index 7a45aaf0b28dab74fcfd5284a5d30e6dc321e5bf..380985c5361c76a8a2eb11b75adb95350dd10a71 100644 --- a/tasks/0046_267_46267192_qa_3/task.toml +++ b/tasks/0046_267_46267192_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_282_46282379_qa_2/environment/bootstrap.sh b/tasks/0046_282_46282379_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_282_46282379_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_282_46282379_qa_2/environment/pull_bucket.py b/tasks/0046_282_46282379_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_282_46282379_qa_2/environment/pull_bucket.py +++ b/tasks/0046_282_46282379_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_282_46282379_qa_2/task.toml b/tasks/0046_282_46282379_qa_2/task.toml index 9deefc6a300f62a503e23e0bfe373f3808c7b162..8934c03189f93fb9e4c57ac96dd13de90fa5187a 100644 --- a/tasks/0046_282_46282379_qa_2/task.toml +++ b/tasks/0046_282_46282379_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_305_46305988_qa_2/environment/bootstrap.sh b/tasks/0046_305_46305988_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_305_46305988_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_305_46305988_qa_2/environment/pull_bucket.py b/tasks/0046_305_46305988_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_305_46305988_qa_2/environment/pull_bucket.py +++ b/tasks/0046_305_46305988_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_305_46305988_qa_2/task.toml b/tasks/0046_305_46305988_qa_2/task.toml index f0bd260c5b0c4711d3c92dc7b3aadc182012743a..db6ad3f2f3f993c785e3f73f484bf9cca6135c82 100644 --- a/tasks/0046_305_46305988_qa_2/task.toml +++ b/tasks/0046_305_46305988_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_333_46333553_qa_1/environment/bootstrap.sh b/tasks/0046_333_46333553_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_333_46333553_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_333_46333553_qa_1/environment/pull_bucket.py b/tasks/0046_333_46333553_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_333_46333553_qa_1/environment/pull_bucket.py +++ b/tasks/0046_333_46333553_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_333_46333553_qa_1/task.toml b/tasks/0046_333_46333553_qa_1/task.toml index f8fd0f8b2d4cc41f0cf5afefee87a7936b0fe32e..b93e97c3d0ddaa27caafa6ded4365a29df97c762 100644 --- a/tasks/0046_333_46333553_qa_1/task.toml +++ b/tasks/0046_333_46333553_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_421_46421373_qa_5/environment/bootstrap.sh b/tasks/0046_421_46421373_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_421_46421373_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_421_46421373_qa_5/environment/pull_bucket.py b/tasks/0046_421_46421373_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_421_46421373_qa_5/environment/pull_bucket.py +++ b/tasks/0046_421_46421373_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_421_46421373_qa_5/task.toml b/tasks/0046_421_46421373_qa_5/task.toml index 5ec3ed2bb387c8e671dde8ff672ea41c59731395..1e8d5e2306ab1245f93340a50bd804e09e68ce38 100644 --- a/tasks/0046_421_46421373_qa_5/task.toml +++ b/tasks/0046_421_46421373_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_456_46456896_qa_3/environment/bootstrap.sh b/tasks/0046_456_46456896_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_456_46456896_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_456_46456896_qa_3/environment/pull_bucket.py b/tasks/0046_456_46456896_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_456_46456896_qa_3/environment/pull_bucket.py +++ b/tasks/0046_456_46456896_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_456_46456896_qa_3/task.toml b/tasks/0046_456_46456896_qa_3/task.toml index 3aa75b22192413ef70ec983d3ecc3cf2c3d3c634..46827a7c3487301b05f634a61eaa01bf60d65574 100644 --- a/tasks/0046_456_46456896_qa_3/task.toml +++ b/tasks/0046_456_46456896_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_467_46467108_qa_2/environment/bootstrap.sh b/tasks/0046_467_46467108_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_467_46467108_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_467_46467108_qa_2/environment/pull_bucket.py b/tasks/0046_467_46467108_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_467_46467108_qa_2/environment/pull_bucket.py +++ b/tasks/0046_467_46467108_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_467_46467108_qa_2/task.toml b/tasks/0046_467_46467108_qa_2/task.toml index b0987f0c1077780830464024f2e34437884ba46e..b68a2cbf5337bcb6b166c1918dfc291956151f98 100644 --- a/tasks/0046_467_46467108_qa_2/task.toml +++ b/tasks/0046_467_46467108_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_487_46487066_qa_1/environment/bootstrap.sh b/tasks/0046_487_46487066_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_487_46487066_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_487_46487066_qa_1/environment/pull_bucket.py b/tasks/0046_487_46487066_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_487_46487066_qa_1/environment/pull_bucket.py +++ b/tasks/0046_487_46487066_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_487_46487066_qa_1/task.toml b/tasks/0046_487_46487066_qa_1/task.toml index 688e2103a813b40def0e4448d244ce2d33b894e5..0d3b5b539c9309e3019755ff7de15eb44138bb75 100644 --- a/tasks/0046_487_46487066_qa_1/task.toml +++ b/tasks/0046_487_46487066_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_487_46487066_qa_3/environment/bootstrap.sh b/tasks/0046_487_46487066_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_487_46487066_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_487_46487066_qa_3/environment/pull_bucket.py b/tasks/0046_487_46487066_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_487_46487066_qa_3/environment/pull_bucket.py +++ b/tasks/0046_487_46487066_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_487_46487066_qa_3/task.toml b/tasks/0046_487_46487066_qa_3/task.toml index 44f44f39e1af489fb21eda10d37baba3abe90f1a..02957d55026762ada341218428e45e2e2b92375c 100644 --- a/tasks/0046_487_46487066_qa_3/task.toml +++ b/tasks/0046_487_46487066_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_487_46487066_qa_4/environment/bootstrap.sh b/tasks/0046_487_46487066_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_487_46487066_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_487_46487066_qa_4/environment/pull_bucket.py b/tasks/0046_487_46487066_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_487_46487066_qa_4/environment/pull_bucket.py +++ b/tasks/0046_487_46487066_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_487_46487066_qa_4/task.toml b/tasks/0046_487_46487066_qa_4/task.toml index 6e97748b7ee54b378df1a346ccd425c8761568d7..9813866970a8e85aadc96fbe746bb1fdd782a922 100644 --- a/tasks/0046_487_46487066_qa_4/task.toml +++ b/tasks/0046_487_46487066_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_517_46517574_qa_1/environment/bootstrap.sh b/tasks/0046_517_46517574_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_517_46517574_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_517_46517574_qa_1/environment/pull_bucket.py b/tasks/0046_517_46517574_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_517_46517574_qa_1/environment/pull_bucket.py +++ b/tasks/0046_517_46517574_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_517_46517574_qa_1/task.toml b/tasks/0046_517_46517574_qa_1/task.toml index e0a6949d4f816af0423bdb8605fbee93f7737563..c11ebbfab86a4a1122aaa22075eb4d4bcdfa2046 100644 --- a/tasks/0046_517_46517574_qa_1/task.toml +++ b/tasks/0046_517_46517574_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_528_46528108_qa_1/environment/bootstrap.sh b/tasks/0046_528_46528108_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_528_46528108_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_528_46528108_qa_1/environment/pull_bucket.py b/tasks/0046_528_46528108_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_528_46528108_qa_1/environment/pull_bucket.py +++ b/tasks/0046_528_46528108_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_528_46528108_qa_1/task.toml b/tasks/0046_528_46528108_qa_1/task.toml index 1fca05660ec0db76c36b118fe5e493094f974b66..050c52865dbc9f41516eb4a0e178045db1075c96 100644 --- a/tasks/0046_528_46528108_qa_1/task.toml +++ b/tasks/0046_528_46528108_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_597_46597030_qa_1/environment/bootstrap.sh b/tasks/0046_597_46597030_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_597_46597030_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_597_46597030_qa_1/environment/pull_bucket.py b/tasks/0046_597_46597030_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_597_46597030_qa_1/environment/pull_bucket.py +++ b/tasks/0046_597_46597030_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_597_46597030_qa_1/task.toml b/tasks/0046_597_46597030_qa_1/task.toml index 79f401eb8f3f6de44d4aa1df8ce2c41b429bbd68..b6c883026a0850b7fcfa5ad1494954aba7350761 100644 --- a/tasks/0046_597_46597030_qa_1/task.toml +++ b/tasks/0046_597_46597030_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_597_46597030_qa_4/environment/bootstrap.sh b/tasks/0046_597_46597030_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_597_46597030_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_597_46597030_qa_4/environment/pull_bucket.py b/tasks/0046_597_46597030_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_597_46597030_qa_4/environment/pull_bucket.py +++ b/tasks/0046_597_46597030_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_597_46597030_qa_4/task.toml b/tasks/0046_597_46597030_qa_4/task.toml index 0fd83e557d3c772e8a5d0557461231e753623469..dc7abb770ecc5e5f86e1ec5663c64bdbfbe771ab 100644 --- a/tasks/0046_597_46597030_qa_4/task.toml +++ b/tasks/0046_597_46597030_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_641_46641346_qa_1/environment/bootstrap.sh b/tasks/0046_641_46641346_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_641_46641346_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_641_46641346_qa_1/environment/pull_bucket.py b/tasks/0046_641_46641346_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_641_46641346_qa_1/environment/pull_bucket.py +++ b/tasks/0046_641_46641346_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_641_46641346_qa_1/task.toml b/tasks/0046_641_46641346_qa_1/task.toml index 4f52b8626cfddd9657f39f7a701b7b8e25a438cd..aaed5fa9e0e68510116a659058f222ec739119dc 100644 --- a/tasks/0046_641_46641346_qa_1/task.toml +++ b/tasks/0046_641_46641346_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_651_46651682_qa_4/environment/bootstrap.sh b/tasks/0046_651_46651682_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_651_46651682_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_651_46651682_qa_4/environment/pull_bucket.py b/tasks/0046_651_46651682_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_651_46651682_qa_4/environment/pull_bucket.py +++ b/tasks/0046_651_46651682_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_651_46651682_qa_4/task.toml b/tasks/0046_651_46651682_qa_4/task.toml index dbbf3638a2c6e426ffeccae9e31e3ea5cf776541..469f668337991d0862ef13dc6258be7a7bdd3846 100644 --- a/tasks/0046_651_46651682_qa_4/task.toml +++ b/tasks/0046_651_46651682_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_658_46658315_qa_5/environment/bootstrap.sh b/tasks/0046_658_46658315_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_658_46658315_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_658_46658315_qa_5/environment/pull_bucket.py b/tasks/0046_658_46658315_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_658_46658315_qa_5/environment/pull_bucket.py +++ b/tasks/0046_658_46658315_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_658_46658315_qa_5/task.toml b/tasks/0046_658_46658315_qa_5/task.toml index 910e70c5bd699634d28874074e9059a6c11fe197..640ec2b3a2326e1e4c36830421ae7762e668db9d 100644 --- a/tasks/0046_658_46658315_qa_5/task.toml +++ b/tasks/0046_658_46658315_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_660_46660345_qa_2/environment/bootstrap.sh b/tasks/0046_660_46660345_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_660_46660345_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_660_46660345_qa_2/environment/pull_bucket.py b/tasks/0046_660_46660345_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_660_46660345_qa_2/environment/pull_bucket.py +++ b/tasks/0046_660_46660345_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_660_46660345_qa_2/task.toml b/tasks/0046_660_46660345_qa_2/task.toml index f96cd1a6eb61f43c8e9169d1142c65f0136b0842..71abedccbe3d1f8601f2a37c8858adeba07943e7 100644 --- a/tasks/0046_660_46660345_qa_2/task.toml +++ b/tasks/0046_660_46660345_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_660_46660345_qa_5/environment/bootstrap.sh b/tasks/0046_660_46660345_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_660_46660345_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_660_46660345_qa_5/environment/pull_bucket.py b/tasks/0046_660_46660345_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_660_46660345_qa_5/environment/pull_bucket.py +++ b/tasks/0046_660_46660345_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_660_46660345_qa_5/task.toml b/tasks/0046_660_46660345_qa_5/task.toml index 54ca01f2e6be1258171d4922a2dcb93464ecdb3e..01236a1400d64f4366ef936f7f85cead61230b34 100644 --- a/tasks/0046_660_46660345_qa_5/task.toml +++ b/tasks/0046_660_46660345_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_711_46711953_qa_2/environment/bootstrap.sh b/tasks/0046_711_46711953_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_711_46711953_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_711_46711953_qa_2/environment/pull_bucket.py b/tasks/0046_711_46711953_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_711_46711953_qa_2/environment/pull_bucket.py +++ b/tasks/0046_711_46711953_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_711_46711953_qa_2/task.toml b/tasks/0046_711_46711953_qa_2/task.toml index a1f5648391252851efd15c8a640003e3f41a0a65..52126ba27002086b1512d97cc9dd22b2e3d3184d 100644 --- a/tasks/0046_711_46711953_qa_2/task.toml +++ b/tasks/0046_711_46711953_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_788_46788472_qa_2/environment/bootstrap.sh b/tasks/0046_788_46788472_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_788_46788472_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_788_46788472_qa_2/environment/pull_bucket.py b/tasks/0046_788_46788472_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_788_46788472_qa_2/environment/pull_bucket.py +++ b/tasks/0046_788_46788472_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_788_46788472_qa_2/task.toml b/tasks/0046_788_46788472_qa_2/task.toml index a4615e61119678f8094e4a5257848372ddaf83f9..56b29dfb81c55b13229cd15ff0ed9a33ac232503 100644 --- a/tasks/0046_788_46788472_qa_2/task.toml +++ b/tasks/0046_788_46788472_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_788_46788472_qa_3/environment/bootstrap.sh b/tasks/0046_788_46788472_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_788_46788472_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_788_46788472_qa_3/environment/pull_bucket.py b/tasks/0046_788_46788472_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_788_46788472_qa_3/environment/pull_bucket.py +++ b/tasks/0046_788_46788472_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_788_46788472_qa_3/task.toml b/tasks/0046_788_46788472_qa_3/task.toml index 4b6b52bb024a83fd5528e8a0b043fef07943f81f..1ef6d6df7995e85b8f6fecd3b0918bb92c69f805 100644 --- a/tasks/0046_788_46788472_qa_3/task.toml +++ b/tasks/0046_788_46788472_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_788_46788472_qa_4/environment/bootstrap.sh b/tasks/0046_788_46788472_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_788_46788472_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_788_46788472_qa_4/environment/pull_bucket.py b/tasks/0046_788_46788472_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_788_46788472_qa_4/environment/pull_bucket.py +++ b/tasks/0046_788_46788472_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_788_46788472_qa_4/task.toml b/tasks/0046_788_46788472_qa_4/task.toml index 73adb5dbe74ac060c9d9e6bdef3bb3387e7b6966..a2e24a454e18c91b41a070173733a51b4817a65a 100644 --- a/tasks/0046_788_46788472_qa_4/task.toml +++ b/tasks/0046_788_46788472_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_808_46808200_qa_4/environment/bootstrap.sh b/tasks/0046_808_46808200_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_808_46808200_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_808_46808200_qa_4/environment/pull_bucket.py b/tasks/0046_808_46808200_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_808_46808200_qa_4/environment/pull_bucket.py +++ b/tasks/0046_808_46808200_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_808_46808200_qa_4/task.toml b/tasks/0046_808_46808200_qa_4/task.toml index 8c0d02d08fb42f1fc5048627b0009bd12d29fa4a..8965254e9be72be6d0879c0bcbeeea1f823eb08c 100644 --- a/tasks/0046_808_46808200_qa_4/task.toml +++ b/tasks/0046_808_46808200_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_857_46857117_qa_4/environment/bootstrap.sh b/tasks/0046_857_46857117_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_857_46857117_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_857_46857117_qa_4/environment/pull_bucket.py b/tasks/0046_857_46857117_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_857_46857117_qa_4/environment/pull_bucket.py +++ b/tasks/0046_857_46857117_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_857_46857117_qa_4/task.toml b/tasks/0046_857_46857117_qa_4/task.toml index ff15d7750483e754d8d81dd4f430493786cde06f..5a0aa9e9ae46b9a7bba4f502b22f0845e7d44ce0 100644 --- a/tasks/0046_857_46857117_qa_4/task.toml +++ b/tasks/0046_857_46857117_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_857_46857117_qa_5/environment/bootstrap.sh b/tasks/0046_857_46857117_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_857_46857117_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_857_46857117_qa_5/environment/pull_bucket.py b/tasks/0046_857_46857117_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_857_46857117_qa_5/environment/pull_bucket.py +++ b/tasks/0046_857_46857117_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_857_46857117_qa_5/task.toml b/tasks/0046_857_46857117_qa_5/task.toml index 46ab15d350694e9e84b79209e212b9e7e355e7bc..9afa812f65c12b6101edbaed5ba375f1cc6b8583 100644 --- a/tasks/0046_857_46857117_qa_5/task.toml +++ b/tasks/0046_857_46857117_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_875_46875284_qa_1/environment/bootstrap.sh b/tasks/0046_875_46875284_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_875_46875284_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_875_46875284_qa_1/environment/pull_bucket.py b/tasks/0046_875_46875284_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_875_46875284_qa_1/environment/pull_bucket.py +++ b/tasks/0046_875_46875284_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_875_46875284_qa_1/task.toml b/tasks/0046_875_46875284_qa_1/task.toml index c853d33bfa3818886ef7bfb7d8e5ba30c57f4985..18c9801794e507eb798331bd634b391d0e9a99de 100644 --- a/tasks/0046_875_46875284_qa_1/task.toml +++ b/tasks/0046_875_46875284_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_875_46875284_qa_2/environment/bootstrap.sh b/tasks/0046_875_46875284_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_875_46875284_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_875_46875284_qa_2/environment/pull_bucket.py b/tasks/0046_875_46875284_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_875_46875284_qa_2/environment/pull_bucket.py +++ b/tasks/0046_875_46875284_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_875_46875284_qa_2/task.toml b/tasks/0046_875_46875284_qa_2/task.toml index e6beb31adf790062b46be15a8a8fa79d22611c80..565533562aa757d02e9806b85701a63d384a5cfd 100644 --- a/tasks/0046_875_46875284_qa_2/task.toml +++ b/tasks/0046_875_46875284_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_905_46905660_qa_1/environment/bootstrap.sh b/tasks/0046_905_46905660_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_905_46905660_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_905_46905660_qa_1/environment/pull_bucket.py b/tasks/0046_905_46905660_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_905_46905660_qa_1/environment/pull_bucket.py +++ b/tasks/0046_905_46905660_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_905_46905660_qa_1/task.toml b/tasks/0046_905_46905660_qa_1/task.toml index 25a4ab42429a9923388a9b18a0d49766c9d20340..b3571d76a6d229dec2fa18e2cb884d9aa1cbaa6d 100644 --- a/tasks/0046_905_46905660_qa_1/task.toml +++ b/tasks/0046_905_46905660_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_933_46933248_qa_5/environment/bootstrap.sh b/tasks/0046_933_46933248_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_933_46933248_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_933_46933248_qa_5/environment/pull_bucket.py b/tasks/0046_933_46933248_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_933_46933248_qa_5/environment/pull_bucket.py +++ b/tasks/0046_933_46933248_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_933_46933248_qa_5/task.toml b/tasks/0046_933_46933248_qa_5/task.toml index 861b6fcfc4d91937d2e70736ffcc04def066ae44..8db1da56cd0033105f037715c9688667763d4e7a 100644 --- a/tasks/0046_933_46933248_qa_5/task.toml +++ b/tasks/0046_933_46933248_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_955_46955725_qa_4/environment/bootstrap.sh b/tasks/0046_955_46955725_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_955_46955725_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_955_46955725_qa_4/environment/pull_bucket.py b/tasks/0046_955_46955725_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_955_46955725_qa_4/environment/pull_bucket.py +++ b/tasks/0046_955_46955725_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_955_46955725_qa_4/task.toml b/tasks/0046_955_46955725_qa_4/task.toml index 5e0b93fad82c8349ef3e41996a37f97d810b0afd..0c82c0c33f4c4db473332b6b132ad289843bede1 100644 --- a/tasks/0046_955_46955725_qa_4/task.toml +++ b/tasks/0046_955_46955725_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0046_964_46964114_qa_1/environment/bootstrap.sh b/tasks/0046_964_46964114_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0046_964_46964114_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0046_964_46964114_qa_1/environment/pull_bucket.py b/tasks/0046_964_46964114_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0046_964_46964114_qa_1/environment/pull_bucket.py +++ b/tasks/0046_964_46964114_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0046_964_46964114_qa_1/task.toml b/tasks/0046_964_46964114_qa_1/task.toml index 98061d6716a1e7cb5f900312d35668fbe87b72f6..ddcefb3dac2e7f606540b75b663e52397d2dbb82 100644 --- a/tasks/0046_964_46964114_qa_1/task.toml +++ b/tasks/0046_964_46964114_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_059_47059066_qa_2/environment/bootstrap.sh b/tasks/0047_059_47059066_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_059_47059066_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_059_47059066_qa_2/environment/pull_bucket.py b/tasks/0047_059_47059066_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_059_47059066_qa_2/environment/pull_bucket.py +++ b/tasks/0047_059_47059066_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_059_47059066_qa_2/task.toml b/tasks/0047_059_47059066_qa_2/task.toml index b190eb6fc9c95f86f7d28cc5b8337c11c5de3ead..e988fda6d187870f1635ff2b6124fea98253c1c1 100644 --- a/tasks/0047_059_47059066_qa_2/task.toml +++ b/tasks/0047_059_47059066_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_266_47266614_qa_1/environment/bootstrap.sh b/tasks/0047_266_47266614_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_266_47266614_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_266_47266614_qa_1/environment/pull_bucket.py b/tasks/0047_266_47266614_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_266_47266614_qa_1/environment/pull_bucket.py +++ b/tasks/0047_266_47266614_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_266_47266614_qa_1/task.toml b/tasks/0047_266_47266614_qa_1/task.toml index dcb6e8389b21df836f7925d5367075a5c1268844..715fe375e123cda474409231ba3c041b70e75eea 100644 --- a/tasks/0047_266_47266614_qa_1/task.toml +++ b/tasks/0047_266_47266614_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_266_47266614_qa_3/environment/bootstrap.sh b/tasks/0047_266_47266614_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_266_47266614_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_266_47266614_qa_3/environment/pull_bucket.py b/tasks/0047_266_47266614_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_266_47266614_qa_3/environment/pull_bucket.py +++ b/tasks/0047_266_47266614_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_266_47266614_qa_3/task.toml b/tasks/0047_266_47266614_qa_3/task.toml index f3ecb80e479a28569761c0a10290a77b6ae3fafb..6952915a3afa3c4da5a4fdc0186c71358bdd63d1 100644 --- a/tasks/0047_266_47266614_qa_3/task.toml +++ b/tasks/0047_266_47266614_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_271_47271508_qa_4/environment/bootstrap.sh b/tasks/0047_271_47271508_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_271_47271508_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_271_47271508_qa_4/environment/pull_bucket.py b/tasks/0047_271_47271508_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_271_47271508_qa_4/environment/pull_bucket.py +++ b/tasks/0047_271_47271508_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_271_47271508_qa_4/task.toml b/tasks/0047_271_47271508_qa_4/task.toml index 54d3f0c3d232d70c504aaa18f0903684dae3ac5c..41d58fc370886b68b71c6c5e3141f078344c2387 100644 --- a/tasks/0047_271_47271508_qa_4/task.toml +++ b/tasks/0047_271_47271508_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_271_47271508_qa_5/environment/bootstrap.sh b/tasks/0047_271_47271508_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_271_47271508_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_271_47271508_qa_5/environment/pull_bucket.py b/tasks/0047_271_47271508_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_271_47271508_qa_5/environment/pull_bucket.py +++ b/tasks/0047_271_47271508_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_271_47271508_qa_5/task.toml b/tasks/0047_271_47271508_qa_5/task.toml index a72df8ce5f6fbd33973b057603acd70ce563c695..3b16fb1b604a6daf14e491ea3f58edbcb0b11bdb 100644 --- a/tasks/0047_271_47271508_qa_5/task.toml +++ b/tasks/0047_271_47271508_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_308_47308029_qa_1/environment/bootstrap.sh b/tasks/0047_308_47308029_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_308_47308029_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_308_47308029_qa_1/environment/pull_bucket.py b/tasks/0047_308_47308029_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_308_47308029_qa_1/environment/pull_bucket.py +++ b/tasks/0047_308_47308029_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_308_47308029_qa_1/task.toml b/tasks/0047_308_47308029_qa_1/task.toml index 37602e2939ddb5a8d83375efca31175482dd5119..e1bd998cb542fc4f44c880eaaaef155ec6ad1e53 100644 --- a/tasks/0047_308_47308029_qa_1/task.toml +++ b/tasks/0047_308_47308029_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_367_47367333_qa_4/environment/bootstrap.sh b/tasks/0047_367_47367333_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_367_47367333_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_367_47367333_qa_4/environment/pull_bucket.py b/tasks/0047_367_47367333_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_367_47367333_qa_4/environment/pull_bucket.py +++ b/tasks/0047_367_47367333_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_367_47367333_qa_4/task.toml b/tasks/0047_367_47367333_qa_4/task.toml index 22d11de10b54d23a73fb84027053def7e5618c4d..4b28a1347fd20569d0d5118167ce21746a272956 100644 --- a/tasks/0047_367_47367333_qa_4/task.toml +++ b/tasks/0047_367_47367333_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_398_47398075_qa_2/environment/bootstrap.sh b/tasks/0047_398_47398075_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_398_47398075_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_398_47398075_qa_2/environment/pull_bucket.py b/tasks/0047_398_47398075_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_398_47398075_qa_2/environment/pull_bucket.py +++ b/tasks/0047_398_47398075_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_398_47398075_qa_2/task.toml b/tasks/0047_398_47398075_qa_2/task.toml index cf44db6e2f0a344730e3d25407fa85422d127ddf..9bd3b34fffe1b21d92818fc3d28df3cb5ee14b1f 100644 --- a/tasks/0047_398_47398075_qa_2/task.toml +++ b/tasks/0047_398_47398075_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_398_47398075_qa_5/environment/bootstrap.sh b/tasks/0047_398_47398075_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_398_47398075_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_398_47398075_qa_5/environment/pull_bucket.py b/tasks/0047_398_47398075_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_398_47398075_qa_5/environment/pull_bucket.py +++ b/tasks/0047_398_47398075_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_398_47398075_qa_5/task.toml b/tasks/0047_398_47398075_qa_5/task.toml index 1ca5eecd2a52393a15cc84f52af698e17ad143bc..ee8f2f3ea5db8f6a73eff04af9ca5f9a20d2cb10 100644 --- a/tasks/0047_398_47398075_qa_5/task.toml +++ b/tasks/0047_398_47398075_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_417_47417997_qa_1/environment/bootstrap.sh b/tasks/0047_417_47417997_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_417_47417997_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_417_47417997_qa_1/environment/pull_bucket.py b/tasks/0047_417_47417997_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_417_47417997_qa_1/environment/pull_bucket.py +++ b/tasks/0047_417_47417997_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_417_47417997_qa_1/task.toml b/tasks/0047_417_47417997_qa_1/task.toml index cf6c9d5f1f96d97c92961fcd462a79d258c4f99e..2db1b42e32e05dbd016c8f3184495a9e9408c1b4 100644 --- a/tasks/0047_417_47417997_qa_1/task.toml +++ b/tasks/0047_417_47417997_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_417_47417997_qa_3/environment/bootstrap.sh b/tasks/0047_417_47417997_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_417_47417997_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_417_47417997_qa_3/environment/pull_bucket.py b/tasks/0047_417_47417997_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_417_47417997_qa_3/environment/pull_bucket.py +++ b/tasks/0047_417_47417997_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_417_47417997_qa_3/task.toml b/tasks/0047_417_47417997_qa_3/task.toml index 8993cfd7961e0d54bc75423ca0369e568891d8d7..0b8060389f324bb0e0d7f16fa5ac99a75dec8caf 100644 --- a/tasks/0047_417_47417997_qa_3/task.toml +++ b/tasks/0047_417_47417997_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_428_47428905_qa_2/environment/bootstrap.sh b/tasks/0047_428_47428905_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_428_47428905_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_428_47428905_qa_2/environment/pull_bucket.py b/tasks/0047_428_47428905_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_428_47428905_qa_2/environment/pull_bucket.py +++ b/tasks/0047_428_47428905_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_428_47428905_qa_2/task.toml b/tasks/0047_428_47428905_qa_2/task.toml index 417ad287ae63bbe3229c8b9ce5387581a5c32a01..7be0736690cd36b110cc5dbecd2614d602a4407a 100644 --- a/tasks/0047_428_47428905_qa_2/task.toml +++ b/tasks/0047_428_47428905_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_507_47507147_qa_5/environment/bootstrap.sh b/tasks/0047_507_47507147_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_507_47507147_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_507_47507147_qa_5/environment/pull_bucket.py b/tasks/0047_507_47507147_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_507_47507147_qa_5/environment/pull_bucket.py +++ b/tasks/0047_507_47507147_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_507_47507147_qa_5/task.toml b/tasks/0047_507_47507147_qa_5/task.toml index adf7a9168e1f73f62901cd14d1aa34f3b18c4f85..89a5d94ddc62ef9a472647720006d95fa5537251 100644 --- a/tasks/0047_507_47507147_qa_5/task.toml +++ b/tasks/0047_507_47507147_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_560_47560034_qa_1/environment/bootstrap.sh b/tasks/0047_560_47560034_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_560_47560034_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_560_47560034_qa_1/environment/pull_bucket.py b/tasks/0047_560_47560034_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_560_47560034_qa_1/environment/pull_bucket.py +++ b/tasks/0047_560_47560034_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_560_47560034_qa_1/task.toml b/tasks/0047_560_47560034_qa_1/task.toml index 302594d0fb0864d574055e6501ecf6363e41f83c..5a90f86fb2bb234a388747b6e0d5916bcf2c0c32 100644 --- a/tasks/0047_560_47560034_qa_1/task.toml +++ b/tasks/0047_560_47560034_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_560_47560034_qa_4/environment/bootstrap.sh b/tasks/0047_560_47560034_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_560_47560034_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_560_47560034_qa_4/environment/pull_bucket.py b/tasks/0047_560_47560034_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_560_47560034_qa_4/environment/pull_bucket.py +++ b/tasks/0047_560_47560034_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_560_47560034_qa_4/task.toml b/tasks/0047_560_47560034_qa_4/task.toml index b050893cebe67ea21157ea8ef7ec4863d9d89a44..a6b518b642b17ba839d2f86dadaaf62af67ef370 100644 --- a/tasks/0047_560_47560034_qa_4/task.toml +++ b/tasks/0047_560_47560034_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_560_47560034_qa_5/environment/bootstrap.sh b/tasks/0047_560_47560034_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_560_47560034_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_560_47560034_qa_5/environment/pull_bucket.py b/tasks/0047_560_47560034_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_560_47560034_qa_5/environment/pull_bucket.py +++ b/tasks/0047_560_47560034_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_560_47560034_qa_5/task.toml b/tasks/0047_560_47560034_qa_5/task.toml index f525a3722d1d844cb0daf6a346d5554005c990d2..fc772d1db5dcef964d5d9b2d68da80f5f28a39af 100644 --- a/tasks/0047_560_47560034_qa_5/task.toml +++ b/tasks/0047_560_47560034_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_564_47564024_qa_3/environment/bootstrap.sh b/tasks/0047_564_47564024_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_564_47564024_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_564_47564024_qa_3/environment/pull_bucket.py b/tasks/0047_564_47564024_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_564_47564024_qa_3/environment/pull_bucket.py +++ b/tasks/0047_564_47564024_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_564_47564024_qa_3/task.toml b/tasks/0047_564_47564024_qa_3/task.toml index 096d9245710b024c68a8ac58716ee541eb7d5160..b4461d38f5b756ff4278814f400d40392ae7c6a0 100644 --- a/tasks/0047_564_47564024_qa_3/task.toml +++ b/tasks/0047_564_47564024_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_591_47591946_qa_1/environment/bootstrap.sh b/tasks/0047_591_47591946_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_591_47591946_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_591_47591946_qa_1/environment/pull_bucket.py b/tasks/0047_591_47591946_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_591_47591946_qa_1/environment/pull_bucket.py +++ b/tasks/0047_591_47591946_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_591_47591946_qa_1/task.toml b/tasks/0047_591_47591946_qa_1/task.toml index d1efc4a07d91c070501f985dc2f2fe1d0ed8c638..7e57ce3cb4254fcd9b0bab45f1d13899de7db25d 100644 --- a/tasks/0047_591_47591946_qa_1/task.toml +++ b/tasks/0047_591_47591946_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_591_47591946_qa_3/environment/bootstrap.sh b/tasks/0047_591_47591946_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_591_47591946_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_591_47591946_qa_3/environment/pull_bucket.py b/tasks/0047_591_47591946_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_591_47591946_qa_3/environment/pull_bucket.py +++ b/tasks/0047_591_47591946_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_591_47591946_qa_3/task.toml b/tasks/0047_591_47591946_qa_3/task.toml index f578d79a53bc24d2a05060171f6f45fc2c15d6b9..d4a65e65a909a938b6b17aaae87abe3dcce7d6c1 100644 --- a/tasks/0047_591_47591946_qa_3/task.toml +++ b/tasks/0047_591_47591946_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_667_47667613_qa_5/environment/bootstrap.sh b/tasks/0047_667_47667613_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_667_47667613_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_667_47667613_qa_5/environment/pull_bucket.py b/tasks/0047_667_47667613_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_667_47667613_qa_5/environment/pull_bucket.py +++ b/tasks/0047_667_47667613_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_667_47667613_qa_5/task.toml b/tasks/0047_667_47667613_qa_5/task.toml index 7b3c17f3465be15f8790196c587c287bbb50260e..25ac7fb064068963a3d839101b9ee3f0696dc4b9 100644 --- a/tasks/0047_667_47667613_qa_5/task.toml +++ b/tasks/0047_667_47667613_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_751_47751075_qa_2/environment/bootstrap.sh b/tasks/0047_751_47751075_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_751_47751075_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_751_47751075_qa_2/environment/pull_bucket.py b/tasks/0047_751_47751075_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_751_47751075_qa_2/environment/pull_bucket.py +++ b/tasks/0047_751_47751075_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_751_47751075_qa_2/task.toml b/tasks/0047_751_47751075_qa_2/task.toml index d0e66927a643eea9f4eec7d2211dd931d818b306..a3b8a07d4c7194df30711de80fac6c5a249eacca 100644 --- a/tasks/0047_751_47751075_qa_2/task.toml +++ b/tasks/0047_751_47751075_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_757_47757565_qa_3/environment/bootstrap.sh b/tasks/0047_757_47757565_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_757_47757565_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_757_47757565_qa_3/environment/pull_bucket.py b/tasks/0047_757_47757565_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_757_47757565_qa_3/environment/pull_bucket.py +++ b/tasks/0047_757_47757565_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_757_47757565_qa_3/task.toml b/tasks/0047_757_47757565_qa_3/task.toml index a7d6b8eba92b8dbfc1ed5fb73db8c09823f8d329..7e869f3b1143cf4acb5365acd479e79705968870 100644 --- a/tasks/0047_757_47757565_qa_3/task.toml +++ b/tasks/0047_757_47757565_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_766_47766276_qa_1/environment/bootstrap.sh b/tasks/0047_766_47766276_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_766_47766276_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_766_47766276_qa_1/environment/pull_bucket.py b/tasks/0047_766_47766276_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_766_47766276_qa_1/environment/pull_bucket.py +++ b/tasks/0047_766_47766276_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_766_47766276_qa_1/task.toml b/tasks/0047_766_47766276_qa_1/task.toml index aca351ba0fe6d268a8632b8064d78275ecff90e3..6402cb0f161ac82bc4962cde6a51e2d20b6fa35b 100644 --- a/tasks/0047_766_47766276_qa_1/task.toml +++ b/tasks/0047_766_47766276_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_766_47766276_qa_2/environment/bootstrap.sh b/tasks/0047_766_47766276_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_766_47766276_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_766_47766276_qa_2/environment/pull_bucket.py b/tasks/0047_766_47766276_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_766_47766276_qa_2/environment/pull_bucket.py +++ b/tasks/0047_766_47766276_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_766_47766276_qa_2/task.toml b/tasks/0047_766_47766276_qa_2/task.toml index 874c9e5f2ba13d60fc638c54ddd16d95e4dfe56f..43cf90c394d94eaea7e2101075979fda6d5ca4a8 100644 --- a/tasks/0047_766_47766276_qa_2/task.toml +++ b/tasks/0047_766_47766276_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_835_47835417_qa_1/environment/bootstrap.sh b/tasks/0047_835_47835417_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_835_47835417_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_835_47835417_qa_1/environment/pull_bucket.py b/tasks/0047_835_47835417_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_835_47835417_qa_1/environment/pull_bucket.py +++ b/tasks/0047_835_47835417_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_835_47835417_qa_1/task.toml b/tasks/0047_835_47835417_qa_1/task.toml index bcda5851de5ccd02f8360b345920355bbaa97aba..9065b5ee39438070672c96f78b55e8b7941811b5 100644 --- a/tasks/0047_835_47835417_qa_1/task.toml +++ b/tasks/0047_835_47835417_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_849_47849671_qa_4/environment/bootstrap.sh b/tasks/0047_849_47849671_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_849_47849671_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_849_47849671_qa_4/environment/pull_bucket.py b/tasks/0047_849_47849671_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_849_47849671_qa_4/environment/pull_bucket.py +++ b/tasks/0047_849_47849671_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_849_47849671_qa_4/task.toml b/tasks/0047_849_47849671_qa_4/task.toml index c3380b97aa1bfcea7284b92e31fe60d59f757c03..30de374e15f6c9f267a50c92f36cdd5b63fb7fa2 100644 --- a/tasks/0047_849_47849671_qa_4/task.toml +++ b/tasks/0047_849_47849671_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_852_47852416_qa_2/environment/bootstrap.sh b/tasks/0047_852_47852416_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_852_47852416_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_852_47852416_qa_2/environment/pull_bucket.py b/tasks/0047_852_47852416_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_852_47852416_qa_2/environment/pull_bucket.py +++ b/tasks/0047_852_47852416_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_852_47852416_qa_2/task.toml b/tasks/0047_852_47852416_qa_2/task.toml index f6a94ce0431598d29e2815a411fe2169d8f4758f..96726771f58c9d73e797d176c00208026695952f 100644 --- a/tasks/0047_852_47852416_qa_2/task.toml +++ b/tasks/0047_852_47852416_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_862_47862196_qa_2/environment/bootstrap.sh b/tasks/0047_862_47862196_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_862_47862196_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_862_47862196_qa_2/environment/pull_bucket.py b/tasks/0047_862_47862196_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_862_47862196_qa_2/environment/pull_bucket.py +++ b/tasks/0047_862_47862196_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_862_47862196_qa_2/task.toml b/tasks/0047_862_47862196_qa_2/task.toml index 936c34cf6c44a60f459d88297a5b3e3bdf2d84ea..f43df9d0fec36ae66d45cd51f80a7c20a25a772b 100644 --- a/tasks/0047_862_47862196_qa_2/task.toml +++ b/tasks/0047_862_47862196_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0047_862_47862196_qa_3/environment/bootstrap.sh b/tasks/0047_862_47862196_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0047_862_47862196_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0047_862_47862196_qa_3/environment/pull_bucket.py b/tasks/0047_862_47862196_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0047_862_47862196_qa_3/environment/pull_bucket.py +++ b/tasks/0047_862_47862196_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0047_862_47862196_qa_3/task.toml b/tasks/0047_862_47862196_qa_3/task.toml index 2926a3207688118c5833a035cc4746e1d9567b82..5aea405ace7cbc8ec929f4852e1201fd3af715c3 100644 --- a/tasks/0047_862_47862196_qa_3/task.toml +++ b/tasks/0047_862_47862196_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_022_48022242_qa_3/environment/bootstrap.sh b/tasks/0048_022_48022242_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_022_48022242_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_022_48022242_qa_3/environment/pull_bucket.py b/tasks/0048_022_48022242_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_022_48022242_qa_3/environment/pull_bucket.py +++ b/tasks/0048_022_48022242_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_022_48022242_qa_3/task.toml b/tasks/0048_022_48022242_qa_3/task.toml index 3376640353b11fa59d23178f3aa0bd3862f6f3dc..fc9ad568bd752804a837e7b68757c869b325212d 100644 --- a/tasks/0048_022_48022242_qa_3/task.toml +++ b/tasks/0048_022_48022242_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_022_48022242_qa_4/environment/bootstrap.sh b/tasks/0048_022_48022242_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_022_48022242_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_022_48022242_qa_4/environment/pull_bucket.py b/tasks/0048_022_48022242_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_022_48022242_qa_4/environment/pull_bucket.py +++ b/tasks/0048_022_48022242_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_022_48022242_qa_4/task.toml b/tasks/0048_022_48022242_qa_4/task.toml index aae687d892d7a80f2b1c654951a614351d739d9b..14510872d9a1a7bbcf1f8ab975ae6215812f56dc 100644 --- a/tasks/0048_022_48022242_qa_4/task.toml +++ b/tasks/0048_022_48022242_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_049_48049467_qa_5/environment/bootstrap.sh b/tasks/0048_049_48049467_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_049_48049467_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_049_48049467_qa_5/environment/pull_bucket.py b/tasks/0048_049_48049467_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_049_48049467_qa_5/environment/pull_bucket.py +++ b/tasks/0048_049_48049467_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_049_48049467_qa_5/task.toml b/tasks/0048_049_48049467_qa_5/task.toml index 1aca4af2eb0737b758e4b8c90655e52a996d963b..d84f532a18f598eab9b3a9e81c2e21a82d3730e0 100644 --- a/tasks/0048_049_48049467_qa_5/task.toml +++ b/tasks/0048_049_48049467_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_061_48061947_qa_2/environment/bootstrap.sh b/tasks/0048_061_48061947_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_061_48061947_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_061_48061947_qa_2/environment/pull_bucket.py b/tasks/0048_061_48061947_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_061_48061947_qa_2/environment/pull_bucket.py +++ b/tasks/0048_061_48061947_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_061_48061947_qa_2/task.toml b/tasks/0048_061_48061947_qa_2/task.toml index 34a66ca68e8f04d8cadc2ca1c09222e8b1da8a9e..cdfa55ed52c707e028891d8d661d05ea5a334cee 100644 --- a/tasks/0048_061_48061947_qa_2/task.toml +++ b/tasks/0048_061_48061947_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_061_48061947_qa_3/environment/bootstrap.sh b/tasks/0048_061_48061947_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_061_48061947_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_061_48061947_qa_3/environment/pull_bucket.py b/tasks/0048_061_48061947_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_061_48061947_qa_3/environment/pull_bucket.py +++ b/tasks/0048_061_48061947_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_061_48061947_qa_3/task.toml b/tasks/0048_061_48061947_qa_3/task.toml index 647b232d280720499a73613c8af4ef2719f083a5..b741ec97f77902d00dff3c368b9e91f8e8a134fb 100644 --- a/tasks/0048_061_48061947_qa_3/task.toml +++ b/tasks/0048_061_48061947_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_090_48090162_qa_2/environment/bootstrap.sh b/tasks/0048_090_48090162_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_090_48090162_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_090_48090162_qa_2/environment/pull_bucket.py b/tasks/0048_090_48090162_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_090_48090162_qa_2/environment/pull_bucket.py +++ b/tasks/0048_090_48090162_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_090_48090162_qa_2/task.toml b/tasks/0048_090_48090162_qa_2/task.toml index 45293774eb29708ee3873ed36705b0b86bd34898..1b80a3a6cd9c2f627149a1ccf9f2e2998777524a 100644 --- a/tasks/0048_090_48090162_qa_2/task.toml +++ b/tasks/0048_090_48090162_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_093_48093392_qa_5/environment/bootstrap.sh b/tasks/0048_093_48093392_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_093_48093392_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_093_48093392_qa_5/environment/pull_bucket.py b/tasks/0048_093_48093392_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_093_48093392_qa_5/environment/pull_bucket.py +++ b/tasks/0048_093_48093392_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_093_48093392_qa_5/task.toml b/tasks/0048_093_48093392_qa_5/task.toml index f981003f1d18e75be44421c0f887f7c1343dfdfa..393c25ce7633425b67ac3466ccc564202554ac6b 100644 --- a/tasks/0048_093_48093392_qa_5/task.toml +++ b/tasks/0048_093_48093392_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_101_48101055_qa_3/environment/bootstrap.sh b/tasks/0048_101_48101055_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_101_48101055_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_101_48101055_qa_3/environment/pull_bucket.py b/tasks/0048_101_48101055_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_101_48101055_qa_3/environment/pull_bucket.py +++ b/tasks/0048_101_48101055_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_101_48101055_qa_3/task.toml b/tasks/0048_101_48101055_qa_3/task.toml index 2d38c40c29e87f9526ebc610730a62644eefc320..5df6c93c3c3123a75a14a631834b020b371a85f8 100644 --- a/tasks/0048_101_48101055_qa_3/task.toml +++ b/tasks/0048_101_48101055_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_107_48107437_qa_2/environment/bootstrap.sh b/tasks/0048_107_48107437_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_107_48107437_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_107_48107437_qa_2/environment/pull_bucket.py b/tasks/0048_107_48107437_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_107_48107437_qa_2/environment/pull_bucket.py +++ b/tasks/0048_107_48107437_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_107_48107437_qa_2/task.toml b/tasks/0048_107_48107437_qa_2/task.toml index a9a0d56d266a507adbae1b41a42156cd70fd7b97..3ca8a938c4b6d10b38682a31dbb4af0fbf2825fc 100644 --- a/tasks/0048_107_48107437_qa_2/task.toml +++ b/tasks/0048_107_48107437_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_357_48357285_qa_5/environment/bootstrap.sh b/tasks/0048_357_48357285_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_357_48357285_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_357_48357285_qa_5/environment/pull_bucket.py b/tasks/0048_357_48357285_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_357_48357285_qa_5/environment/pull_bucket.py +++ b/tasks/0048_357_48357285_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_357_48357285_qa_5/task.toml b/tasks/0048_357_48357285_qa_5/task.toml index 7de0f667c0a9f57beecfa13a41605f947cb20a03..3ffdb7a60525da8c63f343e7a4e0aeb155ece4c7 100644 --- a/tasks/0048_357_48357285_qa_5/task.toml +++ b/tasks/0048_357_48357285_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_371_48371332_qa_5/environment/bootstrap.sh b/tasks/0048_371_48371332_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_371_48371332_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_371_48371332_qa_5/environment/pull_bucket.py b/tasks/0048_371_48371332_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_371_48371332_qa_5/environment/pull_bucket.py +++ b/tasks/0048_371_48371332_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_371_48371332_qa_5/task.toml b/tasks/0048_371_48371332_qa_5/task.toml index 651942f66c44622d9698931bd344c14a4ceb553e..ce1b1cf55b56a45e759af9bd8aebda49b2896087 100644 --- a/tasks/0048_371_48371332_qa_5/task.toml +++ b/tasks/0048_371_48371332_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_420_48420121_qa_3/environment/bootstrap.sh b/tasks/0048_420_48420121_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_420_48420121_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_420_48420121_qa_3/environment/pull_bucket.py b/tasks/0048_420_48420121_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_420_48420121_qa_3/environment/pull_bucket.py +++ b/tasks/0048_420_48420121_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_420_48420121_qa_3/task.toml b/tasks/0048_420_48420121_qa_3/task.toml index 4bef167a900c625469e74ae8c9a4a00914fd57f3..4d5353bcc34e93902b60e7b9495db9fecac7c192 100644 --- a/tasks/0048_420_48420121_qa_3/task.toml +++ b/tasks/0048_420_48420121_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_436_48436455_qa_2/environment/bootstrap.sh b/tasks/0048_436_48436455_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_436_48436455_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_436_48436455_qa_2/environment/pull_bucket.py b/tasks/0048_436_48436455_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_436_48436455_qa_2/environment/pull_bucket.py +++ b/tasks/0048_436_48436455_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_436_48436455_qa_2/task.toml b/tasks/0048_436_48436455_qa_2/task.toml index 9eea06f20dbaf17517603fb54bf2ea1029338ed3..0efa67f9b342a9604b65359dd24711b48c500f14 100644 --- a/tasks/0048_436_48436455_qa_2/task.toml +++ b/tasks/0048_436_48436455_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_436_48436455_qa_3/environment/bootstrap.sh b/tasks/0048_436_48436455_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_436_48436455_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_436_48436455_qa_3/environment/pull_bucket.py b/tasks/0048_436_48436455_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_436_48436455_qa_3/environment/pull_bucket.py +++ b/tasks/0048_436_48436455_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_436_48436455_qa_3/task.toml b/tasks/0048_436_48436455_qa_3/task.toml index 418b5ed3008a4911605e5bb9627c7be80ef9467b..c6c5f40aed63331418fcde63bf4b1f4953bb3bd9 100644 --- a/tasks/0048_436_48436455_qa_3/task.toml +++ b/tasks/0048_436_48436455_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_459_48459218_qa_3/environment/bootstrap.sh b/tasks/0048_459_48459218_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_459_48459218_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_459_48459218_qa_3/environment/pull_bucket.py b/tasks/0048_459_48459218_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_459_48459218_qa_3/environment/pull_bucket.py +++ b/tasks/0048_459_48459218_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_459_48459218_qa_3/task.toml b/tasks/0048_459_48459218_qa_3/task.toml index 329e4f0305ebed1c417da6f8308a539d61d3f33f..dbee48d1aa37b5b516309c362ddc182352cb37a9 100644 --- a/tasks/0048_459_48459218_qa_3/task.toml +++ b/tasks/0048_459_48459218_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_468_48468313_qa_5/environment/bootstrap.sh b/tasks/0048_468_48468313_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_468_48468313_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_468_48468313_qa_5/environment/pull_bucket.py b/tasks/0048_468_48468313_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_468_48468313_qa_5/environment/pull_bucket.py +++ b/tasks/0048_468_48468313_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_468_48468313_qa_5/task.toml b/tasks/0048_468_48468313_qa_5/task.toml index a1d3c3391e730d663b327aa449256b8055147138..b89706d713075d69c890ab7852fd8c058d93282e 100644 --- a/tasks/0048_468_48468313_qa_5/task.toml +++ b/tasks/0048_468_48468313_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_488_48488979_qa_3/environment/bootstrap.sh b/tasks/0048_488_48488979_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_488_48488979_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_488_48488979_qa_3/environment/pull_bucket.py b/tasks/0048_488_48488979_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_488_48488979_qa_3/environment/pull_bucket.py +++ b/tasks/0048_488_48488979_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_488_48488979_qa_3/task.toml b/tasks/0048_488_48488979_qa_3/task.toml index 935526c95e4ae45aa1d84948ac904198d5077c4d..e73c33aaf82b219b53426d4ca4db2c0979a99a15 100644 --- a/tasks/0048_488_48488979_qa_3/task.toml +++ b/tasks/0048_488_48488979_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_488_48488979_qa_4/environment/bootstrap.sh b/tasks/0048_488_48488979_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_488_48488979_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_488_48488979_qa_4/environment/pull_bucket.py b/tasks/0048_488_48488979_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_488_48488979_qa_4/environment/pull_bucket.py +++ b/tasks/0048_488_48488979_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_488_48488979_qa_4/task.toml b/tasks/0048_488_48488979_qa_4/task.toml index 7333561650df89c8869b1330406a3d102a4401bd..55c184bf6808684eecd9bd590216deac30005d40 100644 --- a/tasks/0048_488_48488979_qa_4/task.toml +++ b/tasks/0048_488_48488979_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_518_48518667_qa_4/environment/bootstrap.sh b/tasks/0048_518_48518667_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_518_48518667_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_518_48518667_qa_4/environment/pull_bucket.py b/tasks/0048_518_48518667_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_518_48518667_qa_4/environment/pull_bucket.py +++ b/tasks/0048_518_48518667_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_518_48518667_qa_4/task.toml b/tasks/0048_518_48518667_qa_4/task.toml index 629bc3980a52b0c4b0c7e926c355c6628190f5f1..178d4b800e471ef6c1f63a9958eaa60c8cf1fa5c 100644 --- a/tasks/0048_518_48518667_qa_4/task.toml +++ b/tasks/0048_518_48518667_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_584_48584786_qa_2/environment/bootstrap.sh b/tasks/0048_584_48584786_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_584_48584786_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_584_48584786_qa_2/environment/pull_bucket.py b/tasks/0048_584_48584786_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_584_48584786_qa_2/environment/pull_bucket.py +++ b/tasks/0048_584_48584786_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_584_48584786_qa_2/task.toml b/tasks/0048_584_48584786_qa_2/task.toml index e184a2646cf55790d8dd287ec3b1b3d48b8c1e89..9bb3f0b4be7e2fe315f28c7e5d99a53de93b8f76 100644 --- a/tasks/0048_584_48584786_qa_2/task.toml +++ b/tasks/0048_584_48584786_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_651_48651619_qa_4/environment/bootstrap.sh b/tasks/0048_651_48651619_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_651_48651619_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_651_48651619_qa_4/environment/pull_bucket.py b/tasks/0048_651_48651619_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_651_48651619_qa_4/environment/pull_bucket.py +++ b/tasks/0048_651_48651619_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_651_48651619_qa_4/task.toml b/tasks/0048_651_48651619_qa_4/task.toml index e2b187659567442c85c99aca424763965edf20c8..bff157bff1ac8fc6850a712bebac11fa75891a6f 100644 --- a/tasks/0048_651_48651619_qa_4/task.toml +++ b/tasks/0048_651_48651619_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_695_48695908_qa_2/environment/bootstrap.sh b/tasks/0048_695_48695908_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_695_48695908_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_695_48695908_qa_2/environment/pull_bucket.py b/tasks/0048_695_48695908_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_695_48695908_qa_2/environment/pull_bucket.py +++ b/tasks/0048_695_48695908_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_695_48695908_qa_2/task.toml b/tasks/0048_695_48695908_qa_2/task.toml index 945ec703ee34b5daa189c9d0b01069250909d73d..53a6a9aece30e98e870113547798d2b1c1934338 100644 --- a/tasks/0048_695_48695908_qa_2/task.toml +++ b/tasks/0048_695_48695908_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_708_48708349_qa_2/environment/bootstrap.sh b/tasks/0048_708_48708349_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_708_48708349_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_708_48708349_qa_2/environment/pull_bucket.py b/tasks/0048_708_48708349_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_708_48708349_qa_2/environment/pull_bucket.py +++ b/tasks/0048_708_48708349_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_708_48708349_qa_2/task.toml b/tasks/0048_708_48708349_qa_2/task.toml index 65167a6b763120e3a285c962ee191be3ff5681bf..b19cda0e4b36214bab9dd42a18162d43449013bd 100644 --- a/tasks/0048_708_48708349_qa_2/task.toml +++ b/tasks/0048_708_48708349_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_708_48708349_qa_3/environment/bootstrap.sh b/tasks/0048_708_48708349_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_708_48708349_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_708_48708349_qa_3/environment/pull_bucket.py b/tasks/0048_708_48708349_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_708_48708349_qa_3/environment/pull_bucket.py +++ b/tasks/0048_708_48708349_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_708_48708349_qa_3/task.toml b/tasks/0048_708_48708349_qa_3/task.toml index 1b3703f732bb8dfc92bd5e27910e486caadaaadc..fbf77dc007a0333d505e9966f1cf9bb142b4fe55 100644 --- a/tasks/0048_708_48708349_qa_3/task.toml +++ b/tasks/0048_708_48708349_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_765_48765595_qa_3/environment/bootstrap.sh b/tasks/0048_765_48765595_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_765_48765595_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_765_48765595_qa_3/environment/pull_bucket.py b/tasks/0048_765_48765595_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_765_48765595_qa_3/environment/pull_bucket.py +++ b/tasks/0048_765_48765595_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_765_48765595_qa_3/task.toml b/tasks/0048_765_48765595_qa_3/task.toml index a89ca44a7dcbc43a396a48ecbff29b3ec7ae9754..180825c9d9c394fba0eae7fb91d4246f6a3f1e62 100644 --- a/tasks/0048_765_48765595_qa_3/task.toml +++ b/tasks/0048_765_48765595_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_765_48765595_qa_5/environment/bootstrap.sh b/tasks/0048_765_48765595_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_765_48765595_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_765_48765595_qa_5/environment/pull_bucket.py b/tasks/0048_765_48765595_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_765_48765595_qa_5/environment/pull_bucket.py +++ b/tasks/0048_765_48765595_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_765_48765595_qa_5/task.toml b/tasks/0048_765_48765595_qa_5/task.toml index 246a8eebb59225ec565aeb20a57401f315729a3f..d7a0dbd3b05121c09018aea73c32d4b0285ea742 100644 --- a/tasks/0048_765_48765595_qa_5/task.toml +++ b/tasks/0048_765_48765595_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_823_48823313_qa_1/environment/bootstrap.sh b/tasks/0048_823_48823313_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_823_48823313_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_823_48823313_qa_1/environment/pull_bucket.py b/tasks/0048_823_48823313_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_823_48823313_qa_1/environment/pull_bucket.py +++ b/tasks/0048_823_48823313_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_823_48823313_qa_1/task.toml b/tasks/0048_823_48823313_qa_1/task.toml index 49beedacff5d7fa67b6a3b2c4c41c836aea1a758..37ac90f0ec6949ac20beec2880738074425b23de 100644 --- a/tasks/0048_823_48823313_qa_1/task.toml +++ b/tasks/0048_823_48823313_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_873_48873646_qa_3/environment/bootstrap.sh b/tasks/0048_873_48873646_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_873_48873646_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_873_48873646_qa_3/environment/pull_bucket.py b/tasks/0048_873_48873646_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_873_48873646_qa_3/environment/pull_bucket.py +++ b/tasks/0048_873_48873646_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_873_48873646_qa_3/task.toml b/tasks/0048_873_48873646_qa_3/task.toml index 3347fd074d58e1c248c93e5d92993c4b5b40bca5..75814f35ca4339656e534102984c87c02ab4f902 100644 --- a/tasks/0048_873_48873646_qa_3/task.toml +++ b/tasks/0048_873_48873646_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_873_48873646_qa_4/environment/bootstrap.sh b/tasks/0048_873_48873646_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_873_48873646_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_873_48873646_qa_4/environment/pull_bucket.py b/tasks/0048_873_48873646_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_873_48873646_qa_4/environment/pull_bucket.py +++ b/tasks/0048_873_48873646_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_873_48873646_qa_4/task.toml b/tasks/0048_873_48873646_qa_4/task.toml index 7a603d5972e0cd962e17309847dd0d4839cebe1a..c3ea1ce4a7bafd7cd211216ecf7b6565b09f20eb 100644 --- a/tasks/0048_873_48873646_qa_4/task.toml +++ b/tasks/0048_873_48873646_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_881_48881747_qa_3/environment/bootstrap.sh b/tasks/0048_881_48881747_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_881_48881747_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_881_48881747_qa_3/environment/pull_bucket.py b/tasks/0048_881_48881747_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_881_48881747_qa_3/environment/pull_bucket.py +++ b/tasks/0048_881_48881747_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_881_48881747_qa_3/task.toml b/tasks/0048_881_48881747_qa_3/task.toml index 8ff4d29db14248c182be853abe74b00cf4b2b420..7918126c383b2d9b9b38bbc5c6bde6e7e5ed541d 100644 --- a/tasks/0048_881_48881747_qa_3/task.toml +++ b/tasks/0048_881_48881747_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_917_48917297_qa_2/environment/bootstrap.sh b/tasks/0048_917_48917297_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_917_48917297_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_917_48917297_qa_2/environment/pull_bucket.py b/tasks/0048_917_48917297_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_917_48917297_qa_2/environment/pull_bucket.py +++ b/tasks/0048_917_48917297_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_917_48917297_qa_2/task.toml b/tasks/0048_917_48917297_qa_2/task.toml index 382d3d58def9f77665af8bb26651c3fd69ca1cab..b1154b12bdfe4f1174e84e342252474e92b74e2f 100644 --- a/tasks/0048_917_48917297_qa_2/task.toml +++ b/tasks/0048_917_48917297_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_917_48917297_qa_3/environment/bootstrap.sh b/tasks/0048_917_48917297_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_917_48917297_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_917_48917297_qa_3/environment/pull_bucket.py b/tasks/0048_917_48917297_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_917_48917297_qa_3/environment/pull_bucket.py +++ b/tasks/0048_917_48917297_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_917_48917297_qa_3/task.toml b/tasks/0048_917_48917297_qa_3/task.toml index 7e1f4498dd4451c677523a63023797bfac6859a8..b5440e64740a1e602a1caad7a6cee829fe12485f 100644 --- a/tasks/0048_917_48917297_qa_3/task.toml +++ b/tasks/0048_917_48917297_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_917_48917297_qa_4/environment/bootstrap.sh b/tasks/0048_917_48917297_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_917_48917297_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_917_48917297_qa_4/environment/pull_bucket.py b/tasks/0048_917_48917297_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_917_48917297_qa_4/environment/pull_bucket.py +++ b/tasks/0048_917_48917297_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_917_48917297_qa_4/task.toml b/tasks/0048_917_48917297_qa_4/task.toml index 21d34c96479f657025ee45b6a6ec48bd81ca7a3c..d175f05834d69fd2c52a65e11adb498a43b2e7e1 100644 --- a/tasks/0048_917_48917297_qa_4/task.toml +++ b/tasks/0048_917_48917297_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_966_48966571_qa_3/environment/bootstrap.sh b/tasks/0048_966_48966571_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_966_48966571_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_966_48966571_qa_3/environment/pull_bucket.py b/tasks/0048_966_48966571_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_966_48966571_qa_3/environment/pull_bucket.py +++ b/tasks/0048_966_48966571_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_966_48966571_qa_3/task.toml b/tasks/0048_966_48966571_qa_3/task.toml index 48b2f77575e6c6d4e151074ac6c45a61a87d6d41..0a00ee90d9787d766338bac7b275e6afa8959e56 100644 --- a/tasks/0048_966_48966571_qa_3/task.toml +++ b/tasks/0048_966_48966571_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0048_996_48996091_qa_4/environment/bootstrap.sh b/tasks/0048_996_48996091_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0048_996_48996091_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0048_996_48996091_qa_4/environment/pull_bucket.py b/tasks/0048_996_48996091_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0048_996_48996091_qa_4/environment/pull_bucket.py +++ b/tasks/0048_996_48996091_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0048_996_48996091_qa_4/task.toml b/tasks/0048_996_48996091_qa_4/task.toml index 1d10fe6c9ce4b9a66012464eb50fb3c14cee6433..27b0165981e0c909c89327ca3132a576e4862fd7 100644 --- a/tasks/0048_996_48996091_qa_4/task.toml +++ b/tasks/0048_996_48996091_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_008_49008236_qa_5/environment/bootstrap.sh b/tasks/0049_008_49008236_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_008_49008236_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_008_49008236_qa_5/environment/pull_bucket.py b/tasks/0049_008_49008236_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_008_49008236_qa_5/environment/pull_bucket.py +++ b/tasks/0049_008_49008236_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_008_49008236_qa_5/task.toml b/tasks/0049_008_49008236_qa_5/task.toml index d6cde3b0df1d261b29fbc775e889ede00b15e4bc..d58e14639b2eebe808df166234753daad4e8616a 100644 --- a/tasks/0049_008_49008236_qa_5/task.toml +++ b/tasks/0049_008_49008236_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_015_49015069_qa_1/environment/bootstrap.sh b/tasks/0049_015_49015069_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_015_49015069_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_015_49015069_qa_1/environment/pull_bucket.py b/tasks/0049_015_49015069_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_015_49015069_qa_1/environment/pull_bucket.py +++ b/tasks/0049_015_49015069_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_015_49015069_qa_1/task.toml b/tasks/0049_015_49015069_qa_1/task.toml index a776039bc80e4690652720073cfcc66bf04aff53..d705eb812f3e17290686d498c73f6da069b60285 100644 --- a/tasks/0049_015_49015069_qa_1/task.toml +++ b/tasks/0049_015_49015069_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_015_49015069_qa_2/environment/bootstrap.sh b/tasks/0049_015_49015069_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_015_49015069_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_015_49015069_qa_2/environment/pull_bucket.py b/tasks/0049_015_49015069_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_015_49015069_qa_2/environment/pull_bucket.py +++ b/tasks/0049_015_49015069_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_015_49015069_qa_2/task.toml b/tasks/0049_015_49015069_qa_2/task.toml index 47cc715e09093a7a82122ec8a79da4b52bb38cba..2dd2f1b5354dba2ecf9c554789ed9a597747d172 100644 --- a/tasks/0049_015_49015069_qa_2/task.toml +++ b/tasks/0049_015_49015069_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_015_49015069_qa_5/environment/bootstrap.sh b/tasks/0049_015_49015069_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_015_49015069_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_015_49015069_qa_5/environment/pull_bucket.py b/tasks/0049_015_49015069_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_015_49015069_qa_5/environment/pull_bucket.py +++ b/tasks/0049_015_49015069_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_015_49015069_qa_5/task.toml b/tasks/0049_015_49015069_qa_5/task.toml index f91184d5b97f6d0800299f3d83a108745fe62a90..09e701672aab13c409364c980421b3e73a28430b 100644 --- a/tasks/0049_015_49015069_qa_5/task.toml +++ b/tasks/0049_015_49015069_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_018_49018627_qa_4/environment/bootstrap.sh b/tasks/0049_018_49018627_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_018_49018627_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_018_49018627_qa_4/environment/pull_bucket.py b/tasks/0049_018_49018627_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_018_49018627_qa_4/environment/pull_bucket.py +++ b/tasks/0049_018_49018627_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_018_49018627_qa_4/task.toml b/tasks/0049_018_49018627_qa_4/task.toml index 8e556c99f44ac1088d3e2eae2228bc1f19724947..50e8e7b72c5a600fc2370560d1c941549634a630 100644 --- a/tasks/0049_018_49018627_qa_4/task.toml +++ b/tasks/0049_018_49018627_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_034_49034706_qa_4/environment/bootstrap.sh b/tasks/0049_034_49034706_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_034_49034706_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_034_49034706_qa_4/environment/pull_bucket.py b/tasks/0049_034_49034706_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_034_49034706_qa_4/environment/pull_bucket.py +++ b/tasks/0049_034_49034706_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_034_49034706_qa_4/task.toml b/tasks/0049_034_49034706_qa_4/task.toml index 7ec12363be1d4b2dc028f842b49b2fba65549aa9..63d391a5a06dc9096af151ae34b6363c27b99118 100644 --- a/tasks/0049_034_49034706_qa_4/task.toml +++ b/tasks/0049_034_49034706_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_078_49078403_qa_1/environment/bootstrap.sh b/tasks/0049_078_49078403_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_078_49078403_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_078_49078403_qa_1/environment/pull_bucket.py b/tasks/0049_078_49078403_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_078_49078403_qa_1/environment/pull_bucket.py +++ b/tasks/0049_078_49078403_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_078_49078403_qa_1/task.toml b/tasks/0049_078_49078403_qa_1/task.toml index f79bc0d6b95018f6cdfc8a94396f2f8171bf8c81..dd1606a63832073355cad729c86a05824c5650fb 100644 --- a/tasks/0049_078_49078403_qa_1/task.toml +++ b/tasks/0049_078_49078403_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_090_49090832_qa_1/environment/bootstrap.sh b/tasks/0049_090_49090832_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_090_49090832_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_090_49090832_qa_1/environment/pull_bucket.py b/tasks/0049_090_49090832_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_090_49090832_qa_1/environment/pull_bucket.py +++ b/tasks/0049_090_49090832_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_090_49090832_qa_1/task.toml b/tasks/0049_090_49090832_qa_1/task.toml index 23fd2f17a00c66cabf37eb1d2d4921b513d679fa..8f3ef38d1480425b05edacbec2ddffbb8299a511 100644 --- a/tasks/0049_090_49090832_qa_1/task.toml +++ b/tasks/0049_090_49090832_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_165_49165096_qa_1/environment/bootstrap.sh b/tasks/0049_165_49165096_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_165_49165096_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_165_49165096_qa_1/environment/pull_bucket.py b/tasks/0049_165_49165096_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_165_49165096_qa_1/environment/pull_bucket.py +++ b/tasks/0049_165_49165096_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_165_49165096_qa_1/task.toml b/tasks/0049_165_49165096_qa_1/task.toml index 65ac48cd7285462f657e6c3ed60a4144bf22d7b9..43d5bf0e232772eaa74478e51820ecea46091704 100644 --- a/tasks/0049_165_49165096_qa_1/task.toml +++ b/tasks/0049_165_49165096_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_165_49165096_qa_3/environment/bootstrap.sh b/tasks/0049_165_49165096_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_165_49165096_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_165_49165096_qa_3/environment/pull_bucket.py b/tasks/0049_165_49165096_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_165_49165096_qa_3/environment/pull_bucket.py +++ b/tasks/0049_165_49165096_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_165_49165096_qa_3/task.toml b/tasks/0049_165_49165096_qa_3/task.toml index 6dac9cfaeea26b5b62dcc56a7310aa1f22c1319b..b1884db320dc96041fe7cf17e01e1714d459f272 100644 --- a/tasks/0049_165_49165096_qa_3/task.toml +++ b/tasks/0049_165_49165096_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_165_49165096_qa_5/environment/bootstrap.sh b/tasks/0049_165_49165096_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_165_49165096_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_165_49165096_qa_5/environment/pull_bucket.py b/tasks/0049_165_49165096_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_165_49165096_qa_5/environment/pull_bucket.py +++ b/tasks/0049_165_49165096_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_165_49165096_qa_5/task.toml b/tasks/0049_165_49165096_qa_5/task.toml index 12d1a1b10863ece1526a86db3c4a0ddecbe9f710..adbdfe3bae43571589d488c76871c3e7d1ca6db9 100644 --- a/tasks/0049_165_49165096_qa_5/task.toml +++ b/tasks/0049_165_49165096_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_228_49228657_qa_2/environment/bootstrap.sh b/tasks/0049_228_49228657_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_228_49228657_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_228_49228657_qa_2/environment/pull_bucket.py b/tasks/0049_228_49228657_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_228_49228657_qa_2/environment/pull_bucket.py +++ b/tasks/0049_228_49228657_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_228_49228657_qa_2/task.toml b/tasks/0049_228_49228657_qa_2/task.toml index 5f01f0597e052e9feb52648ee05ad2601d406d44..c8529a391d36c24cce6efa3dadf1c7eb76952b57 100644 --- a/tasks/0049_228_49228657_qa_2/task.toml +++ b/tasks/0049_228_49228657_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_228_49228657_qa_3/environment/bootstrap.sh b/tasks/0049_228_49228657_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_228_49228657_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_228_49228657_qa_3/environment/pull_bucket.py b/tasks/0049_228_49228657_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_228_49228657_qa_3/environment/pull_bucket.py +++ b/tasks/0049_228_49228657_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_228_49228657_qa_3/task.toml b/tasks/0049_228_49228657_qa_3/task.toml index 7da21856a11513b645d144937c0656eaf29492a5..dfb245724f8ae0d563a451f059f7da280adc5abb 100644 --- a/tasks/0049_228_49228657_qa_3/task.toml +++ b/tasks/0049_228_49228657_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_228_49228657_qa_5/environment/bootstrap.sh b/tasks/0049_228_49228657_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_228_49228657_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_228_49228657_qa_5/environment/pull_bucket.py b/tasks/0049_228_49228657_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_228_49228657_qa_5/environment/pull_bucket.py +++ b/tasks/0049_228_49228657_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_228_49228657_qa_5/task.toml b/tasks/0049_228_49228657_qa_5/task.toml index ff41a0e02b3c3f5a269050a0039d39d3bbc4f238..36a224c1b50e9965c0cfd74d98ab15402bddcad6 100644 --- a/tasks/0049_228_49228657_qa_5/task.toml +++ b/tasks/0049_228_49228657_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_261_49261135_qa_3/environment/bootstrap.sh b/tasks/0049_261_49261135_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_261_49261135_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_261_49261135_qa_3/environment/pull_bucket.py b/tasks/0049_261_49261135_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_261_49261135_qa_3/environment/pull_bucket.py +++ b/tasks/0049_261_49261135_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_261_49261135_qa_3/task.toml b/tasks/0049_261_49261135_qa_3/task.toml index f36f129d9603f023bd01f495bc9d7dc057ced1c1..b5721c58c2576d6c12f6da7ed1140759fc224f1e 100644 --- a/tasks/0049_261_49261135_qa_3/task.toml +++ b/tasks/0049_261_49261135_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_302_49302290_qa_5/environment/bootstrap.sh b/tasks/0049_302_49302290_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_302_49302290_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_302_49302290_qa_5/environment/pull_bucket.py b/tasks/0049_302_49302290_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_302_49302290_qa_5/environment/pull_bucket.py +++ b/tasks/0049_302_49302290_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_302_49302290_qa_5/task.toml b/tasks/0049_302_49302290_qa_5/task.toml index 8b079f01a81838cd8af29006ff94050aa05fcd10..15f7fcb84bf22b8289b7373edf6849904377fee4 100644 --- a/tasks/0049_302_49302290_qa_5/task.toml +++ b/tasks/0049_302_49302290_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_378_49378921_qa_4/environment/bootstrap.sh b/tasks/0049_378_49378921_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_378_49378921_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_378_49378921_qa_4/environment/pull_bucket.py b/tasks/0049_378_49378921_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_378_49378921_qa_4/environment/pull_bucket.py +++ b/tasks/0049_378_49378921_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_378_49378921_qa_4/task.toml b/tasks/0049_378_49378921_qa_4/task.toml index 3d48a9687a5be8402563f1776360746fc8f9549b..d80adad39c45eb79055c57a5d39770bea7b4213c 100644 --- a/tasks/0049_378_49378921_qa_4/task.toml +++ b/tasks/0049_378_49378921_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_482_49482971_qa_2/environment/bootstrap.sh b/tasks/0049_482_49482971_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_482_49482971_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_482_49482971_qa_2/environment/pull_bucket.py b/tasks/0049_482_49482971_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_482_49482971_qa_2/environment/pull_bucket.py +++ b/tasks/0049_482_49482971_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_482_49482971_qa_2/task.toml b/tasks/0049_482_49482971_qa_2/task.toml index 8b0e913e9d82150392e09b610c0a10114ae80ba2..a64e890ce9cd337f3ecb954576645dba1d64656e 100644 --- a/tasks/0049_482_49482971_qa_2/task.toml +++ b/tasks/0049_482_49482971_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_513_49513248_qa_5/environment/bootstrap.sh b/tasks/0049_513_49513248_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_513_49513248_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_513_49513248_qa_5/environment/pull_bucket.py b/tasks/0049_513_49513248_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_513_49513248_qa_5/environment/pull_bucket.py +++ b/tasks/0049_513_49513248_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_513_49513248_qa_5/task.toml b/tasks/0049_513_49513248_qa_5/task.toml index cd7f93fc746da58fc5ee99322ed1a1da6f467cfd..f02417c59e2bbfcc395be9760e3629fbcafbf014 100644 --- a/tasks/0049_513_49513248_qa_5/task.toml +++ b/tasks/0049_513_49513248_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_516_49516082_qa_4/environment/bootstrap.sh b/tasks/0049_516_49516082_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_516_49516082_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_516_49516082_qa_4/environment/pull_bucket.py b/tasks/0049_516_49516082_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_516_49516082_qa_4/environment/pull_bucket.py +++ b/tasks/0049_516_49516082_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_516_49516082_qa_4/task.toml b/tasks/0049_516_49516082_qa_4/task.toml index fd452079d6a5d21a53f661107fa2be7202e45c34..8e01a008c64ccdbd3c121cda5e3c9661ff8342be 100644 --- a/tasks/0049_516_49516082_qa_4/task.toml +++ b/tasks/0049_516_49516082_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_516_49516082_qa_5/environment/bootstrap.sh b/tasks/0049_516_49516082_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_516_49516082_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_516_49516082_qa_5/environment/pull_bucket.py b/tasks/0049_516_49516082_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_516_49516082_qa_5/environment/pull_bucket.py +++ b/tasks/0049_516_49516082_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_516_49516082_qa_5/task.toml b/tasks/0049_516_49516082_qa_5/task.toml index be30e0a6c460fadd09645ce1329ee5610feb78f4..cac1c8d804ac0d73a32e70d2e200ad8b5e58f439 100644 --- a/tasks/0049_516_49516082_qa_5/task.toml +++ b/tasks/0049_516_49516082_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_548_49548242_qa_2/environment/bootstrap.sh b/tasks/0049_548_49548242_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_548_49548242_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_548_49548242_qa_2/environment/pull_bucket.py b/tasks/0049_548_49548242_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_548_49548242_qa_2/environment/pull_bucket.py +++ b/tasks/0049_548_49548242_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_548_49548242_qa_2/task.toml b/tasks/0049_548_49548242_qa_2/task.toml index 3d6f23a6e51fa6995213951214ee64973c90fb38..923f8305c5badd5e06b1326499c7b1a13bce07f5 100644 --- a/tasks/0049_548_49548242_qa_2/task.toml +++ b/tasks/0049_548_49548242_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_585_49585863_qa_3/environment/bootstrap.sh b/tasks/0049_585_49585863_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_585_49585863_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_585_49585863_qa_3/environment/pull_bucket.py b/tasks/0049_585_49585863_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_585_49585863_qa_3/environment/pull_bucket.py +++ b/tasks/0049_585_49585863_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_585_49585863_qa_3/task.toml b/tasks/0049_585_49585863_qa_3/task.toml index 6c505e73e5c588b64f774b33df5352c33aa27f11..e5ec78c37a8cb9b6e07e165975f10556fa95aea4 100644 --- a/tasks/0049_585_49585863_qa_3/task.toml +++ b/tasks/0049_585_49585863_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_585_49585863_qa_4/environment/bootstrap.sh b/tasks/0049_585_49585863_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_585_49585863_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_585_49585863_qa_4/environment/pull_bucket.py b/tasks/0049_585_49585863_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_585_49585863_qa_4/environment/pull_bucket.py +++ b/tasks/0049_585_49585863_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_585_49585863_qa_4/task.toml b/tasks/0049_585_49585863_qa_4/task.toml index 4329629043f06828a7c7e8813b7a666f2a2187f2..d643d509d6af48766e10aa03c19d9c2ab0a539f1 100644 --- a/tasks/0049_585_49585863_qa_4/task.toml +++ b/tasks/0049_585_49585863_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_644_49644416_qa_2/environment/bootstrap.sh b/tasks/0049_644_49644416_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_644_49644416_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_644_49644416_qa_2/environment/pull_bucket.py b/tasks/0049_644_49644416_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_644_49644416_qa_2/environment/pull_bucket.py +++ b/tasks/0049_644_49644416_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_644_49644416_qa_2/task.toml b/tasks/0049_644_49644416_qa_2/task.toml index 6a26bc8f36b631e5b6c93e36b8c1f62bf242a431..7e733d5193266ea2ac4685e6447694dc3e9fa6a4 100644 --- a/tasks/0049_644_49644416_qa_2/task.toml +++ b/tasks/0049_644_49644416_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_677_49677120_qa_1/environment/bootstrap.sh b/tasks/0049_677_49677120_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_677_49677120_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_677_49677120_qa_1/environment/pull_bucket.py b/tasks/0049_677_49677120_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_677_49677120_qa_1/environment/pull_bucket.py +++ b/tasks/0049_677_49677120_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_677_49677120_qa_1/task.toml b/tasks/0049_677_49677120_qa_1/task.toml index c1848273758cc1ad7df40f5e5a528f44b864d6c0..3378a8b128c25f69e17672b920db58dcf3d04750 100644 --- a/tasks/0049_677_49677120_qa_1/task.toml +++ b/tasks/0049_677_49677120_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_677_49677120_qa_3/environment/bootstrap.sh b/tasks/0049_677_49677120_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_677_49677120_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_677_49677120_qa_3/environment/pull_bucket.py b/tasks/0049_677_49677120_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_677_49677120_qa_3/environment/pull_bucket.py +++ b/tasks/0049_677_49677120_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_677_49677120_qa_3/task.toml b/tasks/0049_677_49677120_qa_3/task.toml index 3ea66f9962ae6668ea8d5055f556bb51d8de8ae9..013f284c6bf7082d7b25b4bb1d27e7df2cd50070 100644 --- a/tasks/0049_677_49677120_qa_3/task.toml +++ b/tasks/0049_677_49677120_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_683_49683426_qa_3/environment/bootstrap.sh b/tasks/0049_683_49683426_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_683_49683426_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_683_49683426_qa_3/environment/pull_bucket.py b/tasks/0049_683_49683426_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_683_49683426_qa_3/environment/pull_bucket.py +++ b/tasks/0049_683_49683426_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_683_49683426_qa_3/task.toml b/tasks/0049_683_49683426_qa_3/task.toml index 44d824ca3faa696020929384a88c4011d2c8e8b5..27f08791a9cb7b77b190ef17d2d6721681de1f7a 100644 --- a/tasks/0049_683_49683426_qa_3/task.toml +++ b/tasks/0049_683_49683426_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_714_49714638_qa_4/environment/bootstrap.sh b/tasks/0049_714_49714638_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_714_49714638_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_714_49714638_qa_4/environment/pull_bucket.py b/tasks/0049_714_49714638_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_714_49714638_qa_4/environment/pull_bucket.py +++ b/tasks/0049_714_49714638_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_714_49714638_qa_4/task.toml b/tasks/0049_714_49714638_qa_4/task.toml index a6d22ed45931b294d74adbcc7841dfbd990d0a90..9ffe06a55ae869b61247d9fe986da77ad0a13123 100644 --- a/tasks/0049_714_49714638_qa_4/task.toml +++ b/tasks/0049_714_49714638_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_738_49738137_qa_4/environment/bootstrap.sh b/tasks/0049_738_49738137_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_738_49738137_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_738_49738137_qa_4/environment/pull_bucket.py b/tasks/0049_738_49738137_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_738_49738137_qa_4/environment/pull_bucket.py +++ b/tasks/0049_738_49738137_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_738_49738137_qa_4/task.toml b/tasks/0049_738_49738137_qa_4/task.toml index a4ba0f00a6465ade432382686d650547509e0a21..5280dd57fd481ea8a1c79f35247c49cea76e7d5e 100644 --- a/tasks/0049_738_49738137_qa_4/task.toml +++ b/tasks/0049_738_49738137_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_738_49738137_qa_5/environment/bootstrap.sh b/tasks/0049_738_49738137_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_738_49738137_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_738_49738137_qa_5/environment/pull_bucket.py b/tasks/0049_738_49738137_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_738_49738137_qa_5/environment/pull_bucket.py +++ b/tasks/0049_738_49738137_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_738_49738137_qa_5/task.toml b/tasks/0049_738_49738137_qa_5/task.toml index 41a003b86f24b52e70a11a3540f6c4ecce591278..3baf12c09ccef4f3cb8590c242244205cc752504 100644 --- a/tasks/0049_738_49738137_qa_5/task.toml +++ b/tasks/0049_738_49738137_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_762_49762314_qa_3/environment/bootstrap.sh b/tasks/0049_762_49762314_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_762_49762314_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_762_49762314_qa_3/environment/pull_bucket.py b/tasks/0049_762_49762314_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_762_49762314_qa_3/environment/pull_bucket.py +++ b/tasks/0049_762_49762314_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_762_49762314_qa_3/task.toml b/tasks/0049_762_49762314_qa_3/task.toml index cc519494b26924f891eeb0f7edf496a342039514..517f5f3b9cad010b870642b6a8754fa7c014f1b1 100644 --- a/tasks/0049_762_49762314_qa_3/task.toml +++ b/tasks/0049_762_49762314_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_804_49804423_qa_2/environment/bootstrap.sh b/tasks/0049_804_49804423_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_804_49804423_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_804_49804423_qa_2/environment/pull_bucket.py b/tasks/0049_804_49804423_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_804_49804423_qa_2/environment/pull_bucket.py +++ b/tasks/0049_804_49804423_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_804_49804423_qa_2/task.toml b/tasks/0049_804_49804423_qa_2/task.toml index 2ae555dcb7f972a9e352aa3894044415741a6242..ef0618727007b4cdca8464a6ddbc7a2557c34289 100644 --- a/tasks/0049_804_49804423_qa_2/task.toml +++ b/tasks/0049_804_49804423_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_820_49820417_qa_1/environment/bootstrap.sh b/tasks/0049_820_49820417_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_820_49820417_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_820_49820417_qa_1/environment/pull_bucket.py b/tasks/0049_820_49820417_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_820_49820417_qa_1/environment/pull_bucket.py +++ b/tasks/0049_820_49820417_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_820_49820417_qa_1/task.toml b/tasks/0049_820_49820417_qa_1/task.toml index 642eeec1b9cb887c801f9206df4212c22d2f92f7..0232e1c3a9cb9b26896894022bab84d4c5ef7db8 100644 --- a/tasks/0049_820_49820417_qa_1/task.toml +++ b/tasks/0049_820_49820417_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_820_49820417_qa_3/environment/bootstrap.sh b/tasks/0049_820_49820417_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_820_49820417_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_820_49820417_qa_3/environment/pull_bucket.py b/tasks/0049_820_49820417_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_820_49820417_qa_3/environment/pull_bucket.py +++ b/tasks/0049_820_49820417_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_820_49820417_qa_3/task.toml b/tasks/0049_820_49820417_qa_3/task.toml index 7b8be36ac9e32319410176d692924e309c69a045..1ecb544b793ec9eee1d5a345f9dba00254bd1023 100644 --- a/tasks/0049_820_49820417_qa_3/task.toml +++ b/tasks/0049_820_49820417_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0049_938_49938525_qa_2/environment/bootstrap.sh b/tasks/0049_938_49938525_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0049_938_49938525_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0049_938_49938525_qa_2/environment/pull_bucket.py b/tasks/0049_938_49938525_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0049_938_49938525_qa_2/environment/pull_bucket.py +++ b/tasks/0049_938_49938525_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0049_938_49938525_qa_2/task.toml b/tasks/0049_938_49938525_qa_2/task.toml index bb89a1500f94c057f515c6e1495d9a975a61048e..f6df27cd3338d58f6dc8978693aa9b02e170b3a9 100644 --- a/tasks/0049_938_49938525_qa_2/task.toml +++ b/tasks/0049_938_49938525_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_018_50018991_qa_1/environment/bootstrap.sh b/tasks/0050_018_50018991_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_018_50018991_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_018_50018991_qa_1/environment/pull_bucket.py b/tasks/0050_018_50018991_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_018_50018991_qa_1/environment/pull_bucket.py +++ b/tasks/0050_018_50018991_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_018_50018991_qa_1/task.toml b/tasks/0050_018_50018991_qa_1/task.toml index a0d5db53208bb84139e819349264fe9499fd3f4c..f6e70e7dfd25b80f0381e4be983c71f71f0ad0d4 100644 --- a/tasks/0050_018_50018991_qa_1/task.toml +++ b/tasks/0050_018_50018991_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_018_50018991_qa_4/environment/bootstrap.sh b/tasks/0050_018_50018991_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_018_50018991_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_018_50018991_qa_4/environment/pull_bucket.py b/tasks/0050_018_50018991_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_018_50018991_qa_4/environment/pull_bucket.py +++ b/tasks/0050_018_50018991_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_018_50018991_qa_4/task.toml b/tasks/0050_018_50018991_qa_4/task.toml index 231f31620afc6c27d721b662f3d8a173a5637c0a..3137b46ebe7ff2e5f4f6c84e4ec13e0c98beb401 100644 --- a/tasks/0050_018_50018991_qa_4/task.toml +++ b/tasks/0050_018_50018991_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_022_50022943_qa_1/environment/bootstrap.sh b/tasks/0050_022_50022943_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_022_50022943_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_022_50022943_qa_1/environment/pull_bucket.py b/tasks/0050_022_50022943_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_022_50022943_qa_1/environment/pull_bucket.py +++ b/tasks/0050_022_50022943_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_022_50022943_qa_1/task.toml b/tasks/0050_022_50022943_qa_1/task.toml index 5d72fb812ce93da16d69e110f37169d25256c37b..27667414645810e5f1ff54df72285d07196b2957 100644 --- a/tasks/0050_022_50022943_qa_1/task.toml +++ b/tasks/0050_022_50022943_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_022_50022943_qa_2/environment/bootstrap.sh b/tasks/0050_022_50022943_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_022_50022943_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_022_50022943_qa_2/environment/pull_bucket.py b/tasks/0050_022_50022943_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_022_50022943_qa_2/environment/pull_bucket.py +++ b/tasks/0050_022_50022943_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_022_50022943_qa_2/task.toml b/tasks/0050_022_50022943_qa_2/task.toml index 4d52612c43cfb41290c36b161c07c7028f25c7f4..ee01ea4b419b9be06eaae0465bcbe64084e54f50 100644 --- a/tasks/0050_022_50022943_qa_2/task.toml +++ b/tasks/0050_022_50022943_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_022_50022943_qa_4/environment/bootstrap.sh b/tasks/0050_022_50022943_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_022_50022943_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_022_50022943_qa_4/environment/pull_bucket.py b/tasks/0050_022_50022943_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_022_50022943_qa_4/environment/pull_bucket.py +++ b/tasks/0050_022_50022943_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_022_50022943_qa_4/task.toml b/tasks/0050_022_50022943_qa_4/task.toml index 979aa4857234aaed7dd564abfa3e813d7e9b98be..7cb122456c5b7ba0efde7e51c0fffb651600e209 100644 --- a/tasks/0050_022_50022943_qa_4/task.toml +++ b/tasks/0050_022_50022943_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_090_50090486_qa_1/environment/bootstrap.sh b/tasks/0050_090_50090486_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_090_50090486_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_090_50090486_qa_1/environment/pull_bucket.py b/tasks/0050_090_50090486_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_090_50090486_qa_1/environment/pull_bucket.py +++ b/tasks/0050_090_50090486_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_090_50090486_qa_1/task.toml b/tasks/0050_090_50090486_qa_1/task.toml index 486603a974d177e64aa268ebe8aa3fb1912a881b..3c072d017dd316c4e5adb6e35a40638cc3254e35 100644 --- a/tasks/0050_090_50090486_qa_1/task.toml +++ b/tasks/0050_090_50090486_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_090_50090486_qa_3/environment/bootstrap.sh b/tasks/0050_090_50090486_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_090_50090486_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_090_50090486_qa_3/environment/pull_bucket.py b/tasks/0050_090_50090486_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_090_50090486_qa_3/environment/pull_bucket.py +++ b/tasks/0050_090_50090486_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_090_50090486_qa_3/task.toml b/tasks/0050_090_50090486_qa_3/task.toml index 1ce8006f5726aae960a620270a12c616aea2f148..067c8499ef87860139a572697d7a57a30e01f6e7 100644 --- a/tasks/0050_090_50090486_qa_3/task.toml +++ b/tasks/0050_090_50090486_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_102_50102460_qa_2/environment/bootstrap.sh b/tasks/0050_102_50102460_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_102_50102460_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_102_50102460_qa_2/environment/pull_bucket.py b/tasks/0050_102_50102460_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_102_50102460_qa_2/environment/pull_bucket.py +++ b/tasks/0050_102_50102460_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_102_50102460_qa_2/task.toml b/tasks/0050_102_50102460_qa_2/task.toml index 26523c480c2fdf370aea1b88eb6a954c3600abc0..08f7f8e11b608a9306fe20e6978badd4ed1ab8c0 100644 --- a/tasks/0050_102_50102460_qa_2/task.toml +++ b/tasks/0050_102_50102460_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_224_50224594_qa_1/environment/bootstrap.sh b/tasks/0050_224_50224594_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_224_50224594_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_224_50224594_qa_1/environment/pull_bucket.py b/tasks/0050_224_50224594_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_224_50224594_qa_1/environment/pull_bucket.py +++ b/tasks/0050_224_50224594_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_224_50224594_qa_1/task.toml b/tasks/0050_224_50224594_qa_1/task.toml index 6894951214c666d968321c123ff3f6f84139f433..bfc8465ac07d9ad5bedbde29ae8429a063e5546e 100644 --- a/tasks/0050_224_50224594_qa_1/task.toml +++ b/tasks/0050_224_50224594_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_224_50224594_qa_5/environment/bootstrap.sh b/tasks/0050_224_50224594_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_224_50224594_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_224_50224594_qa_5/environment/pull_bucket.py b/tasks/0050_224_50224594_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_224_50224594_qa_5/environment/pull_bucket.py +++ b/tasks/0050_224_50224594_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_224_50224594_qa_5/task.toml b/tasks/0050_224_50224594_qa_5/task.toml index 3d1daf0a421b5f25ed7e98269af1b40c1a7caae9..145bbc19754003c30663a169deece03fc2d612d9 100644 --- a/tasks/0050_224_50224594_qa_5/task.toml +++ b/tasks/0050_224_50224594_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_233_50233728_qa_5/environment/bootstrap.sh b/tasks/0050_233_50233728_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_233_50233728_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_233_50233728_qa_5/environment/pull_bucket.py b/tasks/0050_233_50233728_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_233_50233728_qa_5/environment/pull_bucket.py +++ b/tasks/0050_233_50233728_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_233_50233728_qa_5/task.toml b/tasks/0050_233_50233728_qa_5/task.toml index 23f3d55c56215e1bd4d01b72d59029766ad0ab3b..af28dd81f640ec3a54e6b66132d96a566b9e626a 100644 --- a/tasks/0050_233_50233728_qa_5/task.toml +++ b/tasks/0050_233_50233728_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_257_50257627_qa_3/environment/bootstrap.sh b/tasks/0050_257_50257627_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_257_50257627_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_257_50257627_qa_3/environment/pull_bucket.py b/tasks/0050_257_50257627_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_257_50257627_qa_3/environment/pull_bucket.py +++ b/tasks/0050_257_50257627_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_257_50257627_qa_3/task.toml b/tasks/0050_257_50257627_qa_3/task.toml index 3223b73c1b1a0f272fb0ccc831f8e1bcda89f676..dd752a66b1946527741c859bf983f1b8dee65903 100644 --- a/tasks/0050_257_50257627_qa_3/task.toml +++ b/tasks/0050_257_50257627_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_281_50281280_qa_1/environment/bootstrap.sh b/tasks/0050_281_50281280_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_281_50281280_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_281_50281280_qa_1/environment/pull_bucket.py b/tasks/0050_281_50281280_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_281_50281280_qa_1/environment/pull_bucket.py +++ b/tasks/0050_281_50281280_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_281_50281280_qa_1/task.toml b/tasks/0050_281_50281280_qa_1/task.toml index 015ab1e2432e7ad46bbbcb6ee06d64b690945558..1ff206460c95661d1f57b7bd9742ab8f83ff70ee 100644 --- a/tasks/0050_281_50281280_qa_1/task.toml +++ b/tasks/0050_281_50281280_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_292_50292896_qa_1/environment/bootstrap.sh b/tasks/0050_292_50292896_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_292_50292896_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_292_50292896_qa_1/environment/pull_bucket.py b/tasks/0050_292_50292896_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_292_50292896_qa_1/environment/pull_bucket.py +++ b/tasks/0050_292_50292896_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_292_50292896_qa_1/task.toml b/tasks/0050_292_50292896_qa_1/task.toml index 549ac71c1a6b1c2c7833d3a7b9bfbb24500ec394..8d165e5ec46d4f127f0197421748fda4f4042bce 100644 --- a/tasks/0050_292_50292896_qa_1/task.toml +++ b/tasks/0050_292_50292896_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_306_50306022_qa_3/environment/bootstrap.sh b/tasks/0050_306_50306022_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_306_50306022_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_306_50306022_qa_3/environment/pull_bucket.py b/tasks/0050_306_50306022_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_306_50306022_qa_3/environment/pull_bucket.py +++ b/tasks/0050_306_50306022_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_306_50306022_qa_3/task.toml b/tasks/0050_306_50306022_qa_3/task.toml index 574bf979bca39b1cb5de4837a16290db3d17c759..88b5a1c2a663c731deb5f25462cddfc4f42dab56 100644 --- a/tasks/0050_306_50306022_qa_3/task.toml +++ b/tasks/0050_306_50306022_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_334_50334572_qa_4/environment/bootstrap.sh b/tasks/0050_334_50334572_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_334_50334572_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_334_50334572_qa_4/environment/pull_bucket.py b/tasks/0050_334_50334572_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_334_50334572_qa_4/environment/pull_bucket.py +++ b/tasks/0050_334_50334572_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_334_50334572_qa_4/task.toml b/tasks/0050_334_50334572_qa_4/task.toml index dd26c1f8996bf58e6540728f2f39610609ca06c4..f8830c71266a593a59325a360b3788dee10ee4e7 100644 --- a/tasks/0050_334_50334572_qa_4/task.toml +++ b/tasks/0050_334_50334572_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_461_50461081_qa_3/environment/bootstrap.sh b/tasks/0050_461_50461081_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_461_50461081_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_461_50461081_qa_3/environment/pull_bucket.py b/tasks/0050_461_50461081_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_461_50461081_qa_3/environment/pull_bucket.py +++ b/tasks/0050_461_50461081_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_461_50461081_qa_3/task.toml b/tasks/0050_461_50461081_qa_3/task.toml index b5287ea2716e16bc93c8472286d99a404f47d2e6..cd0de965eb077016181774f5fa171ab5db50ae48 100644 --- a/tasks/0050_461_50461081_qa_3/task.toml +++ b/tasks/0050_461_50461081_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_467_50467216_qa_3/environment/bootstrap.sh b/tasks/0050_467_50467216_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_467_50467216_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_467_50467216_qa_3/environment/pull_bucket.py b/tasks/0050_467_50467216_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_467_50467216_qa_3/environment/pull_bucket.py +++ b/tasks/0050_467_50467216_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_467_50467216_qa_3/task.toml b/tasks/0050_467_50467216_qa_3/task.toml index 5cbc91587fc466a4a1226f38ad827f5bd4973834..5daf60f62f51ee7e69f9cbf5c05c01079efb3da5 100644 --- a/tasks/0050_467_50467216_qa_3/task.toml +++ b/tasks/0050_467_50467216_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_513_50513011_qa_5/environment/bootstrap.sh b/tasks/0050_513_50513011_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_513_50513011_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_513_50513011_qa_5/environment/pull_bucket.py b/tasks/0050_513_50513011_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_513_50513011_qa_5/environment/pull_bucket.py +++ b/tasks/0050_513_50513011_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_513_50513011_qa_5/task.toml b/tasks/0050_513_50513011_qa_5/task.toml index 16898cee176e7d47517083336f9014915a4bc9e4..e600d4a4bbfa684f9d43fb0e03f2184f6cec9d41 100644 --- a/tasks/0050_513_50513011_qa_5/task.toml +++ b/tasks/0050_513_50513011_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_584_50584509_qa_4/environment/bootstrap.sh b/tasks/0050_584_50584509_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_584_50584509_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_584_50584509_qa_4/environment/pull_bucket.py b/tasks/0050_584_50584509_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_584_50584509_qa_4/environment/pull_bucket.py +++ b/tasks/0050_584_50584509_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_584_50584509_qa_4/task.toml b/tasks/0050_584_50584509_qa_4/task.toml index 7e2b0a7e03e4b3b64ae5885a79b72397639277d1..683a7b86925d548f5005a762940537bf052a80b4 100644 --- a/tasks/0050_584_50584509_qa_4/task.toml +++ b/tasks/0050_584_50584509_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_587_50587128_qa_1/environment/bootstrap.sh b/tasks/0050_587_50587128_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_587_50587128_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_587_50587128_qa_1/environment/pull_bucket.py b/tasks/0050_587_50587128_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_587_50587128_qa_1/environment/pull_bucket.py +++ b/tasks/0050_587_50587128_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_587_50587128_qa_1/task.toml b/tasks/0050_587_50587128_qa_1/task.toml index d7204a9c4a8cd110bc5c2479137c199f88ce7403..167020b37e7547adf5597f4836dbf914cb1a1f25 100644 --- a/tasks/0050_587_50587128_qa_1/task.toml +++ b/tasks/0050_587_50587128_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_587_50587128_qa_4/environment/bootstrap.sh b/tasks/0050_587_50587128_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_587_50587128_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_587_50587128_qa_4/environment/pull_bucket.py b/tasks/0050_587_50587128_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_587_50587128_qa_4/environment/pull_bucket.py +++ b/tasks/0050_587_50587128_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_587_50587128_qa_4/task.toml b/tasks/0050_587_50587128_qa_4/task.toml index 6751f755b800e02d1127716a7019d78cd62df084..60c72a414a93116c0a65c54c64963bc40904d3e5 100644 --- a/tasks/0050_587_50587128_qa_4/task.toml +++ b/tasks/0050_587_50587128_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_587_50587128_qa_5/environment/bootstrap.sh b/tasks/0050_587_50587128_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_587_50587128_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_587_50587128_qa_5/environment/pull_bucket.py b/tasks/0050_587_50587128_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_587_50587128_qa_5/environment/pull_bucket.py +++ b/tasks/0050_587_50587128_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_587_50587128_qa_5/task.toml b/tasks/0050_587_50587128_qa_5/task.toml index 28deaf472232cbb42e60274285d42a941d556116..d95b28c0c766357c1d9c4519e5c01543e6b496fd 100644 --- a/tasks/0050_587_50587128_qa_5/task.toml +++ b/tasks/0050_587_50587128_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_704_50704224_qa_1/environment/bootstrap.sh b/tasks/0050_704_50704224_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_704_50704224_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_704_50704224_qa_1/environment/pull_bucket.py b/tasks/0050_704_50704224_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_704_50704224_qa_1/environment/pull_bucket.py +++ b/tasks/0050_704_50704224_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_704_50704224_qa_1/task.toml b/tasks/0050_704_50704224_qa_1/task.toml index 424dfe8922fcbcc8c365608a2a656b7e836a2182..a723486f5305f947221961646e83d2fc07ecdc96 100644 --- a/tasks/0050_704_50704224_qa_1/task.toml +++ b/tasks/0050_704_50704224_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_704_50704224_qa_2/environment/bootstrap.sh b/tasks/0050_704_50704224_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_704_50704224_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_704_50704224_qa_2/environment/pull_bucket.py b/tasks/0050_704_50704224_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_704_50704224_qa_2/environment/pull_bucket.py +++ b/tasks/0050_704_50704224_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_704_50704224_qa_2/task.toml b/tasks/0050_704_50704224_qa_2/task.toml index 84374a9df0c9e12ff02e73cb609b476951593f38..fa523d7dbf0294046155c11c227833978eb39b7d 100644 --- a/tasks/0050_704_50704224_qa_2/task.toml +++ b/tasks/0050_704_50704224_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_774_50774398_qa_2/environment/bootstrap.sh b/tasks/0050_774_50774398_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_774_50774398_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_774_50774398_qa_2/environment/pull_bucket.py b/tasks/0050_774_50774398_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_774_50774398_qa_2/environment/pull_bucket.py +++ b/tasks/0050_774_50774398_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_774_50774398_qa_2/task.toml b/tasks/0050_774_50774398_qa_2/task.toml index 80d0e3ad9a6bb63a563b0c75b26e4ac781b47d69..90699f453a911c1d9e6f91f1c5bfe6c06a076953 100644 --- a/tasks/0050_774_50774398_qa_2/task.toml +++ b/tasks/0050_774_50774398_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_775_50775571_qa_1/environment/bootstrap.sh b/tasks/0050_775_50775571_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_775_50775571_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_775_50775571_qa_1/environment/pull_bucket.py b/tasks/0050_775_50775571_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_775_50775571_qa_1/environment/pull_bucket.py +++ b/tasks/0050_775_50775571_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_775_50775571_qa_1/task.toml b/tasks/0050_775_50775571_qa_1/task.toml index 7c59f04c0db90bce1a2d81a8491a68bb20690b19..cf42a6853c96a96ed91ab76ae30190670db4d562 100644 --- a/tasks/0050_775_50775571_qa_1/task.toml +++ b/tasks/0050_775_50775571_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_784_50784361_qa_4/environment/bootstrap.sh b/tasks/0050_784_50784361_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_784_50784361_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_784_50784361_qa_4/environment/pull_bucket.py b/tasks/0050_784_50784361_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_784_50784361_qa_4/environment/pull_bucket.py +++ b/tasks/0050_784_50784361_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_784_50784361_qa_4/task.toml b/tasks/0050_784_50784361_qa_4/task.toml index 69af5ae4bcfedbe8f7f24bbd970d1e6705694415..29ac678bcd52adf53fd54555ed750ef791e4cb03 100644 --- a/tasks/0050_784_50784361_qa_4/task.toml +++ b/tasks/0050_784_50784361_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_784_50784361_qa_5/environment/bootstrap.sh b/tasks/0050_784_50784361_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_784_50784361_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_784_50784361_qa_5/environment/pull_bucket.py b/tasks/0050_784_50784361_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_784_50784361_qa_5/environment/pull_bucket.py +++ b/tasks/0050_784_50784361_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_784_50784361_qa_5/task.toml b/tasks/0050_784_50784361_qa_5/task.toml index fbedb8cafb0e9753fbaeb11947f36a798d0b1d06..0b45c4f0dfe61653d62f179877dc176f9a7e5b09 100644 --- a/tasks/0050_784_50784361_qa_5/task.toml +++ b/tasks/0050_784_50784361_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_785_50785547_qa_2/environment/bootstrap.sh b/tasks/0050_785_50785547_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_785_50785547_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_785_50785547_qa_2/environment/pull_bucket.py b/tasks/0050_785_50785547_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_785_50785547_qa_2/environment/pull_bucket.py +++ b/tasks/0050_785_50785547_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_785_50785547_qa_2/task.toml b/tasks/0050_785_50785547_qa_2/task.toml index 826ed04b278112204ab10db0d0855d9be4abd0e9..2b8b3264f76b9057e070baff5dd89db9235fa8d7 100644 --- a/tasks/0050_785_50785547_qa_2/task.toml +++ b/tasks/0050_785_50785547_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_797_50797720_qa_2/environment/bootstrap.sh b/tasks/0050_797_50797720_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_797_50797720_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_797_50797720_qa_2/environment/pull_bucket.py b/tasks/0050_797_50797720_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_797_50797720_qa_2/environment/pull_bucket.py +++ b/tasks/0050_797_50797720_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_797_50797720_qa_2/task.toml b/tasks/0050_797_50797720_qa_2/task.toml index 3b4b76fb103b96beff9a53e51a96903e9c9fea51..294e1011d8ab5bb65d658eb7a3503390ad479a30 100644 --- a/tasks/0050_797_50797720_qa_2/task.toml +++ b/tasks/0050_797_50797720_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_797_50797720_qa_5/environment/bootstrap.sh b/tasks/0050_797_50797720_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_797_50797720_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_797_50797720_qa_5/environment/pull_bucket.py b/tasks/0050_797_50797720_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_797_50797720_qa_5/environment/pull_bucket.py +++ b/tasks/0050_797_50797720_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_797_50797720_qa_5/task.toml b/tasks/0050_797_50797720_qa_5/task.toml index 76c08d07b8a0f48fa3376358bcba3104de5ea080..4fc1f8b606d0eef6e26dae536737e2368e961273 100644 --- a/tasks/0050_797_50797720_qa_5/task.toml +++ b/tasks/0050_797_50797720_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_812_50812874_qa_3/environment/bootstrap.sh b/tasks/0050_812_50812874_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_812_50812874_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_812_50812874_qa_3/environment/pull_bucket.py b/tasks/0050_812_50812874_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_812_50812874_qa_3/environment/pull_bucket.py +++ b/tasks/0050_812_50812874_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_812_50812874_qa_3/task.toml b/tasks/0050_812_50812874_qa_3/task.toml index 134ffe3c797f7d26c970120f5b5518c69d3e396b..fc17232a527ab66caae63335a15076ca8faffdb8 100644 --- a/tasks/0050_812_50812874_qa_3/task.toml +++ b/tasks/0050_812_50812874_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_842_50842241_qa_5/environment/bootstrap.sh b/tasks/0050_842_50842241_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_842_50842241_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_842_50842241_qa_5/environment/pull_bucket.py b/tasks/0050_842_50842241_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_842_50842241_qa_5/environment/pull_bucket.py +++ b/tasks/0050_842_50842241_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_842_50842241_qa_5/task.toml b/tasks/0050_842_50842241_qa_5/task.toml index 1346147b4c6dd843961d97b3cad1af37b5bc7ba4..c93be7203367aea41f97a6ab54468e17faf6fc32 100644 --- a/tasks/0050_842_50842241_qa_5/task.toml +++ b/tasks/0050_842_50842241_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_856_50856590_qa_4/environment/bootstrap.sh b/tasks/0050_856_50856590_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_856_50856590_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_856_50856590_qa_4/environment/pull_bucket.py b/tasks/0050_856_50856590_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_856_50856590_qa_4/environment/pull_bucket.py +++ b/tasks/0050_856_50856590_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_856_50856590_qa_4/task.toml b/tasks/0050_856_50856590_qa_4/task.toml index c0c5b641bf88e9162a69f0f47101852eaa6d84d8..62bf300d5cdce580fd7ae418f5bcbbf033ace3d2 100644 --- a/tasks/0050_856_50856590_qa_4/task.toml +++ b/tasks/0050_856_50856590_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_885_50885329_qa_2/environment/bootstrap.sh b/tasks/0050_885_50885329_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_885_50885329_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_885_50885329_qa_2/environment/pull_bucket.py b/tasks/0050_885_50885329_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_885_50885329_qa_2/environment/pull_bucket.py +++ b/tasks/0050_885_50885329_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_885_50885329_qa_2/task.toml b/tasks/0050_885_50885329_qa_2/task.toml index 586dbdcbf72efcf54c351d6dc37cd84a4cff3c7a..74ff84cce71d90ac9758467f1c6cdf5eee9780c9 100644 --- a/tasks/0050_885_50885329_qa_2/task.toml +++ b/tasks/0050_885_50885329_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_885_50885329_qa_3/environment/bootstrap.sh b/tasks/0050_885_50885329_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_885_50885329_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_885_50885329_qa_3/environment/pull_bucket.py b/tasks/0050_885_50885329_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_885_50885329_qa_3/environment/pull_bucket.py +++ b/tasks/0050_885_50885329_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_885_50885329_qa_3/task.toml b/tasks/0050_885_50885329_qa_3/task.toml index d4faa41279441f6d501da1c23af9f0afc5526cea..021bceeb39fa6ac5b167e18f8c69b322d14b5674 100644 --- a/tasks/0050_885_50885329_qa_3/task.toml +++ b/tasks/0050_885_50885329_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_892_50892789_qa_1/environment/bootstrap.sh b/tasks/0050_892_50892789_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_892_50892789_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_892_50892789_qa_1/environment/pull_bucket.py b/tasks/0050_892_50892789_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_892_50892789_qa_1/environment/pull_bucket.py +++ b/tasks/0050_892_50892789_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_892_50892789_qa_1/task.toml b/tasks/0050_892_50892789_qa_1/task.toml index d4af5ada34f3c7c112815c2bb12b427ff92a04e7..5b32b0d3ecf6b7ba7787ae3f1a3e60ef1b29eba1 100644 --- a/tasks/0050_892_50892789_qa_1/task.toml +++ b/tasks/0050_892_50892789_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0050_892_50892789_qa_2/environment/bootstrap.sh b/tasks/0050_892_50892789_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0050_892_50892789_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0050_892_50892789_qa_2/environment/pull_bucket.py b/tasks/0050_892_50892789_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0050_892_50892789_qa_2/environment/pull_bucket.py +++ b/tasks/0050_892_50892789_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0050_892_50892789_qa_2/task.toml b/tasks/0050_892_50892789_qa_2/task.toml index 9dd16d8ee1e0cb161f11d4b67a8560dbcdd5adbd..58a8e2447cdb9cdf2b1be028c033c438a0f6beee 100644 --- a/tasks/0050_892_50892789_qa_2/task.toml +++ b/tasks/0050_892_50892789_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_054_51054366_qa_5/environment/bootstrap.sh b/tasks/0051_054_51054366_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_054_51054366_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_054_51054366_qa_5/environment/pull_bucket.py b/tasks/0051_054_51054366_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_054_51054366_qa_5/environment/pull_bucket.py +++ b/tasks/0051_054_51054366_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_054_51054366_qa_5/task.toml b/tasks/0051_054_51054366_qa_5/task.toml index 8e7c8719d0dad97f1d06246138bb71ec8c4542f4..e2a93c45843468c54dc0f0f0c2ea3e56190b9db3 100644 --- a/tasks/0051_054_51054366_qa_5/task.toml +++ b/tasks/0051_054_51054366_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_063_51063179_qa_2/environment/bootstrap.sh b/tasks/0051_063_51063179_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_063_51063179_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_063_51063179_qa_2/environment/pull_bucket.py b/tasks/0051_063_51063179_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_063_51063179_qa_2/environment/pull_bucket.py +++ b/tasks/0051_063_51063179_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_063_51063179_qa_2/task.toml b/tasks/0051_063_51063179_qa_2/task.toml index c33f8427ec6a34b0c1e40a6a63efa3ff3dc50f8d..77c3edb67ce61d5a45d11789dd23da2827a23d20 100644 --- a/tasks/0051_063_51063179_qa_2/task.toml +++ b/tasks/0051_063_51063179_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_063_51063179_qa_3/environment/bootstrap.sh b/tasks/0051_063_51063179_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_063_51063179_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_063_51063179_qa_3/environment/pull_bucket.py b/tasks/0051_063_51063179_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_063_51063179_qa_3/environment/pull_bucket.py +++ b/tasks/0051_063_51063179_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_063_51063179_qa_3/task.toml b/tasks/0051_063_51063179_qa_3/task.toml index f7c90700f96044e5ce789fcf56e1d7763e1b5c52..19f53a9b597bfa571307f3a8566497e3623a0848 100644 --- a/tasks/0051_063_51063179_qa_3/task.toml +++ b/tasks/0051_063_51063179_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_143_51143611_qa_4/environment/bootstrap.sh b/tasks/0051_143_51143611_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_143_51143611_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_143_51143611_qa_4/environment/pull_bucket.py b/tasks/0051_143_51143611_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_143_51143611_qa_4/environment/pull_bucket.py +++ b/tasks/0051_143_51143611_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_143_51143611_qa_4/task.toml b/tasks/0051_143_51143611_qa_4/task.toml index 177f68b73fc11c1ba1d194424f3bcd50f3b10bb1..5071a701e40ecd6b0f22ce6b2a40e7f4a1a915dd 100644 --- a/tasks/0051_143_51143611_qa_4/task.toml +++ b/tasks/0051_143_51143611_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_162_51162029_qa_3/environment/bootstrap.sh b/tasks/0051_162_51162029_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_162_51162029_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_162_51162029_qa_3/environment/pull_bucket.py b/tasks/0051_162_51162029_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_162_51162029_qa_3/environment/pull_bucket.py +++ b/tasks/0051_162_51162029_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_162_51162029_qa_3/task.toml b/tasks/0051_162_51162029_qa_3/task.toml index 6bf55b6137a3d2e22a561d6d0a59162d93df643f..6f125382b11cebf734cbaeafbfda79e25831b34d 100644 --- a/tasks/0051_162_51162029_qa_3/task.toml +++ b/tasks/0051_162_51162029_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_169_51169168_qa_3/environment/bootstrap.sh b/tasks/0051_169_51169168_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_169_51169168_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_169_51169168_qa_3/environment/pull_bucket.py b/tasks/0051_169_51169168_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_169_51169168_qa_3/environment/pull_bucket.py +++ b/tasks/0051_169_51169168_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_169_51169168_qa_3/task.toml b/tasks/0051_169_51169168_qa_3/task.toml index 707b74747c0f84a05091696cb89ad1fce64ccffa..ae609ea970c6d05d0057ca105b04419e516476d7 100644 --- a/tasks/0051_169_51169168_qa_3/task.toml +++ b/tasks/0051_169_51169168_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_242_51242508_qa_3/environment/bootstrap.sh b/tasks/0051_242_51242508_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_242_51242508_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_242_51242508_qa_3/environment/pull_bucket.py b/tasks/0051_242_51242508_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_242_51242508_qa_3/environment/pull_bucket.py +++ b/tasks/0051_242_51242508_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_242_51242508_qa_3/task.toml b/tasks/0051_242_51242508_qa_3/task.toml index 88f12b43fe235690c9f81763bf2fb84d2ecee774..c062eb5b82434f99655f956f51ccf99dbc46605c 100644 --- a/tasks/0051_242_51242508_qa_3/task.toml +++ b/tasks/0051_242_51242508_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_268_51268709_qa_2/environment/bootstrap.sh b/tasks/0051_268_51268709_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_268_51268709_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_268_51268709_qa_2/environment/pull_bucket.py b/tasks/0051_268_51268709_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_268_51268709_qa_2/environment/pull_bucket.py +++ b/tasks/0051_268_51268709_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_268_51268709_qa_2/task.toml b/tasks/0051_268_51268709_qa_2/task.toml index a0eb07958c273f2ac329ff347422330f5c391f0c..294ecc2f6a26d6590f619bf09db074c3e68f2af3 100644 --- a/tasks/0051_268_51268709_qa_2/task.toml +++ b/tasks/0051_268_51268709_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_268_51268709_qa_5/environment/bootstrap.sh b/tasks/0051_268_51268709_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_268_51268709_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_268_51268709_qa_5/environment/pull_bucket.py b/tasks/0051_268_51268709_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_268_51268709_qa_5/environment/pull_bucket.py +++ b/tasks/0051_268_51268709_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_268_51268709_qa_5/task.toml b/tasks/0051_268_51268709_qa_5/task.toml index b3b0b3a21e4c727e43d112d00c55b34a5c9c72a5..ee8dce12a70125d5d7b8bab7edad8361381e978d 100644 --- a/tasks/0051_268_51268709_qa_5/task.toml +++ b/tasks/0051_268_51268709_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_339_51339212_qa_4/environment/bootstrap.sh b/tasks/0051_339_51339212_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_339_51339212_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_339_51339212_qa_4/environment/pull_bucket.py b/tasks/0051_339_51339212_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_339_51339212_qa_4/environment/pull_bucket.py +++ b/tasks/0051_339_51339212_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_339_51339212_qa_4/task.toml b/tasks/0051_339_51339212_qa_4/task.toml index 4b8d4fa22c8e9e188edb5e77e821d9af7fe8351a..25ea12c44c1e521ee38f187e222d7b29699bbc9e 100644 --- a/tasks/0051_339_51339212_qa_4/task.toml +++ b/tasks/0051_339_51339212_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_374_51374286_qa_3/environment/bootstrap.sh b/tasks/0051_374_51374286_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_374_51374286_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_374_51374286_qa_3/environment/pull_bucket.py b/tasks/0051_374_51374286_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_374_51374286_qa_3/environment/pull_bucket.py +++ b/tasks/0051_374_51374286_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_374_51374286_qa_3/task.toml b/tasks/0051_374_51374286_qa_3/task.toml index e05e69d82c9b0d8c3cc9511e395096d0ea9dd1f6..b888876a15baa459747090a27f984db0236dc5f2 100644 --- a/tasks/0051_374_51374286_qa_3/task.toml +++ b/tasks/0051_374_51374286_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_399_51399567_qa_3/environment/bootstrap.sh b/tasks/0051_399_51399567_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_399_51399567_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_399_51399567_qa_3/environment/pull_bucket.py b/tasks/0051_399_51399567_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_399_51399567_qa_3/environment/pull_bucket.py +++ b/tasks/0051_399_51399567_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_399_51399567_qa_3/task.toml b/tasks/0051_399_51399567_qa_3/task.toml index 8b255225c67e0da52d71a4f17d10b2064d2550e5..ec965e290825735041456bf0a2ac405c1d8e4614 100644 --- a/tasks/0051_399_51399567_qa_3/task.toml +++ b/tasks/0051_399_51399567_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_399_51399567_qa_4/environment/bootstrap.sh b/tasks/0051_399_51399567_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_399_51399567_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_399_51399567_qa_4/environment/pull_bucket.py b/tasks/0051_399_51399567_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_399_51399567_qa_4/environment/pull_bucket.py +++ b/tasks/0051_399_51399567_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_399_51399567_qa_4/task.toml b/tasks/0051_399_51399567_qa_4/task.toml index 5ac3455a88104eb50a6dd047326913d89c1d6724..431223646bc862a28c3eaea3fd76de9f43411f55 100644 --- a/tasks/0051_399_51399567_qa_4/task.toml +++ b/tasks/0051_399_51399567_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_449_51449354_qa_4/environment/bootstrap.sh b/tasks/0051_449_51449354_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_449_51449354_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_449_51449354_qa_4/environment/pull_bucket.py b/tasks/0051_449_51449354_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_449_51449354_qa_4/environment/pull_bucket.py +++ b/tasks/0051_449_51449354_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_449_51449354_qa_4/task.toml b/tasks/0051_449_51449354_qa_4/task.toml index 3b22049f7d85b5073132b68277b5d2634d45caf5..30aeac04f14fe331bbdb56c742ccc5ee915e4991 100644 --- a/tasks/0051_449_51449354_qa_4/task.toml +++ b/tasks/0051_449_51449354_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_495_51495344_qa_4/environment/bootstrap.sh b/tasks/0051_495_51495344_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_495_51495344_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_495_51495344_qa_4/environment/pull_bucket.py b/tasks/0051_495_51495344_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_495_51495344_qa_4/environment/pull_bucket.py +++ b/tasks/0051_495_51495344_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_495_51495344_qa_4/task.toml b/tasks/0051_495_51495344_qa_4/task.toml index 50d72be9f546e76cbe3917ed14cce21ec206ec45..12aa22a40958f24c6ff90ad2ac4dfa2d7d508285 100644 --- a/tasks/0051_495_51495344_qa_4/task.toml +++ b/tasks/0051_495_51495344_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_525_51525477_qa_1/environment/bootstrap.sh b/tasks/0051_525_51525477_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_525_51525477_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_525_51525477_qa_1/environment/pull_bucket.py b/tasks/0051_525_51525477_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_525_51525477_qa_1/environment/pull_bucket.py +++ b/tasks/0051_525_51525477_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_525_51525477_qa_1/task.toml b/tasks/0051_525_51525477_qa_1/task.toml index 89caf1453e3a687b33e6a70831ee9887344f565d..42df3a62881ae2c03ac5a19edb6d7dda8a47b4a9 100644 --- a/tasks/0051_525_51525477_qa_1/task.toml +++ b/tasks/0051_525_51525477_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_525_51525477_qa_5/environment/bootstrap.sh b/tasks/0051_525_51525477_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_525_51525477_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_525_51525477_qa_5/environment/pull_bucket.py b/tasks/0051_525_51525477_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_525_51525477_qa_5/environment/pull_bucket.py +++ b/tasks/0051_525_51525477_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_525_51525477_qa_5/task.toml b/tasks/0051_525_51525477_qa_5/task.toml index 08280bb38671d1a7a1ec7b352f7ee6f025d7c724..f4324e862333f2e651403197a116718775f118fc 100644 --- a/tasks/0051_525_51525477_qa_5/task.toml +++ b/tasks/0051_525_51525477_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_529_51529879_qa_4/environment/bootstrap.sh b/tasks/0051_529_51529879_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_529_51529879_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_529_51529879_qa_4/environment/pull_bucket.py b/tasks/0051_529_51529879_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_529_51529879_qa_4/environment/pull_bucket.py +++ b/tasks/0051_529_51529879_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_529_51529879_qa_4/task.toml b/tasks/0051_529_51529879_qa_4/task.toml index b458d5f9c9dd7a044d59ab36523aadbafcfd3492..aca88c65ea582d68fb86fa56e23da9a56b7bbfbd 100644 --- a/tasks/0051_529_51529879_qa_4/task.toml +++ b/tasks/0051_529_51529879_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_530_51530318_qa_2/environment/bootstrap.sh b/tasks/0051_530_51530318_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_530_51530318_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_530_51530318_qa_2/environment/pull_bucket.py b/tasks/0051_530_51530318_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_530_51530318_qa_2/environment/pull_bucket.py +++ b/tasks/0051_530_51530318_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_530_51530318_qa_2/task.toml b/tasks/0051_530_51530318_qa_2/task.toml index becd1ccb7015b517781c0b36fb98529eca9905ef..3227ed92c1f4a6ae5312d69a05a02df0f0f1d839 100644 --- a/tasks/0051_530_51530318_qa_2/task.toml +++ b/tasks/0051_530_51530318_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_530_51530318_qa_3/environment/bootstrap.sh b/tasks/0051_530_51530318_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_530_51530318_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_530_51530318_qa_3/environment/pull_bucket.py b/tasks/0051_530_51530318_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_530_51530318_qa_3/environment/pull_bucket.py +++ b/tasks/0051_530_51530318_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_530_51530318_qa_3/task.toml b/tasks/0051_530_51530318_qa_3/task.toml index 2405ecf9ec5d66b6278c42938906598354b69a5a..71b99c7a57dcfc3483d8bb23165c9a2f6c97e86e 100644 --- a/tasks/0051_530_51530318_qa_3/task.toml +++ b/tasks/0051_530_51530318_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_543_51543222_qa_5/environment/bootstrap.sh b/tasks/0051_543_51543222_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_543_51543222_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_543_51543222_qa_5/environment/pull_bucket.py b/tasks/0051_543_51543222_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_543_51543222_qa_5/environment/pull_bucket.py +++ b/tasks/0051_543_51543222_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_543_51543222_qa_5/task.toml b/tasks/0051_543_51543222_qa_5/task.toml index 6e898e2f14e1947b1d0e17dc222c0d16ae1018fd..8194e45fb0070425838b6a6df7381d488d0472c7 100644 --- a/tasks/0051_543_51543222_qa_5/task.toml +++ b/tasks/0051_543_51543222_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_554_51554569_qa_5/environment/bootstrap.sh b/tasks/0051_554_51554569_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_554_51554569_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_554_51554569_qa_5/environment/pull_bucket.py b/tasks/0051_554_51554569_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_554_51554569_qa_5/environment/pull_bucket.py +++ b/tasks/0051_554_51554569_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_554_51554569_qa_5/task.toml b/tasks/0051_554_51554569_qa_5/task.toml index 386b1bc25676e1d223fc0de626f452f71acc7482..36f0d4f4e417fcf2b71c376f4c97d52f4890438f 100644 --- a/tasks/0051_554_51554569_qa_5/task.toml +++ b/tasks/0051_554_51554569_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_559_51559102_qa_1/environment/bootstrap.sh b/tasks/0051_559_51559102_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_559_51559102_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_559_51559102_qa_1/environment/pull_bucket.py b/tasks/0051_559_51559102_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_559_51559102_qa_1/environment/pull_bucket.py +++ b/tasks/0051_559_51559102_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_559_51559102_qa_1/task.toml b/tasks/0051_559_51559102_qa_1/task.toml index 6ca3fea6ec1a0c1c6107097394f4c0810c4482fd..9e9b3501dccbaa66bbea081836334388b653ffb6 100644 --- a/tasks/0051_559_51559102_qa_1/task.toml +++ b/tasks/0051_559_51559102_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_559_51559102_qa_2/environment/bootstrap.sh b/tasks/0051_559_51559102_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_559_51559102_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_559_51559102_qa_2/environment/pull_bucket.py b/tasks/0051_559_51559102_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_559_51559102_qa_2/environment/pull_bucket.py +++ b/tasks/0051_559_51559102_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_559_51559102_qa_2/task.toml b/tasks/0051_559_51559102_qa_2/task.toml index ac8c65d8332093a1cd73109e4520fd9a3a56ff38..9b0864ce127fd5b60a5be83a967a3d131aab4a5d 100644 --- a/tasks/0051_559_51559102_qa_2/task.toml +++ b/tasks/0051_559_51559102_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_559_51559102_qa_3/environment/bootstrap.sh b/tasks/0051_559_51559102_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_559_51559102_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_559_51559102_qa_3/environment/pull_bucket.py b/tasks/0051_559_51559102_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_559_51559102_qa_3/environment/pull_bucket.py +++ b/tasks/0051_559_51559102_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_559_51559102_qa_3/task.toml b/tasks/0051_559_51559102_qa_3/task.toml index eaab0b8fd8ce9829d2297f421da92210ca9315a9..041868a3b56be88b6c6b60cec7baea9218bb77b8 100644 --- a/tasks/0051_559_51559102_qa_3/task.toml +++ b/tasks/0051_559_51559102_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_559_51559102_qa_5/environment/bootstrap.sh b/tasks/0051_559_51559102_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_559_51559102_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_559_51559102_qa_5/environment/pull_bucket.py b/tasks/0051_559_51559102_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_559_51559102_qa_5/environment/pull_bucket.py +++ b/tasks/0051_559_51559102_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_559_51559102_qa_5/task.toml b/tasks/0051_559_51559102_qa_5/task.toml index ff573245946029a64bfcff83b1d8847a07b030f0..1c393282dd9cfefc8b4ed605ea12756a6ec4cc19 100644 --- a/tasks/0051_559_51559102_qa_5/task.toml +++ b/tasks/0051_559_51559102_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_561_51561248_qa_4/environment/bootstrap.sh b/tasks/0051_561_51561248_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_561_51561248_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_561_51561248_qa_4/environment/pull_bucket.py b/tasks/0051_561_51561248_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_561_51561248_qa_4/environment/pull_bucket.py +++ b/tasks/0051_561_51561248_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_561_51561248_qa_4/task.toml b/tasks/0051_561_51561248_qa_4/task.toml index c10f399fd255328a1a94f9f32429e9096115234b..45590e84c6b80d06bcd47230c31bdd5da1a6f403 100644 --- a/tasks/0051_561_51561248_qa_4/task.toml +++ b/tasks/0051_561_51561248_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_591_51591719_qa_1/environment/bootstrap.sh b/tasks/0051_591_51591719_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_591_51591719_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_591_51591719_qa_1/environment/pull_bucket.py b/tasks/0051_591_51591719_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_591_51591719_qa_1/environment/pull_bucket.py +++ b/tasks/0051_591_51591719_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_591_51591719_qa_1/task.toml b/tasks/0051_591_51591719_qa_1/task.toml index 7cc59928481ff1f4a937bb27461a6b3d427a07f6..4bf9560c1a42bdf1ac3ebca0ce786b0a9d61cb3a 100644 --- a/tasks/0051_591_51591719_qa_1/task.toml +++ b/tasks/0051_591_51591719_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_611_51611771_qa_5/environment/bootstrap.sh b/tasks/0051_611_51611771_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_611_51611771_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_611_51611771_qa_5/environment/pull_bucket.py b/tasks/0051_611_51611771_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_611_51611771_qa_5/environment/pull_bucket.py +++ b/tasks/0051_611_51611771_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_611_51611771_qa_5/task.toml b/tasks/0051_611_51611771_qa_5/task.toml index 01efa4e9807210c7b75537de459a81365a098cb0..9b1fa63cc7968cdfe05f5ba406f9a6ab763db2bc 100644 --- a/tasks/0051_611_51611771_qa_5/task.toml +++ b/tasks/0051_611_51611771_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_637_51637337_qa_1/environment/bootstrap.sh b/tasks/0051_637_51637337_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_637_51637337_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_637_51637337_qa_1/environment/pull_bucket.py b/tasks/0051_637_51637337_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_637_51637337_qa_1/environment/pull_bucket.py +++ b/tasks/0051_637_51637337_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_637_51637337_qa_1/task.toml b/tasks/0051_637_51637337_qa_1/task.toml index 860cbe4c1e0de94cc1b98b8b8bcde9b5558e1bb7..9fcdd7c0d8ca30d0ead4dffda608a8733cd3bb47 100644 --- a/tasks/0051_637_51637337_qa_1/task.toml +++ b/tasks/0051_637_51637337_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_637_51637337_qa_2/environment/bootstrap.sh b/tasks/0051_637_51637337_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_637_51637337_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_637_51637337_qa_2/environment/pull_bucket.py b/tasks/0051_637_51637337_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_637_51637337_qa_2/environment/pull_bucket.py +++ b/tasks/0051_637_51637337_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_637_51637337_qa_2/task.toml b/tasks/0051_637_51637337_qa_2/task.toml index bc4470081c253a7147cc3d17c9bdff522635bb5f..c8280b56977fdd633ac6b6ff0b35f828de50685b 100644 --- a/tasks/0051_637_51637337_qa_2/task.toml +++ b/tasks/0051_637_51637337_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_644_51644569_qa_2/environment/bootstrap.sh b/tasks/0051_644_51644569_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_644_51644569_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_644_51644569_qa_2/environment/pull_bucket.py b/tasks/0051_644_51644569_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_644_51644569_qa_2/environment/pull_bucket.py +++ b/tasks/0051_644_51644569_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_644_51644569_qa_2/task.toml b/tasks/0051_644_51644569_qa_2/task.toml index bfd1d8f4a974935bd502bef365b0020d8ce353d1..77b8b35c60c962a6cfa81b5781732acc60c0a6b7 100644 --- a/tasks/0051_644_51644569_qa_2/task.toml +++ b/tasks/0051_644_51644569_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_653_51653330_qa_5/environment/bootstrap.sh b/tasks/0051_653_51653330_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_653_51653330_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_653_51653330_qa_5/environment/pull_bucket.py b/tasks/0051_653_51653330_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_653_51653330_qa_5/environment/pull_bucket.py +++ b/tasks/0051_653_51653330_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_653_51653330_qa_5/task.toml b/tasks/0051_653_51653330_qa_5/task.toml index 0a7aacd0489f50e19af928292ea28ec5c1f5e8fd..f4b44e3f159673164332d6c064e39490853d8e2f 100644 --- a/tasks/0051_653_51653330_qa_5/task.toml +++ b/tasks/0051_653_51653330_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_692_51692011_qa_1/environment/bootstrap.sh b/tasks/0051_692_51692011_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_692_51692011_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_692_51692011_qa_1/environment/pull_bucket.py b/tasks/0051_692_51692011_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_692_51692011_qa_1/environment/pull_bucket.py +++ b/tasks/0051_692_51692011_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_692_51692011_qa_1/task.toml b/tasks/0051_692_51692011_qa_1/task.toml index 5776df8d4cbbfe32a884fbb3aef9a946c7df25ed..5b2e444647409a2a34d81b21970afe37c9329fa2 100644 --- a/tasks/0051_692_51692011_qa_1/task.toml +++ b/tasks/0051_692_51692011_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_761_51761312_qa_3/environment/bootstrap.sh b/tasks/0051_761_51761312_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_761_51761312_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_761_51761312_qa_3/environment/pull_bucket.py b/tasks/0051_761_51761312_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_761_51761312_qa_3/environment/pull_bucket.py +++ b/tasks/0051_761_51761312_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_761_51761312_qa_3/task.toml b/tasks/0051_761_51761312_qa_3/task.toml index ff0d41a21b56ee66a1fd137e1f9cfd6aa1d6a935..2b58004c4f90a17100c9d4a0e11dcb719e90c395 100644 --- a/tasks/0051_761_51761312_qa_3/task.toml +++ b/tasks/0051_761_51761312_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_768_51768802_qa_2/environment/bootstrap.sh b/tasks/0051_768_51768802_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_768_51768802_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_768_51768802_qa_2/environment/pull_bucket.py b/tasks/0051_768_51768802_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_768_51768802_qa_2/environment/pull_bucket.py +++ b/tasks/0051_768_51768802_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_768_51768802_qa_2/task.toml b/tasks/0051_768_51768802_qa_2/task.toml index aee1b8cf6c4721745ee6cb2c317c402c84a83776..05bedb771fb84e38797498eb803f388ebf910713 100644 --- a/tasks/0051_768_51768802_qa_2/task.toml +++ b/tasks/0051_768_51768802_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_802_51802195_qa_3/environment/bootstrap.sh b/tasks/0051_802_51802195_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_802_51802195_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_802_51802195_qa_3/environment/pull_bucket.py b/tasks/0051_802_51802195_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_802_51802195_qa_3/environment/pull_bucket.py +++ b/tasks/0051_802_51802195_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_802_51802195_qa_3/task.toml b/tasks/0051_802_51802195_qa_3/task.toml index da91eece97d936d3701719a9ece64fff0b6545bd..cecf92230533a5f0e9fc6c2fba3281884e6fd9f2 100644 --- a/tasks/0051_802_51802195_qa_3/task.toml +++ b/tasks/0051_802_51802195_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_802_51802195_qa_4/environment/bootstrap.sh b/tasks/0051_802_51802195_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_802_51802195_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_802_51802195_qa_4/environment/pull_bucket.py b/tasks/0051_802_51802195_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_802_51802195_qa_4/environment/pull_bucket.py +++ b/tasks/0051_802_51802195_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_802_51802195_qa_4/task.toml b/tasks/0051_802_51802195_qa_4/task.toml index d3f0a7cc745412f9703748a3919a67861bf74e42..d4afde0079df99d7930b4cc6ebbb0142ae3896ab 100644 --- a/tasks/0051_802_51802195_qa_4/task.toml +++ b/tasks/0051_802_51802195_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_829_51829460_qa_2/environment/bootstrap.sh b/tasks/0051_829_51829460_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_829_51829460_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_829_51829460_qa_2/environment/pull_bucket.py b/tasks/0051_829_51829460_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_829_51829460_qa_2/environment/pull_bucket.py +++ b/tasks/0051_829_51829460_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_829_51829460_qa_2/task.toml b/tasks/0051_829_51829460_qa_2/task.toml index ef645531d954766ec98f9e2a7cb9829796162511..43fe668c1f46a1c828eea6c965bd6fc140f1cd49 100644 --- a/tasks/0051_829_51829460_qa_2/task.toml +++ b/tasks/0051_829_51829460_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_852_51852671_qa_1/environment/bootstrap.sh b/tasks/0051_852_51852671_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_852_51852671_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_852_51852671_qa_1/environment/pull_bucket.py b/tasks/0051_852_51852671_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_852_51852671_qa_1/environment/pull_bucket.py +++ b/tasks/0051_852_51852671_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_852_51852671_qa_1/task.toml b/tasks/0051_852_51852671_qa_1/task.toml index 54dcb01ab8515fc819f57ebdd312741394703ef8..f57a711286a1fa3a26db4ac743f5f1eb27fbe629 100644 --- a/tasks/0051_852_51852671_qa_1/task.toml +++ b/tasks/0051_852_51852671_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_855_51855195_qa_2/environment/bootstrap.sh b/tasks/0051_855_51855195_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_855_51855195_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_855_51855195_qa_2/environment/pull_bucket.py b/tasks/0051_855_51855195_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_855_51855195_qa_2/environment/pull_bucket.py +++ b/tasks/0051_855_51855195_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_855_51855195_qa_2/task.toml b/tasks/0051_855_51855195_qa_2/task.toml index 35a7c8987188cb1db6e2c8960cc73073061f20f1..5f14c8ceb145685f9fa3dd84a3deb3ba63c13ec0 100644 --- a/tasks/0051_855_51855195_qa_2/task.toml +++ b/tasks/0051_855_51855195_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_880_51880201_qa_3/environment/bootstrap.sh b/tasks/0051_880_51880201_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_880_51880201_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_880_51880201_qa_3/environment/pull_bucket.py b/tasks/0051_880_51880201_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_880_51880201_qa_3/environment/pull_bucket.py +++ b/tasks/0051_880_51880201_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_880_51880201_qa_3/task.toml b/tasks/0051_880_51880201_qa_3/task.toml index 392edc13970b9737fbf34ec903dcb10a722a5c8e..d0b322e2f338fbfd53e816b67f4c03a6b82f26ba 100644 --- a/tasks/0051_880_51880201_qa_3/task.toml +++ b/tasks/0051_880_51880201_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_882_51882906_qa_1/environment/bootstrap.sh b/tasks/0051_882_51882906_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_882_51882906_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_882_51882906_qa_1/environment/pull_bucket.py b/tasks/0051_882_51882906_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_882_51882906_qa_1/environment/pull_bucket.py +++ b/tasks/0051_882_51882906_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_882_51882906_qa_1/task.toml b/tasks/0051_882_51882906_qa_1/task.toml index 2936689a25358b06d9f246b5479869e78c90d120..e0e3e0e30db43e5d003057feea7e526a2d733154 100644 --- a/tasks/0051_882_51882906_qa_1/task.toml +++ b/tasks/0051_882_51882906_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_926_51926021_qa_4/environment/bootstrap.sh b/tasks/0051_926_51926021_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_926_51926021_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_926_51926021_qa_4/environment/pull_bucket.py b/tasks/0051_926_51926021_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_926_51926021_qa_4/environment/pull_bucket.py +++ b/tasks/0051_926_51926021_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_926_51926021_qa_4/task.toml b/tasks/0051_926_51926021_qa_4/task.toml index b825d9cb6179e526860912a7f83168ddd14654b6..818cc51d7b380a7b2bfe4fd1ad34deacd1d18823 100644 --- a/tasks/0051_926_51926021_qa_4/task.toml +++ b/tasks/0051_926_51926021_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_967_51967182_qa_2/environment/bootstrap.sh b/tasks/0051_967_51967182_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_967_51967182_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_967_51967182_qa_2/environment/pull_bucket.py b/tasks/0051_967_51967182_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_967_51967182_qa_2/environment/pull_bucket.py +++ b/tasks/0051_967_51967182_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_967_51967182_qa_2/task.toml b/tasks/0051_967_51967182_qa_2/task.toml index e2e5ebde847b1c53e5e6e2bc5b54bfe81d5d914b..c6c85820249727486758571206426d316fe5b06c 100644 --- a/tasks/0051_967_51967182_qa_2/task.toml +++ b/tasks/0051_967_51967182_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_967_51967182_qa_4/environment/bootstrap.sh b/tasks/0051_967_51967182_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_967_51967182_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_967_51967182_qa_4/environment/pull_bucket.py b/tasks/0051_967_51967182_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_967_51967182_qa_4/environment/pull_bucket.py +++ b/tasks/0051_967_51967182_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_967_51967182_qa_4/task.toml b/tasks/0051_967_51967182_qa_4/task.toml index 2a7ab698b9049bd81d4603223198e4cd04c5369a..77302a2f45fd906535dbb4049c083d8c4288eb25 100644 --- a/tasks/0051_967_51967182_qa_4/task.toml +++ b/tasks/0051_967_51967182_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_975_51975834_qa_4/environment/bootstrap.sh b/tasks/0051_975_51975834_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_975_51975834_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_975_51975834_qa_4/environment/pull_bucket.py b/tasks/0051_975_51975834_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_975_51975834_qa_4/environment/pull_bucket.py +++ b/tasks/0051_975_51975834_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_975_51975834_qa_4/task.toml b/tasks/0051_975_51975834_qa_4/task.toml index ec10b689aa0c52be2ea83cbdadf9920c77dd687c..299c7ed641037af29b72b8e0e1ee519b343c396e 100644 --- a/tasks/0051_975_51975834_qa_4/task.toml +++ b/tasks/0051_975_51975834_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0051_990_51990433_qa_2/environment/bootstrap.sh b/tasks/0051_990_51990433_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0051_990_51990433_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0051_990_51990433_qa_2/environment/pull_bucket.py b/tasks/0051_990_51990433_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0051_990_51990433_qa_2/environment/pull_bucket.py +++ b/tasks/0051_990_51990433_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0051_990_51990433_qa_2/task.toml b/tasks/0051_990_51990433_qa_2/task.toml index 5fa0de9009bfbd028422dad5f388a62e7ec0a2de..ddf91f2e09b735375432d0823497ce389f5aa53e 100644 --- a/tasks/0051_990_51990433_qa_2/task.toml +++ b/tasks/0051_990_51990433_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_019_52019978_qa_2/environment/bootstrap.sh b/tasks/0052_019_52019978_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_019_52019978_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_019_52019978_qa_2/environment/pull_bucket.py b/tasks/0052_019_52019978_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_019_52019978_qa_2/environment/pull_bucket.py +++ b/tasks/0052_019_52019978_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_019_52019978_qa_2/task.toml b/tasks/0052_019_52019978_qa_2/task.toml index 299cdb53f664275be92e6af54eda8be718cab1fe..30434561a8a7cc87831f9e74c4e098a7aba3715d 100644 --- a/tasks/0052_019_52019978_qa_2/task.toml +++ b/tasks/0052_019_52019978_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_026_52026780_qa_3/environment/bootstrap.sh b/tasks/0052_026_52026780_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_026_52026780_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_026_52026780_qa_3/environment/pull_bucket.py b/tasks/0052_026_52026780_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_026_52026780_qa_3/environment/pull_bucket.py +++ b/tasks/0052_026_52026780_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_026_52026780_qa_3/task.toml b/tasks/0052_026_52026780_qa_3/task.toml index 76013919fab63f65a4ed009f3eef4a84d3cfa5ea..985e38d6716b96cc2adfb61f63cad0f9188ea562 100644 --- a/tasks/0052_026_52026780_qa_3/task.toml +++ b/tasks/0052_026_52026780_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_041_52041171_qa_2/environment/bootstrap.sh b/tasks/0052_041_52041171_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_041_52041171_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_041_52041171_qa_2/environment/pull_bucket.py b/tasks/0052_041_52041171_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_041_52041171_qa_2/environment/pull_bucket.py +++ b/tasks/0052_041_52041171_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_041_52041171_qa_2/task.toml b/tasks/0052_041_52041171_qa_2/task.toml index a2f816179157a5717c076d9e0e937c247a8d6911..06e4cb947dff81df483bb517e01aa630d7659246 100644 --- a/tasks/0052_041_52041171_qa_2/task.toml +++ b/tasks/0052_041_52041171_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_048_52048011_qa_1/environment/bootstrap.sh b/tasks/0052_048_52048011_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_048_52048011_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_048_52048011_qa_1/environment/pull_bucket.py b/tasks/0052_048_52048011_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_048_52048011_qa_1/environment/pull_bucket.py +++ b/tasks/0052_048_52048011_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_048_52048011_qa_1/task.toml b/tasks/0052_048_52048011_qa_1/task.toml index f9640e343e8e2e8899e4c8531fe08055b4259a1b..60c6c71688946467801629f17345f72d51a9bb03 100644 --- a/tasks/0052_048_52048011_qa_1/task.toml +++ b/tasks/0052_048_52048011_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_159_52159634_qa_3/environment/bootstrap.sh b/tasks/0052_159_52159634_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_159_52159634_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_159_52159634_qa_3/environment/pull_bucket.py b/tasks/0052_159_52159634_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_159_52159634_qa_3/environment/pull_bucket.py +++ b/tasks/0052_159_52159634_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_159_52159634_qa_3/task.toml b/tasks/0052_159_52159634_qa_3/task.toml index e3b18aac0dd8e6df8963550d06a3c2d64151ac2b..bc9e1b0d2b7d53be070547e52fd78552f35bcc44 100644 --- a/tasks/0052_159_52159634_qa_3/task.toml +++ b/tasks/0052_159_52159634_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_172_52172729_qa_2/environment/bootstrap.sh b/tasks/0052_172_52172729_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_172_52172729_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_172_52172729_qa_2/environment/pull_bucket.py b/tasks/0052_172_52172729_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_172_52172729_qa_2/environment/pull_bucket.py +++ b/tasks/0052_172_52172729_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_172_52172729_qa_2/task.toml b/tasks/0052_172_52172729_qa_2/task.toml index 2630999b896ca5ae3de2aaa940a7948146f6227a..61a1b37e4106c9f800d917e1396b5c4f33a4cf96 100644 --- a/tasks/0052_172_52172729_qa_2/task.toml +++ b/tasks/0052_172_52172729_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_298_52298447_qa_5/environment/bootstrap.sh b/tasks/0052_298_52298447_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_298_52298447_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_298_52298447_qa_5/environment/pull_bucket.py b/tasks/0052_298_52298447_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_298_52298447_qa_5/environment/pull_bucket.py +++ b/tasks/0052_298_52298447_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_298_52298447_qa_5/task.toml b/tasks/0052_298_52298447_qa_5/task.toml index 03fb86eaf85db4eaddffb76dcca18fe85c07d1ad..fb7ce10e39c7e5463f8f3a376faa99b718a4f196 100644 --- a/tasks/0052_298_52298447_qa_5/task.toml +++ b/tasks/0052_298_52298447_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_313_52313444_qa_1/environment/bootstrap.sh b/tasks/0052_313_52313444_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_313_52313444_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_313_52313444_qa_1/environment/pull_bucket.py b/tasks/0052_313_52313444_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_313_52313444_qa_1/environment/pull_bucket.py +++ b/tasks/0052_313_52313444_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_313_52313444_qa_1/task.toml b/tasks/0052_313_52313444_qa_1/task.toml index c69d2d75d15e59cbfa83c8049e1ce9e7e363d7c6..aef599f0834730a69486ddf984758b993ac73efb 100644 --- a/tasks/0052_313_52313444_qa_1/task.toml +++ b/tasks/0052_313_52313444_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_313_52313444_qa_4/environment/bootstrap.sh b/tasks/0052_313_52313444_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_313_52313444_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_313_52313444_qa_4/environment/pull_bucket.py b/tasks/0052_313_52313444_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_313_52313444_qa_4/environment/pull_bucket.py +++ b/tasks/0052_313_52313444_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_313_52313444_qa_4/task.toml b/tasks/0052_313_52313444_qa_4/task.toml index c56c2c8e4218e077f7d8cccd9d64a00cac58d524..01d0820982831d2228e446d9c6bf0e73d84663b4 100644 --- a/tasks/0052_313_52313444_qa_4/task.toml +++ b/tasks/0052_313_52313444_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_331_52331828_qa_4/environment/bootstrap.sh b/tasks/0052_331_52331828_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_331_52331828_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_331_52331828_qa_4/environment/pull_bucket.py b/tasks/0052_331_52331828_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_331_52331828_qa_4/environment/pull_bucket.py +++ b/tasks/0052_331_52331828_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_331_52331828_qa_4/task.toml b/tasks/0052_331_52331828_qa_4/task.toml index 4a74c2336a6d19bda65eb5611bbd265839cd358d..0f6498d94068e91aa5b38d4389270990ad7aef0d 100644 --- a/tasks/0052_331_52331828_qa_4/task.toml +++ b/tasks/0052_331_52331828_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_377_52377809_qa_3/environment/bootstrap.sh b/tasks/0052_377_52377809_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_377_52377809_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_377_52377809_qa_3/environment/pull_bucket.py b/tasks/0052_377_52377809_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_377_52377809_qa_3/environment/pull_bucket.py +++ b/tasks/0052_377_52377809_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_377_52377809_qa_3/task.toml b/tasks/0052_377_52377809_qa_3/task.toml index 4b3bf4cc758867c3bcda68f2f40d577ada0f98e8..53b896709cb1afafe3e1428344d0fe26d80d7b8f 100644 --- a/tasks/0052_377_52377809_qa_3/task.toml +++ b/tasks/0052_377_52377809_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_465_52465579_qa_3/environment/bootstrap.sh b/tasks/0052_465_52465579_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_465_52465579_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_465_52465579_qa_3/environment/pull_bucket.py b/tasks/0052_465_52465579_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_465_52465579_qa_3/environment/pull_bucket.py +++ b/tasks/0052_465_52465579_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_465_52465579_qa_3/task.toml b/tasks/0052_465_52465579_qa_3/task.toml index f5fd7a93fc64c3e7a34f641e54700e2c8cbe7180..5f76c968edb9ce11e64527c193d07aaa7619e56d 100644 --- a/tasks/0052_465_52465579_qa_3/task.toml +++ b/tasks/0052_465_52465579_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_471_52471814_qa_1/environment/bootstrap.sh b/tasks/0052_471_52471814_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_471_52471814_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_471_52471814_qa_1/environment/pull_bucket.py b/tasks/0052_471_52471814_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_471_52471814_qa_1/environment/pull_bucket.py +++ b/tasks/0052_471_52471814_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_471_52471814_qa_1/task.toml b/tasks/0052_471_52471814_qa_1/task.toml index eb0bbc029ceb61b6aeaa73391394f364ed232eef..a098b7412ffe8ce36f7d610e20c8251e2027758b 100644 --- a/tasks/0052_471_52471814_qa_1/task.toml +++ b/tasks/0052_471_52471814_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_471_52471814_qa_3/environment/bootstrap.sh b/tasks/0052_471_52471814_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_471_52471814_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_471_52471814_qa_3/environment/pull_bucket.py b/tasks/0052_471_52471814_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_471_52471814_qa_3/environment/pull_bucket.py +++ b/tasks/0052_471_52471814_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_471_52471814_qa_3/task.toml b/tasks/0052_471_52471814_qa_3/task.toml index f33057c2ac1bf58259d08ac662ce99050a78c334..7c3c02ee8d0ef33bf41e87d52e109be0d028ed3c 100644 --- a/tasks/0052_471_52471814_qa_3/task.toml +++ b/tasks/0052_471_52471814_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_476_52476342_qa_2/environment/bootstrap.sh b/tasks/0052_476_52476342_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_476_52476342_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_476_52476342_qa_2/environment/pull_bucket.py b/tasks/0052_476_52476342_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_476_52476342_qa_2/environment/pull_bucket.py +++ b/tasks/0052_476_52476342_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_476_52476342_qa_2/task.toml b/tasks/0052_476_52476342_qa_2/task.toml index 7cf68601e7f7a73391bab7ea180e96c64745eeaf..8c69818f9b1d2ba4827c385b96f7f0f384dd9926 100644 --- a/tasks/0052_476_52476342_qa_2/task.toml +++ b/tasks/0052_476_52476342_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_476_52476342_qa_3/environment/bootstrap.sh b/tasks/0052_476_52476342_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_476_52476342_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_476_52476342_qa_3/environment/pull_bucket.py b/tasks/0052_476_52476342_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_476_52476342_qa_3/environment/pull_bucket.py +++ b/tasks/0052_476_52476342_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_476_52476342_qa_3/task.toml b/tasks/0052_476_52476342_qa_3/task.toml index f8fdc5109e0e49000bae89e99807b51d5bbf6a15..64690133e565f6c6684e9b76a78c53bed03e666f 100644 --- a/tasks/0052_476_52476342_qa_3/task.toml +++ b/tasks/0052_476_52476342_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_512_52512591_qa_4/environment/bootstrap.sh b/tasks/0052_512_52512591_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_512_52512591_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_512_52512591_qa_4/environment/pull_bucket.py b/tasks/0052_512_52512591_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_512_52512591_qa_4/environment/pull_bucket.py +++ b/tasks/0052_512_52512591_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_512_52512591_qa_4/task.toml b/tasks/0052_512_52512591_qa_4/task.toml index cacbf179a8937f8678454d810c92d033856a62da..e1eba85270f85a73f4ee6dd47211c311c12ab822 100644 --- a/tasks/0052_512_52512591_qa_4/task.toml +++ b/tasks/0052_512_52512591_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_521_52521020_qa_1/environment/bootstrap.sh b/tasks/0052_521_52521020_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_521_52521020_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_521_52521020_qa_1/environment/pull_bucket.py b/tasks/0052_521_52521020_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_521_52521020_qa_1/environment/pull_bucket.py +++ b/tasks/0052_521_52521020_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_521_52521020_qa_1/task.toml b/tasks/0052_521_52521020_qa_1/task.toml index b50eeaa186abb645ef82d229c9d6a0fe5ce59cb9..2d87bdce2ae9eee70f6f880088653ffd614f5423 100644 --- a/tasks/0052_521_52521020_qa_1/task.toml +++ b/tasks/0052_521_52521020_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_521_52521020_qa_2/environment/bootstrap.sh b/tasks/0052_521_52521020_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_521_52521020_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_521_52521020_qa_2/environment/pull_bucket.py b/tasks/0052_521_52521020_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_521_52521020_qa_2/environment/pull_bucket.py +++ b/tasks/0052_521_52521020_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_521_52521020_qa_2/task.toml b/tasks/0052_521_52521020_qa_2/task.toml index 6feca92dbb036898c8b94a954ca3ae45177430f3..efeb682c64495b629e1ff05caccd9089093a1ea6 100644 --- a/tasks/0052_521_52521020_qa_2/task.toml +++ b/tasks/0052_521_52521020_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_533_52533879_qa_5/environment/bootstrap.sh b/tasks/0052_533_52533879_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_533_52533879_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_533_52533879_qa_5/environment/pull_bucket.py b/tasks/0052_533_52533879_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_533_52533879_qa_5/environment/pull_bucket.py +++ b/tasks/0052_533_52533879_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_533_52533879_qa_5/task.toml b/tasks/0052_533_52533879_qa_5/task.toml index ad097e3e91889b922b63f3a7d5f628f4e7de70d9..72a3bea71b2198e975527ebd63fa6f1d03e204fa 100644 --- a/tasks/0052_533_52533879_qa_5/task.toml +++ b/tasks/0052_533_52533879_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_546_52546501_qa_4/environment/bootstrap.sh b/tasks/0052_546_52546501_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_546_52546501_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_546_52546501_qa_4/environment/pull_bucket.py b/tasks/0052_546_52546501_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_546_52546501_qa_4/environment/pull_bucket.py +++ b/tasks/0052_546_52546501_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_546_52546501_qa_4/task.toml b/tasks/0052_546_52546501_qa_4/task.toml index 8e967df0a6b8ec363544b8c2f59b0ed8a1cdbdf8..9cbe4a7da2ee5a73dbd7314bf74f0438dc0175ef 100644 --- a/tasks/0052_546_52546501_qa_4/task.toml +++ b/tasks/0052_546_52546501_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_586_52586560_qa_3/environment/bootstrap.sh b/tasks/0052_586_52586560_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_586_52586560_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_586_52586560_qa_3/environment/pull_bucket.py b/tasks/0052_586_52586560_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_586_52586560_qa_3/environment/pull_bucket.py +++ b/tasks/0052_586_52586560_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_586_52586560_qa_3/task.toml b/tasks/0052_586_52586560_qa_3/task.toml index a27d4ced793fa6c71ca5bc54d081dc35b7d4cf0f..ff46f3d0f4510c75bb11a174da9f7bf58de7d735 100644 --- a/tasks/0052_586_52586560_qa_3/task.toml +++ b/tasks/0052_586_52586560_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_586_52586560_qa_4/environment/bootstrap.sh b/tasks/0052_586_52586560_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_586_52586560_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_586_52586560_qa_4/environment/pull_bucket.py b/tasks/0052_586_52586560_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_586_52586560_qa_4/environment/pull_bucket.py +++ b/tasks/0052_586_52586560_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_586_52586560_qa_4/task.toml b/tasks/0052_586_52586560_qa_4/task.toml index f68804a12a7412c53a1c8e15f1b34409393f545f..139ed6b7582c3f606b330af4d19c4107091fc4ae 100644 --- a/tasks/0052_586_52586560_qa_4/task.toml +++ b/tasks/0052_586_52586560_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_587_52587517_qa_2/environment/bootstrap.sh b/tasks/0052_587_52587517_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_587_52587517_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_587_52587517_qa_2/environment/pull_bucket.py b/tasks/0052_587_52587517_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_587_52587517_qa_2/environment/pull_bucket.py +++ b/tasks/0052_587_52587517_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_587_52587517_qa_2/task.toml b/tasks/0052_587_52587517_qa_2/task.toml index b5f00cf67727d1e220f55bbbdfb82b4be2796a7f..24da8a9b8aa667b9efcbcfc1c2b7cf5c20b6ee71 100644 --- a/tasks/0052_587_52587517_qa_2/task.toml +++ b/tasks/0052_587_52587517_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_587_52587517_qa_3/environment/bootstrap.sh b/tasks/0052_587_52587517_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_587_52587517_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_587_52587517_qa_3/environment/pull_bucket.py b/tasks/0052_587_52587517_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_587_52587517_qa_3/environment/pull_bucket.py +++ b/tasks/0052_587_52587517_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_587_52587517_qa_3/task.toml b/tasks/0052_587_52587517_qa_3/task.toml index b14efb6c19dc7ddd89f543584c06b076ee4b7269..b40805c622584cfb6605552b3c1c2d6c9c8f0eae 100644 --- a/tasks/0052_587_52587517_qa_3/task.toml +++ b/tasks/0052_587_52587517_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_587_52587517_qa_4/environment/bootstrap.sh b/tasks/0052_587_52587517_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_587_52587517_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_587_52587517_qa_4/environment/pull_bucket.py b/tasks/0052_587_52587517_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_587_52587517_qa_4/environment/pull_bucket.py +++ b/tasks/0052_587_52587517_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_587_52587517_qa_4/task.toml b/tasks/0052_587_52587517_qa_4/task.toml index 0ea1aa24f44ac01da79bc9b3ab757c99d2155b2f..98dd519aea7c41d18972d321d20f3efda09129fb 100644 --- a/tasks/0052_587_52587517_qa_4/task.toml +++ b/tasks/0052_587_52587517_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_615_52615149_qa_2/environment/bootstrap.sh b/tasks/0052_615_52615149_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_615_52615149_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_615_52615149_qa_2/environment/pull_bucket.py b/tasks/0052_615_52615149_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_615_52615149_qa_2/environment/pull_bucket.py +++ b/tasks/0052_615_52615149_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_615_52615149_qa_2/task.toml b/tasks/0052_615_52615149_qa_2/task.toml index 94153ed0079670ff9b46af3226903d6727e819f1..79f6d7458a04166e57b3d9df7cac893ed8a2981f 100644 --- a/tasks/0052_615_52615149_qa_2/task.toml +++ b/tasks/0052_615_52615149_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_615_52615149_qa_4/environment/bootstrap.sh b/tasks/0052_615_52615149_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_615_52615149_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_615_52615149_qa_4/environment/pull_bucket.py b/tasks/0052_615_52615149_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_615_52615149_qa_4/environment/pull_bucket.py +++ b/tasks/0052_615_52615149_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_615_52615149_qa_4/task.toml b/tasks/0052_615_52615149_qa_4/task.toml index 0b7da27db293abf2bcd0cdfb1c14b6881ee04cb4..00a1b0ae456c712daa5f6f46e6cd22a76b8bfbfd 100644 --- a/tasks/0052_615_52615149_qa_4/task.toml +++ b/tasks/0052_615_52615149_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_615_52615149_qa_5/environment/bootstrap.sh b/tasks/0052_615_52615149_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_615_52615149_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_615_52615149_qa_5/environment/pull_bucket.py b/tasks/0052_615_52615149_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_615_52615149_qa_5/environment/pull_bucket.py +++ b/tasks/0052_615_52615149_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_615_52615149_qa_5/task.toml b/tasks/0052_615_52615149_qa_5/task.toml index da596d7367fa4a28a67dbf917136dfc18625e049..41977fcadc902b20473c5cdf25af01c9df1a4351 100644 --- a/tasks/0052_615_52615149_qa_5/task.toml +++ b/tasks/0052_615_52615149_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_654_52654015_qa_1/environment/bootstrap.sh b/tasks/0052_654_52654015_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_654_52654015_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_654_52654015_qa_1/environment/pull_bucket.py b/tasks/0052_654_52654015_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_654_52654015_qa_1/environment/pull_bucket.py +++ b/tasks/0052_654_52654015_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_654_52654015_qa_1/task.toml b/tasks/0052_654_52654015_qa_1/task.toml index 9190663269a3a5e86add71cb66d3e75ca4082522..dca7fc42d812979d005e324ea2db6f4140ed60ca 100644 --- a/tasks/0052_654_52654015_qa_1/task.toml +++ b/tasks/0052_654_52654015_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_694_52694962_qa_3/environment/bootstrap.sh b/tasks/0052_694_52694962_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_694_52694962_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_694_52694962_qa_3/environment/pull_bucket.py b/tasks/0052_694_52694962_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_694_52694962_qa_3/environment/pull_bucket.py +++ b/tasks/0052_694_52694962_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_694_52694962_qa_3/task.toml b/tasks/0052_694_52694962_qa_3/task.toml index 5635893e1c79cba20c0c3f538bb30916a34faebb..8c6d47ee49b44e193718e26717ca0b70ae7fe17a 100644 --- a/tasks/0052_694_52694962_qa_3/task.toml +++ b/tasks/0052_694_52694962_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_694_52694962_qa_4/environment/bootstrap.sh b/tasks/0052_694_52694962_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_694_52694962_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_694_52694962_qa_4/environment/pull_bucket.py b/tasks/0052_694_52694962_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_694_52694962_qa_4/environment/pull_bucket.py +++ b/tasks/0052_694_52694962_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_694_52694962_qa_4/task.toml b/tasks/0052_694_52694962_qa_4/task.toml index 2e2af1dafdc6078edd2b63e4cabc9e5fd6f979d0..ef2b38519127e2abdb1c9815ce4591374a6a2796 100644 --- a/tasks/0052_694_52694962_qa_4/task.toml +++ b/tasks/0052_694_52694962_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_694_52694962_qa_5/environment/bootstrap.sh b/tasks/0052_694_52694962_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_694_52694962_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_694_52694962_qa_5/environment/pull_bucket.py b/tasks/0052_694_52694962_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_694_52694962_qa_5/environment/pull_bucket.py +++ b/tasks/0052_694_52694962_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_694_52694962_qa_5/task.toml b/tasks/0052_694_52694962_qa_5/task.toml index 93d1e483db5083f6ddf1fa26442ce0afa384af31..9d048e43f4f77eb8a5984e39a738cdc788291742 100644 --- a/tasks/0052_694_52694962_qa_5/task.toml +++ b/tasks/0052_694_52694962_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_712_52712705_qa_3/environment/bootstrap.sh b/tasks/0052_712_52712705_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_712_52712705_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_712_52712705_qa_3/environment/pull_bucket.py b/tasks/0052_712_52712705_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_712_52712705_qa_3/environment/pull_bucket.py +++ b/tasks/0052_712_52712705_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_712_52712705_qa_3/task.toml b/tasks/0052_712_52712705_qa_3/task.toml index 11bf6aeedcc16deb29e5a7ab0d989af88d77cb40..25f74179c52365d5318c6fb7f680d49012d88d8c 100644 --- a/tasks/0052_712_52712705_qa_3/task.toml +++ b/tasks/0052_712_52712705_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_801_52801383_qa_2/environment/bootstrap.sh b/tasks/0052_801_52801383_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_801_52801383_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_801_52801383_qa_2/environment/pull_bucket.py b/tasks/0052_801_52801383_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_801_52801383_qa_2/environment/pull_bucket.py +++ b/tasks/0052_801_52801383_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_801_52801383_qa_2/task.toml b/tasks/0052_801_52801383_qa_2/task.toml index 34a039121d5827a477bdbf0ed4ba743536003ec6..75769225999eff36c73320b8966ee145a8673bca 100644 --- a/tasks/0052_801_52801383_qa_2/task.toml +++ b/tasks/0052_801_52801383_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_801_52801383_qa_3/environment/bootstrap.sh b/tasks/0052_801_52801383_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_801_52801383_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_801_52801383_qa_3/environment/pull_bucket.py b/tasks/0052_801_52801383_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_801_52801383_qa_3/environment/pull_bucket.py +++ b/tasks/0052_801_52801383_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_801_52801383_qa_3/task.toml b/tasks/0052_801_52801383_qa_3/task.toml index 130e844759edbb1bda259b32c09123da202b193d..2757ae012456af0f6b62dd49a46b2430a1cc02b0 100644 --- a/tasks/0052_801_52801383_qa_3/task.toml +++ b/tasks/0052_801_52801383_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_814_52814699_qa_5/environment/bootstrap.sh b/tasks/0052_814_52814699_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_814_52814699_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_814_52814699_qa_5/environment/pull_bucket.py b/tasks/0052_814_52814699_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_814_52814699_qa_5/environment/pull_bucket.py +++ b/tasks/0052_814_52814699_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_814_52814699_qa_5/task.toml b/tasks/0052_814_52814699_qa_5/task.toml index 4c832cdf9930bf3c9b7d62b8d3091f935102c365..5322416dba4e7f7237cca62006da9af4f2d03896 100644 --- a/tasks/0052_814_52814699_qa_5/task.toml +++ b/tasks/0052_814_52814699_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_851_52851895_qa_4/environment/bootstrap.sh b/tasks/0052_851_52851895_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_851_52851895_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_851_52851895_qa_4/environment/pull_bucket.py b/tasks/0052_851_52851895_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_851_52851895_qa_4/environment/pull_bucket.py +++ b/tasks/0052_851_52851895_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_851_52851895_qa_4/task.toml b/tasks/0052_851_52851895_qa_4/task.toml index 9aec5e3f5da5df1c9d33033a685a942c080a262e..fbd12e78bc418dfaf1fa9b139aa2f81e501f0b2d 100644 --- a/tasks/0052_851_52851895_qa_4/task.toml +++ b/tasks/0052_851_52851895_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_868_52868101_qa_1/environment/bootstrap.sh b/tasks/0052_868_52868101_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_868_52868101_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_868_52868101_qa_1/environment/pull_bucket.py b/tasks/0052_868_52868101_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_868_52868101_qa_1/environment/pull_bucket.py +++ b/tasks/0052_868_52868101_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_868_52868101_qa_1/task.toml b/tasks/0052_868_52868101_qa_1/task.toml index 07150a1bddbbafe643607c34258f79f6093368e0..0fb964acf4b50a50a5d5da2fee27175b6674d036 100644 --- a/tasks/0052_868_52868101_qa_1/task.toml +++ b/tasks/0052_868_52868101_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_868_52868101_qa_4/environment/bootstrap.sh b/tasks/0052_868_52868101_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_868_52868101_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_868_52868101_qa_4/environment/pull_bucket.py b/tasks/0052_868_52868101_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_868_52868101_qa_4/environment/pull_bucket.py +++ b/tasks/0052_868_52868101_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_868_52868101_qa_4/task.toml b/tasks/0052_868_52868101_qa_4/task.toml index 55799632ad3509cab7158687eed0d94db232ae45..029c28427a38ed6e06d0bcab4094c0e2b307bc6d 100644 --- a/tasks/0052_868_52868101_qa_4/task.toml +++ b/tasks/0052_868_52868101_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_868_52868530_qa_4/environment/bootstrap.sh b/tasks/0052_868_52868530_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_868_52868530_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_868_52868530_qa_4/environment/pull_bucket.py b/tasks/0052_868_52868530_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_868_52868530_qa_4/environment/pull_bucket.py +++ b/tasks/0052_868_52868530_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_868_52868530_qa_4/task.toml b/tasks/0052_868_52868530_qa_4/task.toml index e47d2f58a08f31f1cdab9be78ab48a268e00396a..db2436c93183bee9ea9fccfd41ef320cf60f1ed0 100644 --- a/tasks/0052_868_52868530_qa_4/task.toml +++ b/tasks/0052_868_52868530_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_907_52907926_qa_4/environment/bootstrap.sh b/tasks/0052_907_52907926_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_907_52907926_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_907_52907926_qa_4/environment/pull_bucket.py b/tasks/0052_907_52907926_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_907_52907926_qa_4/environment/pull_bucket.py +++ b/tasks/0052_907_52907926_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_907_52907926_qa_4/task.toml b/tasks/0052_907_52907926_qa_4/task.toml index 0a68d0bc9c1a3bbd96db26e0e5d0472a46269312..58f1f82e681773b7ac39c7b760292e65efd59f1e 100644 --- a/tasks/0052_907_52907926_qa_4/task.toml +++ b/tasks/0052_907_52907926_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_947_52947271_qa_1/environment/bootstrap.sh b/tasks/0052_947_52947271_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_947_52947271_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_947_52947271_qa_1/environment/pull_bucket.py b/tasks/0052_947_52947271_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_947_52947271_qa_1/environment/pull_bucket.py +++ b/tasks/0052_947_52947271_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_947_52947271_qa_1/task.toml b/tasks/0052_947_52947271_qa_1/task.toml index 5f311460e8d27c0af65e063bd711dab1435cc82f..02927b460fdc2210c3f628079b5d876ca3275d8e 100644 --- a/tasks/0052_947_52947271_qa_1/task.toml +++ b/tasks/0052_947_52947271_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0052_980_52980235_qa_2/environment/bootstrap.sh b/tasks/0052_980_52980235_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0052_980_52980235_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0052_980_52980235_qa_2/environment/pull_bucket.py b/tasks/0052_980_52980235_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0052_980_52980235_qa_2/environment/pull_bucket.py +++ b/tasks/0052_980_52980235_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0052_980_52980235_qa_2/task.toml b/tasks/0052_980_52980235_qa_2/task.toml index 0900dcdb5082310f8f7607a50712bb8b427f298e..0b61b50b7741a6807c08c1677dcfcbd7ddad415d 100644 --- a/tasks/0052_980_52980235_qa_2/task.toml +++ b/tasks/0052_980_52980235_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_008_53008449_qa_4/environment/bootstrap.sh b/tasks/0053_008_53008449_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_008_53008449_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_008_53008449_qa_4/environment/pull_bucket.py b/tasks/0053_008_53008449_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_008_53008449_qa_4/environment/pull_bucket.py +++ b/tasks/0053_008_53008449_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_008_53008449_qa_4/task.toml b/tasks/0053_008_53008449_qa_4/task.toml index 3d7f53b19af915012e88910a9157c342b40cbcbc..e2bcb767fbcf54e89dea821e834a16242ce0135a 100644 --- a/tasks/0053_008_53008449_qa_4/task.toml +++ b/tasks/0053_008_53008449_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_024_53024023_qa_1/environment/bootstrap.sh b/tasks/0053_024_53024023_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_024_53024023_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_024_53024023_qa_1/environment/pull_bucket.py b/tasks/0053_024_53024023_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_024_53024023_qa_1/environment/pull_bucket.py +++ b/tasks/0053_024_53024023_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_024_53024023_qa_1/task.toml b/tasks/0053_024_53024023_qa_1/task.toml index b0a946a93e71e97948f8b2f21df2e805f64612b2..cb33cd62226798213571842971b140d460593be9 100644 --- a/tasks/0053_024_53024023_qa_1/task.toml +++ b/tasks/0053_024_53024023_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_036_53036765_qa_5/environment/bootstrap.sh b/tasks/0053_036_53036765_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_036_53036765_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_036_53036765_qa_5/environment/pull_bucket.py b/tasks/0053_036_53036765_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_036_53036765_qa_5/environment/pull_bucket.py +++ b/tasks/0053_036_53036765_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_036_53036765_qa_5/task.toml b/tasks/0053_036_53036765_qa_5/task.toml index dbd08ffa2cfc083582a5bb43ab4f0a86b4155a79..648643fe8931fa0672dd79e306ff25f64706b12e 100644 --- a/tasks/0053_036_53036765_qa_5/task.toml +++ b/tasks/0053_036_53036765_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_053_53053753_qa_4/environment/bootstrap.sh b/tasks/0053_053_53053753_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_053_53053753_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_053_53053753_qa_4/environment/pull_bucket.py b/tasks/0053_053_53053753_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_053_53053753_qa_4/environment/pull_bucket.py +++ b/tasks/0053_053_53053753_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_053_53053753_qa_4/task.toml b/tasks/0053_053_53053753_qa_4/task.toml index b91339e486e471501ec74cc9f84e1238a89f2981..1130ae18284798f3308421d6e3f3d674f3ab8eeb 100644 --- a/tasks/0053_053_53053753_qa_4/task.toml +++ b/tasks/0053_053_53053753_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_055_53055774_qa_1/environment/bootstrap.sh b/tasks/0053_055_53055774_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_055_53055774_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_055_53055774_qa_1/environment/pull_bucket.py b/tasks/0053_055_53055774_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_055_53055774_qa_1/environment/pull_bucket.py +++ b/tasks/0053_055_53055774_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_055_53055774_qa_1/task.toml b/tasks/0053_055_53055774_qa_1/task.toml index d16a967fddf6604bd476fc0a9e700c06a746ea0f..e71a15344af05199104815b0440e013f3e6ae5c8 100644 --- a/tasks/0053_055_53055774_qa_1/task.toml +++ b/tasks/0053_055_53055774_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_105_53105677_qa_2/environment/bootstrap.sh b/tasks/0053_105_53105677_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_105_53105677_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_105_53105677_qa_2/environment/pull_bucket.py b/tasks/0053_105_53105677_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_105_53105677_qa_2/environment/pull_bucket.py +++ b/tasks/0053_105_53105677_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_105_53105677_qa_2/task.toml b/tasks/0053_105_53105677_qa_2/task.toml index 875e7ea1f6d150af733f976a1ef2528c49002e07..cced0f33ce8a15b0321976f1499c55bf1d2ecdfd 100644 --- a/tasks/0053_105_53105677_qa_2/task.toml +++ b/tasks/0053_105_53105677_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_164_53164718_qa_3/environment/bootstrap.sh b/tasks/0053_164_53164718_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_164_53164718_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_164_53164718_qa_3/environment/pull_bucket.py b/tasks/0053_164_53164718_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_164_53164718_qa_3/environment/pull_bucket.py +++ b/tasks/0053_164_53164718_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_164_53164718_qa_3/task.toml b/tasks/0053_164_53164718_qa_3/task.toml index 20e0172a9687e4db05b5fbff5302877e67ae8607..b28300cee8267def90cb85d34a25cea2db09f496 100644 --- a/tasks/0053_164_53164718_qa_3/task.toml +++ b/tasks/0053_164_53164718_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_248_53248988_qa_3/environment/bootstrap.sh b/tasks/0053_248_53248988_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_248_53248988_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_248_53248988_qa_3/environment/pull_bucket.py b/tasks/0053_248_53248988_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_248_53248988_qa_3/environment/pull_bucket.py +++ b/tasks/0053_248_53248988_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_248_53248988_qa_3/task.toml b/tasks/0053_248_53248988_qa_3/task.toml index 16064fe05c0d841f2970838c6e9373a2fc84eb33..b85f01b761219b8374b3c04a971657171fb909ff 100644 --- a/tasks/0053_248_53248988_qa_3/task.toml +++ b/tasks/0053_248_53248988_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_271_53271024_qa_1/environment/bootstrap.sh b/tasks/0053_271_53271024_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_271_53271024_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_271_53271024_qa_1/environment/pull_bucket.py b/tasks/0053_271_53271024_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_271_53271024_qa_1/environment/pull_bucket.py +++ b/tasks/0053_271_53271024_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_271_53271024_qa_1/task.toml b/tasks/0053_271_53271024_qa_1/task.toml index 4fd14cfa2e4114460389eab29054f6254484be99..71d215c38e889bb2d26731edaeec604ecf9661d6 100644 --- a/tasks/0053_271_53271024_qa_1/task.toml +++ b/tasks/0053_271_53271024_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_271_53271024_qa_3/environment/bootstrap.sh b/tasks/0053_271_53271024_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_271_53271024_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_271_53271024_qa_3/environment/pull_bucket.py b/tasks/0053_271_53271024_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_271_53271024_qa_3/environment/pull_bucket.py +++ b/tasks/0053_271_53271024_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_271_53271024_qa_3/task.toml b/tasks/0053_271_53271024_qa_3/task.toml index 5c9c74566e78f468681720481d442188ab637731..e0c7391f3fa45079d784c3b1c2e8528632860e42 100644 --- a/tasks/0053_271_53271024_qa_3/task.toml +++ b/tasks/0053_271_53271024_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_295_53295093_qa_1/environment/bootstrap.sh b/tasks/0053_295_53295093_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_295_53295093_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_295_53295093_qa_1/environment/pull_bucket.py b/tasks/0053_295_53295093_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_295_53295093_qa_1/environment/pull_bucket.py +++ b/tasks/0053_295_53295093_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_295_53295093_qa_1/task.toml b/tasks/0053_295_53295093_qa_1/task.toml index b4978f20539a07bf9da38f8a0c3da26c6c0d4130..17977e62dd4c9d4039d516aa3547b820d9b5adb1 100644 --- a/tasks/0053_295_53295093_qa_1/task.toml +++ b/tasks/0053_295_53295093_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_322_53322838_qa_5/environment/bootstrap.sh b/tasks/0053_322_53322838_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_322_53322838_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_322_53322838_qa_5/environment/pull_bucket.py b/tasks/0053_322_53322838_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_322_53322838_qa_5/environment/pull_bucket.py +++ b/tasks/0053_322_53322838_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_322_53322838_qa_5/task.toml b/tasks/0053_322_53322838_qa_5/task.toml index c16ca7517f4f834bb14c32216d3858e68dfc32b2..8a4fda8d96dfbde1bc7a35b770254e78fa4027d3 100644 --- a/tasks/0053_322_53322838_qa_5/task.toml +++ b/tasks/0053_322_53322838_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_327_53327790_qa_3/environment/bootstrap.sh b/tasks/0053_327_53327790_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_327_53327790_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_327_53327790_qa_3/environment/pull_bucket.py b/tasks/0053_327_53327790_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_327_53327790_qa_3/environment/pull_bucket.py +++ b/tasks/0053_327_53327790_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_327_53327790_qa_3/task.toml b/tasks/0053_327_53327790_qa_3/task.toml index 423be9e7dc526492d9f2eee477983796eec11182..c4ef34a8472fb4f7e084c11a17d631b460a81683 100644 --- a/tasks/0053_327_53327790_qa_3/task.toml +++ b/tasks/0053_327_53327790_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_345_53345266_qa_3/environment/bootstrap.sh b/tasks/0053_345_53345266_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_345_53345266_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_345_53345266_qa_3/environment/pull_bucket.py b/tasks/0053_345_53345266_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_345_53345266_qa_3/environment/pull_bucket.py +++ b/tasks/0053_345_53345266_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_345_53345266_qa_3/task.toml b/tasks/0053_345_53345266_qa_3/task.toml index 01ece346b5ef1cd87ec4f4543a442d9615fa985d..caec702ed471de91d4485e8dfcfa973fee064c15 100644 --- a/tasks/0053_345_53345266_qa_3/task.toml +++ b/tasks/0053_345_53345266_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_352_53352624_qa_1/environment/bootstrap.sh b/tasks/0053_352_53352624_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_352_53352624_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_352_53352624_qa_1/environment/pull_bucket.py b/tasks/0053_352_53352624_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_352_53352624_qa_1/environment/pull_bucket.py +++ b/tasks/0053_352_53352624_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_352_53352624_qa_1/task.toml b/tasks/0053_352_53352624_qa_1/task.toml index 06596ca1958c5c3035ed7157abdd2e9c05be755c..70ff0bf33e7a2221e838d98da1062c3244d63a96 100644 --- a/tasks/0053_352_53352624_qa_1/task.toml +++ b/tasks/0053_352_53352624_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_354_53354710_qa_5/environment/bootstrap.sh b/tasks/0053_354_53354710_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_354_53354710_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_354_53354710_qa_5/environment/pull_bucket.py b/tasks/0053_354_53354710_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_354_53354710_qa_5/environment/pull_bucket.py +++ b/tasks/0053_354_53354710_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_354_53354710_qa_5/task.toml b/tasks/0053_354_53354710_qa_5/task.toml index b5640c95e0e171ac6f0a9560e05557cc2e91b1e3..5c50e5971270b892542a07465b2a21969f5df43d 100644 --- a/tasks/0053_354_53354710_qa_5/task.toml +++ b/tasks/0053_354_53354710_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_426_53426290_qa_3/environment/bootstrap.sh b/tasks/0053_426_53426290_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_426_53426290_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_426_53426290_qa_3/environment/pull_bucket.py b/tasks/0053_426_53426290_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_426_53426290_qa_3/environment/pull_bucket.py +++ b/tasks/0053_426_53426290_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_426_53426290_qa_3/task.toml b/tasks/0053_426_53426290_qa_3/task.toml index d56372bbf740c26ac16032085458246e9ce5c922..b0bbee23c9092231cf7952f449bb205313ddd3c6 100644 --- a/tasks/0053_426_53426290_qa_3/task.toml +++ b/tasks/0053_426_53426290_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_426_53426290_qa_5/environment/bootstrap.sh b/tasks/0053_426_53426290_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_426_53426290_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_426_53426290_qa_5/environment/pull_bucket.py b/tasks/0053_426_53426290_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_426_53426290_qa_5/environment/pull_bucket.py +++ b/tasks/0053_426_53426290_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_426_53426290_qa_5/task.toml b/tasks/0053_426_53426290_qa_5/task.toml index b8e4793bbd43370fa846d32e7c99396f620528b9..7c00989a2484f66a17fc919def2b74e1de828a4c 100644 --- a/tasks/0053_426_53426290_qa_5/task.toml +++ b/tasks/0053_426_53426290_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_427_53427570_qa_2/environment/bootstrap.sh b/tasks/0053_427_53427570_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_427_53427570_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_427_53427570_qa_2/environment/pull_bucket.py b/tasks/0053_427_53427570_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_427_53427570_qa_2/environment/pull_bucket.py +++ b/tasks/0053_427_53427570_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_427_53427570_qa_2/task.toml b/tasks/0053_427_53427570_qa_2/task.toml index 5c0ba662a813a173e5befd500228d619e3dfc45d..a058e01f81744254656d86f1268b41e295baddc4 100644 --- a/tasks/0053_427_53427570_qa_2/task.toml +++ b/tasks/0053_427_53427570_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_427_53427570_qa_3/environment/bootstrap.sh b/tasks/0053_427_53427570_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_427_53427570_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_427_53427570_qa_3/environment/pull_bucket.py b/tasks/0053_427_53427570_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_427_53427570_qa_3/environment/pull_bucket.py +++ b/tasks/0053_427_53427570_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_427_53427570_qa_3/task.toml b/tasks/0053_427_53427570_qa_3/task.toml index 09a026871bc405ab7385339f430989531760fca7..27404ab421142f57989c62201590bf18fcaa0de4 100644 --- a/tasks/0053_427_53427570_qa_3/task.toml +++ b/tasks/0053_427_53427570_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_427_53427570_qa_5/environment/bootstrap.sh b/tasks/0053_427_53427570_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_427_53427570_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_427_53427570_qa_5/environment/pull_bucket.py b/tasks/0053_427_53427570_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_427_53427570_qa_5/environment/pull_bucket.py +++ b/tasks/0053_427_53427570_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_427_53427570_qa_5/task.toml b/tasks/0053_427_53427570_qa_5/task.toml index 086a0f074d6658fae9ab19a711a7f5e682546402..2c0786dd0cb06bd530c473eab901b8ae3a3e0bae 100644 --- a/tasks/0053_427_53427570_qa_5/task.toml +++ b/tasks/0053_427_53427570_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_455_53455714_qa_3/environment/bootstrap.sh b/tasks/0053_455_53455714_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_455_53455714_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_455_53455714_qa_3/environment/pull_bucket.py b/tasks/0053_455_53455714_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_455_53455714_qa_3/environment/pull_bucket.py +++ b/tasks/0053_455_53455714_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_455_53455714_qa_3/task.toml b/tasks/0053_455_53455714_qa_3/task.toml index 8c7c997479bd08b836bf45daec9497a51ac8147c..98e393d7691b9988c80560ced12599929e9b2577 100644 --- a/tasks/0053_455_53455714_qa_3/task.toml +++ b/tasks/0053_455_53455714_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_603_53603838_qa_2/environment/bootstrap.sh b/tasks/0053_603_53603838_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_603_53603838_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_603_53603838_qa_2/environment/pull_bucket.py b/tasks/0053_603_53603838_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_603_53603838_qa_2/environment/pull_bucket.py +++ b/tasks/0053_603_53603838_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_603_53603838_qa_2/task.toml b/tasks/0053_603_53603838_qa_2/task.toml index f660003b36e13b29e88e7dd9335a7ef3c64b4c7c..b494e3ed4c4e03948b064aa54655c892633a5ff0 100644 --- a/tasks/0053_603_53603838_qa_2/task.toml +++ b/tasks/0053_603_53603838_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_603_53603838_qa_3/environment/bootstrap.sh b/tasks/0053_603_53603838_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_603_53603838_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_603_53603838_qa_3/environment/pull_bucket.py b/tasks/0053_603_53603838_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_603_53603838_qa_3/environment/pull_bucket.py +++ b/tasks/0053_603_53603838_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_603_53603838_qa_3/task.toml b/tasks/0053_603_53603838_qa_3/task.toml index 12c65c1063f337df23ad65972bfd4c38ca4fdd9b..5494f326b77bab39eb2e000cbbb8e516829ef94f 100644 --- a/tasks/0053_603_53603838_qa_3/task.toml +++ b/tasks/0053_603_53603838_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_612_53612964_qa_4/environment/bootstrap.sh b/tasks/0053_612_53612964_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_612_53612964_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_612_53612964_qa_4/environment/pull_bucket.py b/tasks/0053_612_53612964_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_612_53612964_qa_4/environment/pull_bucket.py +++ b/tasks/0053_612_53612964_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_612_53612964_qa_4/task.toml b/tasks/0053_612_53612964_qa_4/task.toml index 8f1f155e603ab13e885643de5bb6fc8e1f1f5bab..1a78140087622603d9bad0a15048f48cd7d69e83 100644 --- a/tasks/0053_612_53612964_qa_4/task.toml +++ b/tasks/0053_612_53612964_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_728_53728766_qa_3/environment/bootstrap.sh b/tasks/0053_728_53728766_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_728_53728766_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_728_53728766_qa_3/environment/pull_bucket.py b/tasks/0053_728_53728766_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_728_53728766_qa_3/environment/pull_bucket.py +++ b/tasks/0053_728_53728766_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_728_53728766_qa_3/task.toml b/tasks/0053_728_53728766_qa_3/task.toml index bd43770938b2f2678c7bc93ba5f895db131cccf1..4c85c4469a143a8c7ecc1ed932e98711c1f34462 100644 --- a/tasks/0053_728_53728766_qa_3/task.toml +++ b/tasks/0053_728_53728766_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_729_53729953_qa_4/environment/bootstrap.sh b/tasks/0053_729_53729953_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_729_53729953_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_729_53729953_qa_4/environment/pull_bucket.py b/tasks/0053_729_53729953_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_729_53729953_qa_4/environment/pull_bucket.py +++ b/tasks/0053_729_53729953_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_729_53729953_qa_4/task.toml b/tasks/0053_729_53729953_qa_4/task.toml index 6825c1c981d44e21bf7c31bf361214d46d4e72f4..aa6891dbaceafc3a05803030909e72f0c1122967 100644 --- a/tasks/0053_729_53729953_qa_4/task.toml +++ b/tasks/0053_729_53729953_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_757_53757406_qa_4/environment/bootstrap.sh b/tasks/0053_757_53757406_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_757_53757406_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_757_53757406_qa_4/environment/pull_bucket.py b/tasks/0053_757_53757406_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_757_53757406_qa_4/environment/pull_bucket.py +++ b/tasks/0053_757_53757406_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_757_53757406_qa_4/task.toml b/tasks/0053_757_53757406_qa_4/task.toml index a580e2f99f2fccb7fd9807838a95b5bd2886a0cc..f2aa4c310d4253dd43c3834a836a570fa7e5aae5 100644 --- a/tasks/0053_757_53757406_qa_4/task.toml +++ b/tasks/0053_757_53757406_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_768_53768671_qa_2/environment/bootstrap.sh b/tasks/0053_768_53768671_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_768_53768671_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_768_53768671_qa_2/environment/pull_bucket.py b/tasks/0053_768_53768671_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_768_53768671_qa_2/environment/pull_bucket.py +++ b/tasks/0053_768_53768671_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_768_53768671_qa_2/task.toml b/tasks/0053_768_53768671_qa_2/task.toml index c3e4f1221c4364384bea181a6a2dc08cbf4c0789..ce9dd5089d1e5769aa587ca7f3af24f51dbba195 100644 --- a/tasks/0053_768_53768671_qa_2/task.toml +++ b/tasks/0053_768_53768671_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_823_53823082_qa_2/environment/bootstrap.sh b/tasks/0053_823_53823082_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_823_53823082_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_823_53823082_qa_2/environment/pull_bucket.py b/tasks/0053_823_53823082_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_823_53823082_qa_2/environment/pull_bucket.py +++ b/tasks/0053_823_53823082_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_823_53823082_qa_2/task.toml b/tasks/0053_823_53823082_qa_2/task.toml index a9998bb81d093a2ef005a69616b9ca5596d4f75b..a7d23da5a992cf9e90f02126610e03413a79d9cc 100644 --- a/tasks/0053_823_53823082_qa_2/task.toml +++ b/tasks/0053_823_53823082_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_823_53823082_qa_3/environment/bootstrap.sh b/tasks/0053_823_53823082_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_823_53823082_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_823_53823082_qa_3/environment/pull_bucket.py b/tasks/0053_823_53823082_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_823_53823082_qa_3/environment/pull_bucket.py +++ b/tasks/0053_823_53823082_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_823_53823082_qa_3/task.toml b/tasks/0053_823_53823082_qa_3/task.toml index aead5776348eb5e1a4ffc7e863e8f0e606f84feb..cdf585869c43acfd0b804c93d57bb6d16bf54a91 100644 --- a/tasks/0053_823_53823082_qa_3/task.toml +++ b/tasks/0053_823_53823082_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_823_53823082_qa_4/environment/bootstrap.sh b/tasks/0053_823_53823082_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_823_53823082_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_823_53823082_qa_4/environment/pull_bucket.py b/tasks/0053_823_53823082_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_823_53823082_qa_4/environment/pull_bucket.py +++ b/tasks/0053_823_53823082_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_823_53823082_qa_4/task.toml b/tasks/0053_823_53823082_qa_4/task.toml index d3562389764492e4e75d37878cd0bb72c2c07657..6632741d5b1ac7f1e3f2f099355cb074fba22eed 100644 --- a/tasks/0053_823_53823082_qa_4/task.toml +++ b/tasks/0053_823_53823082_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_842_53842474_qa_2/environment/bootstrap.sh b/tasks/0053_842_53842474_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_842_53842474_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_842_53842474_qa_2/environment/pull_bucket.py b/tasks/0053_842_53842474_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_842_53842474_qa_2/environment/pull_bucket.py +++ b/tasks/0053_842_53842474_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_842_53842474_qa_2/task.toml b/tasks/0053_842_53842474_qa_2/task.toml index 165d27b3d205d4fd660812fd98e57ac5722dca9b..211f55467993f2313a868385efb684165c546bd7 100644 --- a/tasks/0053_842_53842474_qa_2/task.toml +++ b/tasks/0053_842_53842474_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_862_53862113_qa_1/environment/bootstrap.sh b/tasks/0053_862_53862113_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_862_53862113_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_862_53862113_qa_1/environment/pull_bucket.py b/tasks/0053_862_53862113_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_862_53862113_qa_1/environment/pull_bucket.py +++ b/tasks/0053_862_53862113_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_862_53862113_qa_1/task.toml b/tasks/0053_862_53862113_qa_1/task.toml index bdacef80a047d3cae12899c804f2faf006912f1b..5d0325db1bd586980e4862bced002fb52e129a7f 100644 --- a/tasks/0053_862_53862113_qa_1/task.toml +++ b/tasks/0053_862_53862113_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_862_53862113_qa_2/environment/bootstrap.sh b/tasks/0053_862_53862113_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_862_53862113_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_862_53862113_qa_2/environment/pull_bucket.py b/tasks/0053_862_53862113_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_862_53862113_qa_2/environment/pull_bucket.py +++ b/tasks/0053_862_53862113_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_862_53862113_qa_2/task.toml b/tasks/0053_862_53862113_qa_2/task.toml index 79843dd0a85dc70e5076596cf8f88c5c5b92a596..ff4654592106c8776ff1c561081b0bf06cbad976 100644 --- a/tasks/0053_862_53862113_qa_2/task.toml +++ b/tasks/0053_862_53862113_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_910_53910928_qa_5/environment/bootstrap.sh b/tasks/0053_910_53910928_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_910_53910928_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_910_53910928_qa_5/environment/pull_bucket.py b/tasks/0053_910_53910928_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_910_53910928_qa_5/environment/pull_bucket.py +++ b/tasks/0053_910_53910928_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_910_53910928_qa_5/task.toml b/tasks/0053_910_53910928_qa_5/task.toml index 4ef76003ef30aef9935b52c14db3914034a31b1b..222659a663ca699184809201ded21942440efc6a 100644 --- a/tasks/0053_910_53910928_qa_5/task.toml +++ b/tasks/0053_910_53910928_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_977_53977236_qa_2/environment/bootstrap.sh b/tasks/0053_977_53977236_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_977_53977236_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_977_53977236_qa_2/environment/pull_bucket.py b/tasks/0053_977_53977236_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_977_53977236_qa_2/environment/pull_bucket.py +++ b/tasks/0053_977_53977236_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_977_53977236_qa_2/task.toml b/tasks/0053_977_53977236_qa_2/task.toml index f0704165a54e9f35f4ec6c4c872c05ffeacfd584..62c18635b301afadb2a8df18ae6f3b1b8a9128c5 100644 --- a/tasks/0053_977_53977236_qa_2/task.toml +++ b/tasks/0053_977_53977236_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_977_53977236_qa_3/environment/bootstrap.sh b/tasks/0053_977_53977236_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_977_53977236_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_977_53977236_qa_3/environment/pull_bucket.py b/tasks/0053_977_53977236_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_977_53977236_qa_3/environment/pull_bucket.py +++ b/tasks/0053_977_53977236_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_977_53977236_qa_3/task.toml b/tasks/0053_977_53977236_qa_3/task.toml index c6ff758e9c78bea3235bff0502ccbba33bacb0c2..a7d14784425efb45a9260c5cc778739b9324d364 100644 --- a/tasks/0053_977_53977236_qa_3/task.toml +++ b/tasks/0053_977_53977236_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_977_53977236_qa_4/environment/bootstrap.sh b/tasks/0053_977_53977236_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_977_53977236_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_977_53977236_qa_4/environment/pull_bucket.py b/tasks/0053_977_53977236_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_977_53977236_qa_4/environment/pull_bucket.py +++ b/tasks/0053_977_53977236_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_977_53977236_qa_4/task.toml b/tasks/0053_977_53977236_qa_4/task.toml index 5b145902dee91726eb7d36405e72c2c3f4787ee6..41e59217610337bd2c3ea138f3fd8def4f8b567c 100644 --- a/tasks/0053_977_53977236_qa_4/task.toml +++ b/tasks/0053_977_53977236_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_977_53977236_qa_5/environment/bootstrap.sh b/tasks/0053_977_53977236_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_977_53977236_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_977_53977236_qa_5/environment/pull_bucket.py b/tasks/0053_977_53977236_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_977_53977236_qa_5/environment/pull_bucket.py +++ b/tasks/0053_977_53977236_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_977_53977236_qa_5/task.toml b/tasks/0053_977_53977236_qa_5/task.toml index b1faeb03c4c9e73c6e91d0f48427aeb232cd1bf1..07867e1883f3883739b81231e0c710c90b7cebd8 100644 --- a/tasks/0053_977_53977236_qa_5/task.toml +++ b/tasks/0053_977_53977236_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_995_53995551_qa_1/environment/bootstrap.sh b/tasks/0053_995_53995551_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_995_53995551_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_995_53995551_qa_1/environment/pull_bucket.py b/tasks/0053_995_53995551_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_995_53995551_qa_1/environment/pull_bucket.py +++ b/tasks/0053_995_53995551_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_995_53995551_qa_1/task.toml b/tasks/0053_995_53995551_qa_1/task.toml index 6570337f51cbfaa8973d2ad5c012869ed1701429..4292bd4c656b2a87ba3a516212abe11098b9812e 100644 --- a/tasks/0053_995_53995551_qa_1/task.toml +++ b/tasks/0053_995_53995551_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_995_53995551_qa_3/environment/bootstrap.sh b/tasks/0053_995_53995551_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_995_53995551_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_995_53995551_qa_3/environment/pull_bucket.py b/tasks/0053_995_53995551_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_995_53995551_qa_3/environment/pull_bucket.py +++ b/tasks/0053_995_53995551_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_995_53995551_qa_3/task.toml b/tasks/0053_995_53995551_qa_3/task.toml index 21d301031e213b07e1a5e269607d696ec79e06f9..f9c11b20b41cb9199d8a18bcad53dddc54a86091 100644 --- a/tasks/0053_995_53995551_qa_3/task.toml +++ b/tasks/0053_995_53995551_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0053_995_53995551_qa_5/environment/bootstrap.sh b/tasks/0053_995_53995551_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0053_995_53995551_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0053_995_53995551_qa_5/environment/pull_bucket.py b/tasks/0053_995_53995551_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0053_995_53995551_qa_5/environment/pull_bucket.py +++ b/tasks/0053_995_53995551_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0053_995_53995551_qa_5/task.toml b/tasks/0053_995_53995551_qa_5/task.toml index 9761c1651f4e75b1555d151fe394ca89bf864737..01e46458d73e725d3340da16d81d3998b88ebcd3 100644 --- a/tasks/0053_995_53995551_qa_5/task.toml +++ b/tasks/0053_995_53995551_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_009_54009128_qa_3/environment/bootstrap.sh b/tasks/0054_009_54009128_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_009_54009128_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_009_54009128_qa_3/environment/pull_bucket.py b/tasks/0054_009_54009128_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_009_54009128_qa_3/environment/pull_bucket.py +++ b/tasks/0054_009_54009128_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_009_54009128_qa_3/task.toml b/tasks/0054_009_54009128_qa_3/task.toml index d2a048665bc2a6f6d8f895aa3d39206ab0a69d36..98bfb1a56da6b943a1d0d53b1f8a15e241eaf3f8 100644 --- a/tasks/0054_009_54009128_qa_3/task.toml +++ b/tasks/0054_009_54009128_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_030_54030075_qa_5/environment/bootstrap.sh b/tasks/0054_030_54030075_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_030_54030075_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_030_54030075_qa_5/environment/pull_bucket.py b/tasks/0054_030_54030075_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_030_54030075_qa_5/environment/pull_bucket.py +++ b/tasks/0054_030_54030075_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_030_54030075_qa_5/task.toml b/tasks/0054_030_54030075_qa_5/task.toml index 2b0d633908787f7c2b76e6ae4bc59e956d91a762..a15ed192356128ff0dad5292da6c1dc35d397b3d 100644 --- a/tasks/0054_030_54030075_qa_5/task.toml +++ b/tasks/0054_030_54030075_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_048_54048707_qa_3/environment/bootstrap.sh b/tasks/0054_048_54048707_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_048_54048707_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_048_54048707_qa_3/environment/pull_bucket.py b/tasks/0054_048_54048707_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_048_54048707_qa_3/environment/pull_bucket.py +++ b/tasks/0054_048_54048707_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_048_54048707_qa_3/task.toml b/tasks/0054_048_54048707_qa_3/task.toml index b55b8e84bcfebe2215b97c654c02b48dd1556114..3ce808987f422d250ed89430266f86e5430e30d3 100644 --- a/tasks/0054_048_54048707_qa_3/task.toml +++ b/tasks/0054_048_54048707_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_065_54065855_qa_5/environment/bootstrap.sh b/tasks/0054_065_54065855_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_065_54065855_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_065_54065855_qa_5/environment/pull_bucket.py b/tasks/0054_065_54065855_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_065_54065855_qa_5/environment/pull_bucket.py +++ b/tasks/0054_065_54065855_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_065_54065855_qa_5/task.toml b/tasks/0054_065_54065855_qa_5/task.toml index e315d3f402f5838a6f17276a80787e927c077099..d38ca70324ca72d87a341fd759a3c3a45a43f43d 100644 --- a/tasks/0054_065_54065855_qa_5/task.toml +++ b/tasks/0054_065_54065855_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_137_54137484_qa_1/environment/bootstrap.sh b/tasks/0054_137_54137484_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_137_54137484_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_137_54137484_qa_1/environment/pull_bucket.py b/tasks/0054_137_54137484_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_137_54137484_qa_1/environment/pull_bucket.py +++ b/tasks/0054_137_54137484_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_137_54137484_qa_1/task.toml b/tasks/0054_137_54137484_qa_1/task.toml index 8165e87dd098bbbfa2bcf7cd7a0fac8d332a5b14..03b0fcebbe1551022374f3331efceb8dda0d4d23 100644 --- a/tasks/0054_137_54137484_qa_1/task.toml +++ b/tasks/0054_137_54137484_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_170_54170809_qa_3/environment/bootstrap.sh b/tasks/0054_170_54170809_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_170_54170809_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_170_54170809_qa_3/environment/pull_bucket.py b/tasks/0054_170_54170809_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_170_54170809_qa_3/environment/pull_bucket.py +++ b/tasks/0054_170_54170809_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_170_54170809_qa_3/task.toml b/tasks/0054_170_54170809_qa_3/task.toml index cf04321ece0d52197818106c9ba20e28afb7438c..0f447d66db1919fd4123f876517da2673ca669ec 100644 --- a/tasks/0054_170_54170809_qa_3/task.toml +++ b/tasks/0054_170_54170809_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_240_54240595_qa_2/environment/bootstrap.sh b/tasks/0054_240_54240595_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_240_54240595_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_240_54240595_qa_2/environment/pull_bucket.py b/tasks/0054_240_54240595_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_240_54240595_qa_2/environment/pull_bucket.py +++ b/tasks/0054_240_54240595_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_240_54240595_qa_2/task.toml b/tasks/0054_240_54240595_qa_2/task.toml index 477a117081fb0ff8ef1420c2e83eb12aba438507..2b1e1331728a80dad492a0ee4b4f0f60def3097c 100644 --- a/tasks/0054_240_54240595_qa_2/task.toml +++ b/tasks/0054_240_54240595_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_256_54256432_qa_2/environment/bootstrap.sh b/tasks/0054_256_54256432_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_256_54256432_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_256_54256432_qa_2/environment/pull_bucket.py b/tasks/0054_256_54256432_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_256_54256432_qa_2/environment/pull_bucket.py +++ b/tasks/0054_256_54256432_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_256_54256432_qa_2/task.toml b/tasks/0054_256_54256432_qa_2/task.toml index 79c64e9b8e1e3e51ff89aff833e5021b1bdded28..6b7bf6535d0c9676c70ca479a7d5a9d64a42481b 100644 --- a/tasks/0054_256_54256432_qa_2/task.toml +++ b/tasks/0054_256_54256432_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_256_54256432_qa_3/environment/bootstrap.sh b/tasks/0054_256_54256432_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_256_54256432_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_256_54256432_qa_3/environment/pull_bucket.py b/tasks/0054_256_54256432_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_256_54256432_qa_3/environment/pull_bucket.py +++ b/tasks/0054_256_54256432_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_256_54256432_qa_3/task.toml b/tasks/0054_256_54256432_qa_3/task.toml index c13d31d3a34a0e8c19a7bc9042fd5391073b77bb..50d8e2983b0f9d901e732fe86101caa9794d3390 100644 --- a/tasks/0054_256_54256432_qa_3/task.toml +++ b/tasks/0054_256_54256432_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_266_54266894_qa_3/environment/bootstrap.sh b/tasks/0054_266_54266894_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_266_54266894_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_266_54266894_qa_3/environment/pull_bucket.py b/tasks/0054_266_54266894_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_266_54266894_qa_3/environment/pull_bucket.py +++ b/tasks/0054_266_54266894_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_266_54266894_qa_3/task.toml b/tasks/0054_266_54266894_qa_3/task.toml index b5cbd005cbf22299f0a6a48715136886c7c62294..e27d12bffeada4effa10e3919df3a76d8006300d 100644 --- a/tasks/0054_266_54266894_qa_3/task.toml +++ b/tasks/0054_266_54266894_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_269_54269608_qa_3/environment/bootstrap.sh b/tasks/0054_269_54269608_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_269_54269608_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_269_54269608_qa_3/environment/pull_bucket.py b/tasks/0054_269_54269608_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_269_54269608_qa_3/environment/pull_bucket.py +++ b/tasks/0054_269_54269608_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_269_54269608_qa_3/task.toml b/tasks/0054_269_54269608_qa_3/task.toml index 99df52eb0142b0281419106b09a5c1395b0ec6bd..94fc08da4a87950a2d2e1a178237d2cfdcca9ba0 100644 --- a/tasks/0054_269_54269608_qa_3/task.toml +++ b/tasks/0054_269_54269608_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_291_54291213_qa_2/environment/bootstrap.sh b/tasks/0054_291_54291213_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_291_54291213_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_291_54291213_qa_2/environment/pull_bucket.py b/tasks/0054_291_54291213_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_291_54291213_qa_2/environment/pull_bucket.py +++ b/tasks/0054_291_54291213_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_291_54291213_qa_2/task.toml b/tasks/0054_291_54291213_qa_2/task.toml index 8fc9b5f5fe76c7b8431c2597d3525681e63abf50..f1cd99f28dbccf4012f66734e921caf87dd66906 100644 --- a/tasks/0054_291_54291213_qa_2/task.toml +++ b/tasks/0054_291_54291213_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_291_54291213_qa_5/environment/bootstrap.sh b/tasks/0054_291_54291213_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_291_54291213_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_291_54291213_qa_5/environment/pull_bucket.py b/tasks/0054_291_54291213_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_291_54291213_qa_5/environment/pull_bucket.py +++ b/tasks/0054_291_54291213_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_291_54291213_qa_5/task.toml b/tasks/0054_291_54291213_qa_5/task.toml index e1c9cfa5f5d23e8f0cb1280ae417970227efd2cd..18f0590447ee4603629ca0ec38aacf687819e551 100644 --- a/tasks/0054_291_54291213_qa_5/task.toml +++ b/tasks/0054_291_54291213_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_296_54296946_qa_1/environment/bootstrap.sh b/tasks/0054_296_54296946_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_296_54296946_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_296_54296946_qa_1/environment/pull_bucket.py b/tasks/0054_296_54296946_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_296_54296946_qa_1/environment/pull_bucket.py +++ b/tasks/0054_296_54296946_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_296_54296946_qa_1/task.toml b/tasks/0054_296_54296946_qa_1/task.toml index 6d03f21f154145e1b9e94ad21c82026f11516530..1b57ec60654546150b5b9d702125ac8f4c7e1d8b 100644 --- a/tasks/0054_296_54296946_qa_1/task.toml +++ b/tasks/0054_296_54296946_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_298_54298783_qa_3/environment/bootstrap.sh b/tasks/0054_298_54298783_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_298_54298783_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_298_54298783_qa_3/environment/pull_bucket.py b/tasks/0054_298_54298783_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_298_54298783_qa_3/environment/pull_bucket.py +++ b/tasks/0054_298_54298783_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_298_54298783_qa_3/task.toml b/tasks/0054_298_54298783_qa_3/task.toml index 9192d907d077fb5c3310d7c6af5309630f02175a..7a768c745d65f119ee6a6f5db5552e35f464fe65 100644 --- a/tasks/0054_298_54298783_qa_3/task.toml +++ b/tasks/0054_298_54298783_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_315_54315694_qa_1/environment/bootstrap.sh b/tasks/0054_315_54315694_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_315_54315694_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_315_54315694_qa_1/environment/pull_bucket.py b/tasks/0054_315_54315694_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_315_54315694_qa_1/environment/pull_bucket.py +++ b/tasks/0054_315_54315694_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_315_54315694_qa_1/task.toml b/tasks/0054_315_54315694_qa_1/task.toml index 53238afa8024f2701c47d04cf4d78f0e5046284b..6a388d16003e91673830d6e7be1876aefab12c03 100644 --- a/tasks/0054_315_54315694_qa_1/task.toml +++ b/tasks/0054_315_54315694_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_315_54315694_qa_2/environment/bootstrap.sh b/tasks/0054_315_54315694_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_315_54315694_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_315_54315694_qa_2/environment/pull_bucket.py b/tasks/0054_315_54315694_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_315_54315694_qa_2/environment/pull_bucket.py +++ b/tasks/0054_315_54315694_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_315_54315694_qa_2/task.toml b/tasks/0054_315_54315694_qa_2/task.toml index 325c3258830ed77bc0f44cf9843137511f53fc0c..29e406be235cdf26628dcba87cc7c89a25264115 100644 --- a/tasks/0054_315_54315694_qa_2/task.toml +++ b/tasks/0054_315_54315694_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_315_54315694_qa_4/environment/bootstrap.sh b/tasks/0054_315_54315694_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_315_54315694_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_315_54315694_qa_4/environment/pull_bucket.py b/tasks/0054_315_54315694_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_315_54315694_qa_4/environment/pull_bucket.py +++ b/tasks/0054_315_54315694_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_315_54315694_qa_4/task.toml b/tasks/0054_315_54315694_qa_4/task.toml index 1f4117e15d8c1b26319c923450974e6f91c3de0c..9b312f1058562e0cce51e35ef5eb93ba5de63b48 100644 --- a/tasks/0054_315_54315694_qa_4/task.toml +++ b/tasks/0054_315_54315694_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_375_54375499_qa_3/environment/bootstrap.sh b/tasks/0054_375_54375499_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_375_54375499_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_375_54375499_qa_3/environment/pull_bucket.py b/tasks/0054_375_54375499_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_375_54375499_qa_3/environment/pull_bucket.py +++ b/tasks/0054_375_54375499_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_375_54375499_qa_3/task.toml b/tasks/0054_375_54375499_qa_3/task.toml index cbbe34dd24d938992513e826e823f348176cd7d1..bc8c3919646ddc44f7dbbf281f4d8c18e8a1b70f 100644 --- a/tasks/0054_375_54375499_qa_3/task.toml +++ b/tasks/0054_375_54375499_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_375_54375499_qa_5/environment/bootstrap.sh b/tasks/0054_375_54375499_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_375_54375499_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_375_54375499_qa_5/environment/pull_bucket.py b/tasks/0054_375_54375499_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_375_54375499_qa_5/environment/pull_bucket.py +++ b/tasks/0054_375_54375499_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_375_54375499_qa_5/task.toml b/tasks/0054_375_54375499_qa_5/task.toml index 59d1b16a16fd510c21dc09bca1e2f1fc04f39627..edef7f7b27271dfc8451514fd4f9f811639f76c1 100644 --- a/tasks/0054_375_54375499_qa_5/task.toml +++ b/tasks/0054_375_54375499_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_473_54473359_qa_2/environment/bootstrap.sh b/tasks/0054_473_54473359_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_473_54473359_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_473_54473359_qa_2/environment/pull_bucket.py b/tasks/0054_473_54473359_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_473_54473359_qa_2/environment/pull_bucket.py +++ b/tasks/0054_473_54473359_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_473_54473359_qa_2/task.toml b/tasks/0054_473_54473359_qa_2/task.toml index ab63c2cded0b03222d0ec32f078284cede107073..f019f7e152820ec551727b8e3d0656cfa24b2d88 100644 --- a/tasks/0054_473_54473359_qa_2/task.toml +++ b/tasks/0054_473_54473359_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_473_54473359_qa_4/environment/bootstrap.sh b/tasks/0054_473_54473359_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_473_54473359_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_473_54473359_qa_4/environment/pull_bucket.py b/tasks/0054_473_54473359_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_473_54473359_qa_4/environment/pull_bucket.py +++ b/tasks/0054_473_54473359_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_473_54473359_qa_4/task.toml b/tasks/0054_473_54473359_qa_4/task.toml index d1ed885f9f14fc48a47d2313462c8009d4f209e9..06aeba982d066904f66130ad790ae530b65ea587 100644 --- a/tasks/0054_473_54473359_qa_4/task.toml +++ b/tasks/0054_473_54473359_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_514_54514604_qa_1/environment/bootstrap.sh b/tasks/0054_514_54514604_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_514_54514604_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_514_54514604_qa_1/environment/pull_bucket.py b/tasks/0054_514_54514604_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_514_54514604_qa_1/environment/pull_bucket.py +++ b/tasks/0054_514_54514604_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_514_54514604_qa_1/task.toml b/tasks/0054_514_54514604_qa_1/task.toml index 9801894df4a679abdd913674e87189393ace6e83..bcb3cc4e4965cc7dc2c2a8c394ee66a56cbd3749 100644 --- a/tasks/0054_514_54514604_qa_1/task.toml +++ b/tasks/0054_514_54514604_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_541_54541486_qa_1/environment/bootstrap.sh b/tasks/0054_541_54541486_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_541_54541486_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_541_54541486_qa_1/environment/pull_bucket.py b/tasks/0054_541_54541486_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_541_54541486_qa_1/environment/pull_bucket.py +++ b/tasks/0054_541_54541486_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_541_54541486_qa_1/task.toml b/tasks/0054_541_54541486_qa_1/task.toml index ef879fcecb0bfaa7a59b67995fa284f4785161c6..e8e3a79edf513cb8cf6c5e6ea8e9bf436194edba 100644 --- a/tasks/0054_541_54541486_qa_1/task.toml +++ b/tasks/0054_541_54541486_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_555_54555681_qa_4/environment/bootstrap.sh b/tasks/0054_555_54555681_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_555_54555681_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_555_54555681_qa_4/environment/pull_bucket.py b/tasks/0054_555_54555681_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_555_54555681_qa_4/environment/pull_bucket.py +++ b/tasks/0054_555_54555681_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_555_54555681_qa_4/task.toml b/tasks/0054_555_54555681_qa_4/task.toml index dd215c8cfeeb090fd2954e9c7626012f18024791..29b102c6a671174c42a65d1dbf8164f74106c54d 100644 --- a/tasks/0054_555_54555681_qa_4/task.toml +++ b/tasks/0054_555_54555681_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_589_54589195_qa_3/environment/bootstrap.sh b/tasks/0054_589_54589195_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_589_54589195_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_589_54589195_qa_3/environment/pull_bucket.py b/tasks/0054_589_54589195_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_589_54589195_qa_3/environment/pull_bucket.py +++ b/tasks/0054_589_54589195_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_589_54589195_qa_3/task.toml b/tasks/0054_589_54589195_qa_3/task.toml index bdb90be5d6ebe472f6a9def8626136bd55f27a65..24bbadfe3b6e7ce3e86c2c0c99f06bba1b50133b 100644 --- a/tasks/0054_589_54589195_qa_3/task.toml +++ b/tasks/0054_589_54589195_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_670_54670437_qa_4/environment/bootstrap.sh b/tasks/0054_670_54670437_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_670_54670437_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_670_54670437_qa_4/environment/pull_bucket.py b/tasks/0054_670_54670437_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_670_54670437_qa_4/environment/pull_bucket.py +++ b/tasks/0054_670_54670437_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_670_54670437_qa_4/task.toml b/tasks/0054_670_54670437_qa_4/task.toml index c1aba9c1b7f4deca41c39521c7026253aac66211..a92e00a2cc8f48b215c6162d86ce3737b4c6c25a 100644 --- a/tasks/0054_670_54670437_qa_4/task.toml +++ b/tasks/0054_670_54670437_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_670_54670437_qa_5/environment/bootstrap.sh b/tasks/0054_670_54670437_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_670_54670437_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_670_54670437_qa_5/environment/pull_bucket.py b/tasks/0054_670_54670437_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_670_54670437_qa_5/environment/pull_bucket.py +++ b/tasks/0054_670_54670437_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_670_54670437_qa_5/task.toml b/tasks/0054_670_54670437_qa_5/task.toml index 9cc8acf57df6a944ebf99611733cb15301e75ee4..ddc9da7afc3bbfeb9f9c1c4403d5a8e020c0b306 100644 --- a/tasks/0054_670_54670437_qa_5/task.toml +++ b/tasks/0054_670_54670437_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_705_54705588_qa_1/environment/bootstrap.sh b/tasks/0054_705_54705588_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_705_54705588_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_705_54705588_qa_1/environment/pull_bucket.py b/tasks/0054_705_54705588_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_705_54705588_qa_1/environment/pull_bucket.py +++ b/tasks/0054_705_54705588_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_705_54705588_qa_1/task.toml b/tasks/0054_705_54705588_qa_1/task.toml index 7569da5fc2fd5259af7c329158dc04c3f2d33038..e4eab08dad5699a9f709fd38c335e1f67b0a37f1 100644 --- a/tasks/0054_705_54705588_qa_1/task.toml +++ b/tasks/0054_705_54705588_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_705_54705588_qa_3/environment/bootstrap.sh b/tasks/0054_705_54705588_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_705_54705588_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_705_54705588_qa_3/environment/pull_bucket.py b/tasks/0054_705_54705588_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_705_54705588_qa_3/environment/pull_bucket.py +++ b/tasks/0054_705_54705588_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_705_54705588_qa_3/task.toml b/tasks/0054_705_54705588_qa_3/task.toml index 54d7e60d8a4e30f9993d29282f4455ab6359422e..02b63a060e0b571fcf56b5e215724d0e2f49675a 100644 --- a/tasks/0054_705_54705588_qa_3/task.toml +++ b/tasks/0054_705_54705588_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_739_54739768_qa_1/environment/bootstrap.sh b/tasks/0054_739_54739768_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_739_54739768_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_739_54739768_qa_1/environment/pull_bucket.py b/tasks/0054_739_54739768_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_739_54739768_qa_1/environment/pull_bucket.py +++ b/tasks/0054_739_54739768_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_739_54739768_qa_1/task.toml b/tasks/0054_739_54739768_qa_1/task.toml index bd4b481de59fd094a74c77ca391fe8b626453d22..c2fe78a83c07d190fd72541a36cd111fef8f9c73 100644 --- a/tasks/0054_739_54739768_qa_1/task.toml +++ b/tasks/0054_739_54739768_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_748_54748769_qa_2/environment/bootstrap.sh b/tasks/0054_748_54748769_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_748_54748769_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_748_54748769_qa_2/environment/pull_bucket.py b/tasks/0054_748_54748769_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_748_54748769_qa_2/environment/pull_bucket.py +++ b/tasks/0054_748_54748769_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_748_54748769_qa_2/task.toml b/tasks/0054_748_54748769_qa_2/task.toml index 0fa7567e4308aca6831f6639208daa0b28933df7..7761db35b759da31f73b26d4ef04e5de511db145 100644 --- a/tasks/0054_748_54748769_qa_2/task.toml +++ b/tasks/0054_748_54748769_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_801_54801630_qa_2/environment/bootstrap.sh b/tasks/0054_801_54801630_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_801_54801630_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_801_54801630_qa_2/environment/pull_bucket.py b/tasks/0054_801_54801630_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_801_54801630_qa_2/environment/pull_bucket.py +++ b/tasks/0054_801_54801630_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_801_54801630_qa_2/task.toml b/tasks/0054_801_54801630_qa_2/task.toml index 2e6cfc57ac8b4c35da3f832a826adf3b132e6693..26efe63efc788d9d4cd03c1a80bc4d8c3adb9e07 100644 --- a/tasks/0054_801_54801630_qa_2/task.toml +++ b/tasks/0054_801_54801630_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_919_54919794_qa_1/environment/bootstrap.sh b/tasks/0054_919_54919794_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_919_54919794_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_919_54919794_qa_1/environment/pull_bucket.py b/tasks/0054_919_54919794_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_919_54919794_qa_1/environment/pull_bucket.py +++ b/tasks/0054_919_54919794_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_919_54919794_qa_1/task.toml b/tasks/0054_919_54919794_qa_1/task.toml index 7f92e0bc26809eb8fc2c66b1e946184f9c996989..961d149bf149a3988f67fcc8f68ac94bce7cc91c 100644 --- a/tasks/0054_919_54919794_qa_1/task.toml +++ b/tasks/0054_919_54919794_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_928_54928271_qa_2/environment/bootstrap.sh b/tasks/0054_928_54928271_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_928_54928271_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_928_54928271_qa_2/environment/pull_bucket.py b/tasks/0054_928_54928271_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_928_54928271_qa_2/environment/pull_bucket.py +++ b/tasks/0054_928_54928271_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_928_54928271_qa_2/task.toml b/tasks/0054_928_54928271_qa_2/task.toml index 2002944877b6416ba101c0c09aa9200a07fba6f0..33fd12f66db113d42f4c4c58195ed5669ae32757 100644 --- a/tasks/0054_928_54928271_qa_2/task.toml +++ b/tasks/0054_928_54928271_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_957_54957845_qa_1/environment/bootstrap.sh b/tasks/0054_957_54957845_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_957_54957845_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_957_54957845_qa_1/environment/pull_bucket.py b/tasks/0054_957_54957845_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_957_54957845_qa_1/environment/pull_bucket.py +++ b/tasks/0054_957_54957845_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_957_54957845_qa_1/task.toml b/tasks/0054_957_54957845_qa_1/task.toml index 28a51af73b017f8cc8126aa29d0c3356f28503ea..35c763810520c1e18055df5d394202ff7a0cb891 100644 --- a/tasks/0054_957_54957845_qa_1/task.toml +++ b/tasks/0054_957_54957845_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_972_54972872_qa_4/environment/bootstrap.sh b/tasks/0054_972_54972872_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_972_54972872_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_972_54972872_qa_4/environment/pull_bucket.py b/tasks/0054_972_54972872_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_972_54972872_qa_4/environment/pull_bucket.py +++ b/tasks/0054_972_54972872_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_972_54972872_qa_4/task.toml b/tasks/0054_972_54972872_qa_4/task.toml index 5a25a83869408715d7e62cbeb69b2f4683bdb341..ce7006191e3d20575f4b2903cd84fcad7f66b137 100644 --- a/tasks/0054_972_54972872_qa_4/task.toml +++ b/tasks/0054_972_54972872_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_972_54972872_qa_5/environment/bootstrap.sh b/tasks/0054_972_54972872_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_972_54972872_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_972_54972872_qa_5/environment/pull_bucket.py b/tasks/0054_972_54972872_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_972_54972872_qa_5/environment/pull_bucket.py +++ b/tasks/0054_972_54972872_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_972_54972872_qa_5/task.toml b/tasks/0054_972_54972872_qa_5/task.toml index e1346a57975b6a0916775612c32d17b8149b42b9..94592d08d56a8e2fa46e4780f9a2257c2b64673a 100644 --- a/tasks/0054_972_54972872_qa_5/task.toml +++ b/tasks/0054_972_54972872_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0054_988_54988859_qa_1/environment/bootstrap.sh b/tasks/0054_988_54988859_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0054_988_54988859_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0054_988_54988859_qa_1/environment/pull_bucket.py b/tasks/0054_988_54988859_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0054_988_54988859_qa_1/environment/pull_bucket.py +++ b/tasks/0054_988_54988859_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0054_988_54988859_qa_1/task.toml b/tasks/0054_988_54988859_qa_1/task.toml index f838cece9958d057cec8732f9e439b0c70ae3067..4d8da137d31e4972d2ed77f129cee5cd9ff47b69 100644 --- a/tasks/0054_988_54988859_qa_1/task.toml +++ b/tasks/0054_988_54988859_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_004_55004083_qa_4/environment/bootstrap.sh b/tasks/0055_004_55004083_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_004_55004083_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_004_55004083_qa_4/environment/pull_bucket.py b/tasks/0055_004_55004083_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_004_55004083_qa_4/environment/pull_bucket.py +++ b/tasks/0055_004_55004083_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_004_55004083_qa_4/task.toml b/tasks/0055_004_55004083_qa_4/task.toml index c120fd82319b4737b2461dae5645bad5c0d1e2f9..61ae2c0ccb9320ec4b4df1feade9e103440c0f61 100644 --- a/tasks/0055_004_55004083_qa_4/task.toml +++ b/tasks/0055_004_55004083_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_023_55023608_qa_1/environment/bootstrap.sh b/tasks/0055_023_55023608_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_023_55023608_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_023_55023608_qa_1/environment/pull_bucket.py b/tasks/0055_023_55023608_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_023_55023608_qa_1/environment/pull_bucket.py +++ b/tasks/0055_023_55023608_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_023_55023608_qa_1/task.toml b/tasks/0055_023_55023608_qa_1/task.toml index 171dc551afc719145df6342d171986ed209891a1..b431df0c2a863ff173e984eb6c8d91bfd974f0e6 100644 --- a/tasks/0055_023_55023608_qa_1/task.toml +++ b/tasks/0055_023_55023608_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_027_55027246_qa_2/environment/bootstrap.sh b/tasks/0055_027_55027246_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_027_55027246_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_027_55027246_qa_2/environment/pull_bucket.py b/tasks/0055_027_55027246_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_027_55027246_qa_2/environment/pull_bucket.py +++ b/tasks/0055_027_55027246_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_027_55027246_qa_2/task.toml b/tasks/0055_027_55027246_qa_2/task.toml index 88aa8866550293a3fda6c2d3162cd06147198a99..deec9ff0601cc516cb5e5a75e00b1884336a987f 100644 --- a/tasks/0055_027_55027246_qa_2/task.toml +++ b/tasks/0055_027_55027246_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_027_55027246_qa_4/environment/bootstrap.sh b/tasks/0055_027_55027246_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_027_55027246_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_027_55027246_qa_4/environment/pull_bucket.py b/tasks/0055_027_55027246_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_027_55027246_qa_4/environment/pull_bucket.py +++ b/tasks/0055_027_55027246_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_027_55027246_qa_4/task.toml b/tasks/0055_027_55027246_qa_4/task.toml index a69f13fabf4095c40308afc5a08c8230b6997483..fcfad8a10d249ba9556b7846700c061504ff3861 100644 --- a/tasks/0055_027_55027246_qa_4/task.toml +++ b/tasks/0055_027_55027246_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_033_55033540_qa_1/environment/bootstrap.sh b/tasks/0055_033_55033540_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_033_55033540_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_033_55033540_qa_1/environment/pull_bucket.py b/tasks/0055_033_55033540_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_033_55033540_qa_1/environment/pull_bucket.py +++ b/tasks/0055_033_55033540_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_033_55033540_qa_1/task.toml b/tasks/0055_033_55033540_qa_1/task.toml index 21cdb53f4e625851fb535057122fc39a098d1ca1..86b7ad1fb067336552dc5acdfa6a2366f811eb96 100644 --- a/tasks/0055_033_55033540_qa_1/task.toml +++ b/tasks/0055_033_55033540_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_033_55033540_qa_5/environment/bootstrap.sh b/tasks/0055_033_55033540_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_033_55033540_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_033_55033540_qa_5/environment/pull_bucket.py b/tasks/0055_033_55033540_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_033_55033540_qa_5/environment/pull_bucket.py +++ b/tasks/0055_033_55033540_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_033_55033540_qa_5/task.toml b/tasks/0055_033_55033540_qa_5/task.toml index 5c8da605c6d896d3d95745272d47aca1cf075940..03d87c914bb15f169c92143d4618575abe2f0f6f 100644 --- a/tasks/0055_033_55033540_qa_5/task.toml +++ b/tasks/0055_033_55033540_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_042_55042891_qa_1/environment/bootstrap.sh b/tasks/0055_042_55042891_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_042_55042891_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_042_55042891_qa_1/environment/pull_bucket.py b/tasks/0055_042_55042891_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_042_55042891_qa_1/environment/pull_bucket.py +++ b/tasks/0055_042_55042891_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_042_55042891_qa_1/task.toml b/tasks/0055_042_55042891_qa_1/task.toml index 9674cd4f21f92f58b3c9dc03f6c9e36cc42344d4..a3c87186a1d8f5822ced439691bff27e6dd439a1 100644 --- a/tasks/0055_042_55042891_qa_1/task.toml +++ b/tasks/0055_042_55042891_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_042_55042891_qa_4/environment/bootstrap.sh b/tasks/0055_042_55042891_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_042_55042891_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_042_55042891_qa_4/environment/pull_bucket.py b/tasks/0055_042_55042891_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_042_55042891_qa_4/environment/pull_bucket.py +++ b/tasks/0055_042_55042891_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_042_55042891_qa_4/task.toml b/tasks/0055_042_55042891_qa_4/task.toml index d878213f6633424cdd287215d53048e35df24a61..0b30746d41e0821b1125f81dd2179e7b4631bf2f 100644 --- a/tasks/0055_042_55042891_qa_4/task.toml +++ b/tasks/0055_042_55042891_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_042_55042891_qa_5/environment/bootstrap.sh b/tasks/0055_042_55042891_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_042_55042891_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_042_55042891_qa_5/environment/pull_bucket.py b/tasks/0055_042_55042891_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_042_55042891_qa_5/environment/pull_bucket.py +++ b/tasks/0055_042_55042891_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_042_55042891_qa_5/task.toml b/tasks/0055_042_55042891_qa_5/task.toml index 451de2f75b4b90d88a1b96ba3f53a0683c674a85..9cbe26d3af72f0354aa0d592d3530929b8288844 100644 --- a/tasks/0055_042_55042891_qa_5/task.toml +++ b/tasks/0055_042_55042891_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_050_55050231_qa_3/environment/bootstrap.sh b/tasks/0055_050_55050231_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_050_55050231_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_050_55050231_qa_3/environment/pull_bucket.py b/tasks/0055_050_55050231_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_050_55050231_qa_3/environment/pull_bucket.py +++ b/tasks/0055_050_55050231_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_050_55050231_qa_3/task.toml b/tasks/0055_050_55050231_qa_3/task.toml index cb2dde726fdaa358b14cb3d2c898ec264c123158..d3d6931da1544a09501b02a49e8fc65b0644e936 100644 --- a/tasks/0055_050_55050231_qa_3/task.toml +++ b/tasks/0055_050_55050231_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_050_55050231_qa_4/environment/bootstrap.sh b/tasks/0055_050_55050231_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_050_55050231_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_050_55050231_qa_4/environment/pull_bucket.py b/tasks/0055_050_55050231_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_050_55050231_qa_4/environment/pull_bucket.py +++ b/tasks/0055_050_55050231_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_050_55050231_qa_4/task.toml b/tasks/0055_050_55050231_qa_4/task.toml index 209c7d588a78d2903aff02b885cd922a37c70d36..62944fe6f9cd76539978f3931eacfbd463714cd8 100644 --- a/tasks/0055_050_55050231_qa_4/task.toml +++ b/tasks/0055_050_55050231_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_059_55059592_qa_3/environment/bootstrap.sh b/tasks/0055_059_55059592_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_059_55059592_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_059_55059592_qa_3/environment/pull_bucket.py b/tasks/0055_059_55059592_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_059_55059592_qa_3/environment/pull_bucket.py +++ b/tasks/0055_059_55059592_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_059_55059592_qa_3/task.toml b/tasks/0055_059_55059592_qa_3/task.toml index 4e451537312d05cca6ff2e5ecdee18315733a49a..740f0d8df3e56f1b5433233f30af064fe16827a3 100644 --- a/tasks/0055_059_55059592_qa_3/task.toml +++ b/tasks/0055_059_55059592_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_086_55086484_qa_1/environment/bootstrap.sh b/tasks/0055_086_55086484_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_086_55086484_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_086_55086484_qa_1/environment/pull_bucket.py b/tasks/0055_086_55086484_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_086_55086484_qa_1/environment/pull_bucket.py +++ b/tasks/0055_086_55086484_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_086_55086484_qa_1/task.toml b/tasks/0055_086_55086484_qa_1/task.toml index 60bbd4ef6e17eb090b6d2636b2078fe05c96614a..e93c149667d0a34c197437996082b3aeaffa762e 100644 --- a/tasks/0055_086_55086484_qa_1/task.toml +++ b/tasks/0055_086_55086484_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_099_55099558_qa_1/environment/bootstrap.sh b/tasks/0055_099_55099558_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_099_55099558_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_099_55099558_qa_1/environment/pull_bucket.py b/tasks/0055_099_55099558_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_099_55099558_qa_1/environment/pull_bucket.py +++ b/tasks/0055_099_55099558_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_099_55099558_qa_1/task.toml b/tasks/0055_099_55099558_qa_1/task.toml index 2d4afeda5b6f3b806ba8dd1f67e97d744a5daa94..3123e214240cefc1924db7b4b7bf35d1ff8a34de 100644 --- a/tasks/0055_099_55099558_qa_1/task.toml +++ b/tasks/0055_099_55099558_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_099_55099558_qa_5/environment/bootstrap.sh b/tasks/0055_099_55099558_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_099_55099558_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_099_55099558_qa_5/environment/pull_bucket.py b/tasks/0055_099_55099558_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_099_55099558_qa_5/environment/pull_bucket.py +++ b/tasks/0055_099_55099558_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_099_55099558_qa_5/task.toml b/tasks/0055_099_55099558_qa_5/task.toml index beaeb5c9cc55bb0f5ea7bdde597b2bacd0f8a534..47e018b65795c61ee6bf5ee8ea887d2bbfdc7e6a 100644 --- a/tasks/0055_099_55099558_qa_5/task.toml +++ b/tasks/0055_099_55099558_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_115_55115812_qa_1/environment/bootstrap.sh b/tasks/0055_115_55115812_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_115_55115812_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_115_55115812_qa_1/environment/pull_bucket.py b/tasks/0055_115_55115812_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_115_55115812_qa_1/environment/pull_bucket.py +++ b/tasks/0055_115_55115812_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_115_55115812_qa_1/task.toml b/tasks/0055_115_55115812_qa_1/task.toml index 948c023edfcc690a9583e75423932034a53e097d..3a90ea3b1afcb7d380344bab145e2d04cb0ba745 100644 --- a/tasks/0055_115_55115812_qa_1/task.toml +++ b/tasks/0055_115_55115812_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_127_55127360_qa_4/environment/bootstrap.sh b/tasks/0055_127_55127360_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_127_55127360_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_127_55127360_qa_4/environment/pull_bucket.py b/tasks/0055_127_55127360_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_127_55127360_qa_4/environment/pull_bucket.py +++ b/tasks/0055_127_55127360_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_127_55127360_qa_4/task.toml b/tasks/0055_127_55127360_qa_4/task.toml index 4a2fcb722d0defcdfb70c3eee485f30b716a564c..65cb50f8d4f42d4bd281ec26f0376a194cc37149 100644 --- a/tasks/0055_127_55127360_qa_4/task.toml +++ b/tasks/0055_127_55127360_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_146_55146252_qa_2/environment/bootstrap.sh b/tasks/0055_146_55146252_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_146_55146252_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_146_55146252_qa_2/environment/pull_bucket.py b/tasks/0055_146_55146252_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_146_55146252_qa_2/environment/pull_bucket.py +++ b/tasks/0055_146_55146252_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_146_55146252_qa_2/task.toml b/tasks/0055_146_55146252_qa_2/task.toml index 858582e487d7fc208a9882e75411ac66eeeb3531..362fc1a95e50681d884d4779c9399ffea3168717 100644 --- a/tasks/0055_146_55146252_qa_2/task.toml +++ b/tasks/0055_146_55146252_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_165_55165511_qa_4/environment/bootstrap.sh b/tasks/0055_165_55165511_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_165_55165511_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_165_55165511_qa_4/environment/pull_bucket.py b/tasks/0055_165_55165511_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_165_55165511_qa_4/environment/pull_bucket.py +++ b/tasks/0055_165_55165511_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_165_55165511_qa_4/task.toml b/tasks/0055_165_55165511_qa_4/task.toml index 01e2e1b18c9b2c8c5beab47e355575eacbc292e4..17c31818c018dba4d7c530e283e3607622e8a515 100644 --- a/tasks/0055_165_55165511_qa_4/task.toml +++ b/tasks/0055_165_55165511_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_278_55278536_qa_4/environment/bootstrap.sh b/tasks/0055_278_55278536_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_278_55278536_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_278_55278536_qa_4/environment/pull_bucket.py b/tasks/0055_278_55278536_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_278_55278536_qa_4/environment/pull_bucket.py +++ b/tasks/0055_278_55278536_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_278_55278536_qa_4/task.toml b/tasks/0055_278_55278536_qa_4/task.toml index cb4ebb5198f14523df3241998bc52dd99281d659..0166cc1d65fed2e7bcd1ab4129fa6ac5c4667fe6 100644 --- a/tasks/0055_278_55278536_qa_4/task.toml +++ b/tasks/0055_278_55278536_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_278_55278536_qa_5/environment/bootstrap.sh b/tasks/0055_278_55278536_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_278_55278536_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_278_55278536_qa_5/environment/pull_bucket.py b/tasks/0055_278_55278536_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_278_55278536_qa_5/environment/pull_bucket.py +++ b/tasks/0055_278_55278536_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_278_55278536_qa_5/task.toml b/tasks/0055_278_55278536_qa_5/task.toml index a63d0e65bcc4f8532542233bf085807d4d66995b..68daccfa650ec028bb05aafd9f272c5fefc2984c 100644 --- a/tasks/0055_278_55278536_qa_5/task.toml +++ b/tasks/0055_278_55278536_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_310_55310713_qa_1/environment/bootstrap.sh b/tasks/0055_310_55310713_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_310_55310713_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_310_55310713_qa_1/environment/pull_bucket.py b/tasks/0055_310_55310713_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_310_55310713_qa_1/environment/pull_bucket.py +++ b/tasks/0055_310_55310713_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_310_55310713_qa_1/task.toml b/tasks/0055_310_55310713_qa_1/task.toml index 5e88cf667ab137ffbd56e28ee2347238033e7be2..a750b2cda4e389d4e7cd9241d4ff580b459dc342 100644 --- a/tasks/0055_310_55310713_qa_1/task.toml +++ b/tasks/0055_310_55310713_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_310_55310713_qa_3/environment/bootstrap.sh b/tasks/0055_310_55310713_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_310_55310713_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_310_55310713_qa_3/environment/pull_bucket.py b/tasks/0055_310_55310713_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_310_55310713_qa_3/environment/pull_bucket.py +++ b/tasks/0055_310_55310713_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_310_55310713_qa_3/task.toml b/tasks/0055_310_55310713_qa_3/task.toml index 7ce9c09b28d07f5129f021ec874af743b6c491b8..0983f1645fd627b68b3f4e3a476799fee8a61d42 100644 --- a/tasks/0055_310_55310713_qa_3/task.toml +++ b/tasks/0055_310_55310713_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_310_55310713_qa_4/environment/bootstrap.sh b/tasks/0055_310_55310713_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_310_55310713_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_310_55310713_qa_4/environment/pull_bucket.py b/tasks/0055_310_55310713_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_310_55310713_qa_4/environment/pull_bucket.py +++ b/tasks/0055_310_55310713_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_310_55310713_qa_4/task.toml b/tasks/0055_310_55310713_qa_4/task.toml index b1dae7c6103753594dda8f0e3cf2046cf3e82a92..ec6c23e600b7241184aca7266efee80bf20fdb7c 100644 --- a/tasks/0055_310_55310713_qa_4/task.toml +++ b/tasks/0055_310_55310713_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_335_55335995_qa_1/environment/bootstrap.sh b/tasks/0055_335_55335995_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_335_55335995_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_335_55335995_qa_1/environment/pull_bucket.py b/tasks/0055_335_55335995_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_335_55335995_qa_1/environment/pull_bucket.py +++ b/tasks/0055_335_55335995_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_335_55335995_qa_1/task.toml b/tasks/0055_335_55335995_qa_1/task.toml index 4240abbdb52e74cecec8893cbef753fabac5e6ba..6a65989235172fbe35f9099bb5f1234de456c125 100644 --- a/tasks/0055_335_55335995_qa_1/task.toml +++ b/tasks/0055_335_55335995_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_335_55335995_qa_3/environment/bootstrap.sh b/tasks/0055_335_55335995_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_335_55335995_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_335_55335995_qa_3/environment/pull_bucket.py b/tasks/0055_335_55335995_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_335_55335995_qa_3/environment/pull_bucket.py +++ b/tasks/0055_335_55335995_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_335_55335995_qa_3/task.toml b/tasks/0055_335_55335995_qa_3/task.toml index 5c6bd7a888125ded6ffc44164e2b32f3ae246249..dcfd63ef746925a36c43337a37009dd9ff1c9f38 100644 --- a/tasks/0055_335_55335995_qa_3/task.toml +++ b/tasks/0055_335_55335995_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_388_55388977_qa_2/environment/bootstrap.sh b/tasks/0055_388_55388977_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_388_55388977_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_388_55388977_qa_2/environment/pull_bucket.py b/tasks/0055_388_55388977_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_388_55388977_qa_2/environment/pull_bucket.py +++ b/tasks/0055_388_55388977_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_388_55388977_qa_2/task.toml b/tasks/0055_388_55388977_qa_2/task.toml index 04184985e7d924780eb9e0e0c7ca7f02b846d2d1..275317a9115f6be69e85882b5c63ce0ef44ed697 100644 --- a/tasks/0055_388_55388977_qa_2/task.toml +++ b/tasks/0055_388_55388977_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_388_55388977_qa_5/environment/bootstrap.sh b/tasks/0055_388_55388977_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_388_55388977_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_388_55388977_qa_5/environment/pull_bucket.py b/tasks/0055_388_55388977_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_388_55388977_qa_5/environment/pull_bucket.py +++ b/tasks/0055_388_55388977_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_388_55388977_qa_5/task.toml b/tasks/0055_388_55388977_qa_5/task.toml index 00a8a8e271005ce506e1a335fa0bd81f693c7122..c2e0ef2abd56a321ccc6476119f716dbe49cb8e5 100644 --- a/tasks/0055_388_55388977_qa_5/task.toml +++ b/tasks/0055_388_55388977_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_474_55474406_qa_3/environment/bootstrap.sh b/tasks/0055_474_55474406_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_474_55474406_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_474_55474406_qa_3/environment/pull_bucket.py b/tasks/0055_474_55474406_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_474_55474406_qa_3/environment/pull_bucket.py +++ b/tasks/0055_474_55474406_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_474_55474406_qa_3/task.toml b/tasks/0055_474_55474406_qa_3/task.toml index 5aee7a398b62aa297df1bf75d84283e80430e17f..6096111822566841ab209bb3f26bbafbcdc0a9ae 100644 --- a/tasks/0055_474_55474406_qa_3/task.toml +++ b/tasks/0055_474_55474406_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_474_55474406_qa_4/environment/bootstrap.sh b/tasks/0055_474_55474406_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_474_55474406_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_474_55474406_qa_4/environment/pull_bucket.py b/tasks/0055_474_55474406_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_474_55474406_qa_4/environment/pull_bucket.py +++ b/tasks/0055_474_55474406_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_474_55474406_qa_4/task.toml b/tasks/0055_474_55474406_qa_4/task.toml index 2b986d5dd046a45b2cb3e77ae76bc60b57f6e1c0..8bd48f79c9ac77020775d6832e554613ce3751eb 100644 --- a/tasks/0055_474_55474406_qa_4/task.toml +++ b/tasks/0055_474_55474406_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_521_55521574_qa_5/environment/bootstrap.sh b/tasks/0055_521_55521574_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_521_55521574_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_521_55521574_qa_5/environment/pull_bucket.py b/tasks/0055_521_55521574_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_521_55521574_qa_5/environment/pull_bucket.py +++ b/tasks/0055_521_55521574_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_521_55521574_qa_5/task.toml b/tasks/0055_521_55521574_qa_5/task.toml index de060e6f64f860d560c70f4460ce23c364f1ff5e..738a88ff82a15735b5c207ffd74f51199b573c0a 100644 --- a/tasks/0055_521_55521574_qa_5/task.toml +++ b/tasks/0055_521_55521574_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_556_55556459_qa_2/environment/bootstrap.sh b/tasks/0055_556_55556459_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_556_55556459_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_556_55556459_qa_2/environment/pull_bucket.py b/tasks/0055_556_55556459_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_556_55556459_qa_2/environment/pull_bucket.py +++ b/tasks/0055_556_55556459_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_556_55556459_qa_2/task.toml b/tasks/0055_556_55556459_qa_2/task.toml index 111446be43f80450ca78eaaf3ccbcec474a16f4a..7f8c763b6ead9b864e9efc72cc185808b9c1feea 100644 --- a/tasks/0055_556_55556459_qa_2/task.toml +++ b/tasks/0055_556_55556459_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_556_55556459_qa_3/environment/bootstrap.sh b/tasks/0055_556_55556459_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_556_55556459_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_556_55556459_qa_3/environment/pull_bucket.py b/tasks/0055_556_55556459_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_556_55556459_qa_3/environment/pull_bucket.py +++ b/tasks/0055_556_55556459_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_556_55556459_qa_3/task.toml b/tasks/0055_556_55556459_qa_3/task.toml index d35d5a748ca15828495dda4a4cc8ca043b1c5149..9e5c2c6ddad84c89845b9aadf58d5fa84ed5baf7 100644 --- a/tasks/0055_556_55556459_qa_3/task.toml +++ b/tasks/0055_556_55556459_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_625_55625808_qa_5/environment/bootstrap.sh b/tasks/0055_625_55625808_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_625_55625808_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_625_55625808_qa_5/environment/pull_bucket.py b/tasks/0055_625_55625808_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_625_55625808_qa_5/environment/pull_bucket.py +++ b/tasks/0055_625_55625808_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_625_55625808_qa_5/task.toml b/tasks/0055_625_55625808_qa_5/task.toml index 46536b839683974ed205398adc752107782b7069..8a1006a5d25818af04215d69ee85122fbe4661a3 100644 --- a/tasks/0055_625_55625808_qa_5/task.toml +++ b/tasks/0055_625_55625808_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_676_55676685_qa_3/environment/bootstrap.sh b/tasks/0055_676_55676685_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_676_55676685_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_676_55676685_qa_3/environment/pull_bucket.py b/tasks/0055_676_55676685_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_676_55676685_qa_3/environment/pull_bucket.py +++ b/tasks/0055_676_55676685_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_676_55676685_qa_3/task.toml b/tasks/0055_676_55676685_qa_3/task.toml index 79736d1b4f8aac988271676ad59ac64e55e5e8f9..e81711fc367f75776a45fcb7622cead4c19ce281 100644 --- a/tasks/0055_676_55676685_qa_3/task.toml +++ b/tasks/0055_676_55676685_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_694_55694303_qa_5/environment/bootstrap.sh b/tasks/0055_694_55694303_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_694_55694303_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_694_55694303_qa_5/environment/pull_bucket.py b/tasks/0055_694_55694303_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_694_55694303_qa_5/environment/pull_bucket.py +++ b/tasks/0055_694_55694303_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_694_55694303_qa_5/task.toml b/tasks/0055_694_55694303_qa_5/task.toml index da35bebb750daa57335447116811113aeb015011..79ba97934e87dca691dc3ce42df22e03c4bc0ff6 100644 --- a/tasks/0055_694_55694303_qa_5/task.toml +++ b/tasks/0055_694_55694303_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_717_55717074_qa_3/environment/bootstrap.sh b/tasks/0055_717_55717074_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_717_55717074_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_717_55717074_qa_3/environment/pull_bucket.py b/tasks/0055_717_55717074_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_717_55717074_qa_3/environment/pull_bucket.py +++ b/tasks/0055_717_55717074_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_717_55717074_qa_3/task.toml b/tasks/0055_717_55717074_qa_3/task.toml index 37b68b9447a55d411d5cb944395403b48235bf5d..043e1914f2a442481a2b95305d101e31c262c8de 100644 --- a/tasks/0055_717_55717074_qa_3/task.toml +++ b/tasks/0055_717_55717074_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_717_55717074_qa_4/environment/bootstrap.sh b/tasks/0055_717_55717074_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_717_55717074_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_717_55717074_qa_4/environment/pull_bucket.py b/tasks/0055_717_55717074_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_717_55717074_qa_4/environment/pull_bucket.py +++ b/tasks/0055_717_55717074_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_717_55717074_qa_4/task.toml b/tasks/0055_717_55717074_qa_4/task.toml index d69d1f79a67b17997c484b869985dc379d670ae8..f49774f12057846998a49dfcdd6e14bc70cdbfad 100644 --- a/tasks/0055_717_55717074_qa_4/task.toml +++ b/tasks/0055_717_55717074_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_752_55752704_qa_2/environment/bootstrap.sh b/tasks/0055_752_55752704_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_752_55752704_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_752_55752704_qa_2/environment/pull_bucket.py b/tasks/0055_752_55752704_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_752_55752704_qa_2/environment/pull_bucket.py +++ b/tasks/0055_752_55752704_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_752_55752704_qa_2/task.toml b/tasks/0055_752_55752704_qa_2/task.toml index ba13b580a285500e17dda17b647d4b84d44c6f27..8f4ae3d9a0f5876df5bd05ce9cc164cc3f384da5 100644 --- a/tasks/0055_752_55752704_qa_2/task.toml +++ b/tasks/0055_752_55752704_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_790_55790118_qa_1/environment/bootstrap.sh b/tasks/0055_790_55790118_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_790_55790118_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_790_55790118_qa_1/environment/pull_bucket.py b/tasks/0055_790_55790118_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_790_55790118_qa_1/environment/pull_bucket.py +++ b/tasks/0055_790_55790118_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_790_55790118_qa_1/task.toml b/tasks/0055_790_55790118_qa_1/task.toml index a84aad324e0903973409f2edfa70642a25ad00b5..075b4a4e7e7e35b32b2e0d94670038363bf9fc66 100644 --- a/tasks/0055_790_55790118_qa_1/task.toml +++ b/tasks/0055_790_55790118_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_790_55790118_qa_2/environment/bootstrap.sh b/tasks/0055_790_55790118_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_790_55790118_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_790_55790118_qa_2/environment/pull_bucket.py b/tasks/0055_790_55790118_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_790_55790118_qa_2/environment/pull_bucket.py +++ b/tasks/0055_790_55790118_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_790_55790118_qa_2/task.toml b/tasks/0055_790_55790118_qa_2/task.toml index 536b8f11c75968146b768cbd02d61528fb0755a0..153412953e2cedb066d583f8da670eb77b9763b7 100644 --- a/tasks/0055_790_55790118_qa_2/task.toml +++ b/tasks/0055_790_55790118_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_790_55790118_qa_3/environment/bootstrap.sh b/tasks/0055_790_55790118_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_790_55790118_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_790_55790118_qa_3/environment/pull_bucket.py b/tasks/0055_790_55790118_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_790_55790118_qa_3/environment/pull_bucket.py +++ b/tasks/0055_790_55790118_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_790_55790118_qa_3/task.toml b/tasks/0055_790_55790118_qa_3/task.toml index a94aba5854eed99564ab18839af88c31e74c5617..a2fed5246f96d76018ee518ab0f0fdd4b3d24aa6 100644 --- a/tasks/0055_790_55790118_qa_3/task.toml +++ b/tasks/0055_790_55790118_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_824_55824440_qa_3/environment/bootstrap.sh b/tasks/0055_824_55824440_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_824_55824440_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_824_55824440_qa_3/environment/pull_bucket.py b/tasks/0055_824_55824440_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_824_55824440_qa_3/environment/pull_bucket.py +++ b/tasks/0055_824_55824440_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_824_55824440_qa_3/task.toml b/tasks/0055_824_55824440_qa_3/task.toml index 4bf615a4ccaa7a91a861c448db9bd1f809cd06c8..1937511054acc5dbaa696e3b789f025c28f984d1 100644 --- a/tasks/0055_824_55824440_qa_3/task.toml +++ b/tasks/0055_824_55824440_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_824_55824440_qa_5/environment/bootstrap.sh b/tasks/0055_824_55824440_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_824_55824440_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_824_55824440_qa_5/environment/pull_bucket.py b/tasks/0055_824_55824440_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_824_55824440_qa_5/environment/pull_bucket.py +++ b/tasks/0055_824_55824440_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_824_55824440_qa_5/task.toml b/tasks/0055_824_55824440_qa_5/task.toml index 1e68003ccd10f1ddb7a7e9a83638a97d8f24239b..3439c537932b399a6f8df700b05c577126b19f94 100644 --- a/tasks/0055_824_55824440_qa_5/task.toml +++ b/tasks/0055_824_55824440_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_834_55834525_qa_1/environment/bootstrap.sh b/tasks/0055_834_55834525_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_834_55834525_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_834_55834525_qa_1/environment/pull_bucket.py b/tasks/0055_834_55834525_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_834_55834525_qa_1/environment/pull_bucket.py +++ b/tasks/0055_834_55834525_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_834_55834525_qa_1/task.toml b/tasks/0055_834_55834525_qa_1/task.toml index 0c24794b75e17c7f7a6c34082a4c7cb6809967fd..4b0d65540017b4f1bd2036b6af3c9d5812a10e86 100644 --- a/tasks/0055_834_55834525_qa_1/task.toml +++ b/tasks/0055_834_55834525_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_859_55859289_qa_2/environment/bootstrap.sh b/tasks/0055_859_55859289_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_859_55859289_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_859_55859289_qa_2/environment/pull_bucket.py b/tasks/0055_859_55859289_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_859_55859289_qa_2/environment/pull_bucket.py +++ b/tasks/0055_859_55859289_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_859_55859289_qa_2/task.toml b/tasks/0055_859_55859289_qa_2/task.toml index 6defe08e3b0c18e6d50c8128ad802f3f958de6af..b45daacb74beadf93983da5326b7372035bff9db 100644 --- a/tasks/0055_859_55859289_qa_2/task.toml +++ b/tasks/0055_859_55859289_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_861_55861850_qa_5/environment/bootstrap.sh b/tasks/0055_861_55861850_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_861_55861850_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_861_55861850_qa_5/environment/pull_bucket.py b/tasks/0055_861_55861850_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_861_55861850_qa_5/environment/pull_bucket.py +++ b/tasks/0055_861_55861850_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_861_55861850_qa_5/task.toml b/tasks/0055_861_55861850_qa_5/task.toml index 1fd8d208a1b61f3e29f8837de0df0cc9d7c76e0b..62e5582ae2107616d448a9b08bc6a61082ac70aa 100644 --- a/tasks/0055_861_55861850_qa_5/task.toml +++ b/tasks/0055_861_55861850_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0055_968_55968459_qa_4/environment/bootstrap.sh b/tasks/0055_968_55968459_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0055_968_55968459_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0055_968_55968459_qa_4/environment/pull_bucket.py b/tasks/0055_968_55968459_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0055_968_55968459_qa_4/environment/pull_bucket.py +++ b/tasks/0055_968_55968459_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0055_968_55968459_qa_4/task.toml b/tasks/0055_968_55968459_qa_4/task.toml index 366c85b01fb567480ee9c31decca26c39e84aba4..5b6cc63fe81023df07aa5b4b5502ff7acba51e82 100644 --- a/tasks/0055_968_55968459_qa_4/task.toml +++ b/tasks/0055_968_55968459_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_028_56028891_qa_3/environment/bootstrap.sh b/tasks/0056_028_56028891_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_028_56028891_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_028_56028891_qa_3/environment/pull_bucket.py b/tasks/0056_028_56028891_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_028_56028891_qa_3/environment/pull_bucket.py +++ b/tasks/0056_028_56028891_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_028_56028891_qa_3/task.toml b/tasks/0056_028_56028891_qa_3/task.toml index 9c15cc599529215f4a834f4702330e14b0ab0612..12ba092baa87ec6a0377d792eac1804afa45fb94 100644 --- a/tasks/0056_028_56028891_qa_3/task.toml +++ b/tasks/0056_028_56028891_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_060_56060924_qa_4/environment/bootstrap.sh b/tasks/0056_060_56060924_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_060_56060924_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_060_56060924_qa_4/environment/pull_bucket.py b/tasks/0056_060_56060924_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_060_56060924_qa_4/environment/pull_bucket.py +++ b/tasks/0056_060_56060924_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_060_56060924_qa_4/task.toml b/tasks/0056_060_56060924_qa_4/task.toml index 687faa6e8c24906e672c2237a8388d40184860a3..5ce78ab709cc8569c787a5e841c653af9560946a 100644 --- a/tasks/0056_060_56060924_qa_4/task.toml +++ b/tasks/0056_060_56060924_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_060_56060924_qa_5/environment/bootstrap.sh b/tasks/0056_060_56060924_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_060_56060924_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_060_56060924_qa_5/environment/pull_bucket.py b/tasks/0056_060_56060924_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_060_56060924_qa_5/environment/pull_bucket.py +++ b/tasks/0056_060_56060924_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_060_56060924_qa_5/task.toml b/tasks/0056_060_56060924_qa_5/task.toml index 9484787770746c57da3253962034ee7bd679ff4e..bbae0cc1e7834b879817df2a45ec5dc021ce3350 100644 --- a/tasks/0056_060_56060924_qa_5/task.toml +++ b/tasks/0056_060_56060924_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_160_56160021_qa_5/environment/bootstrap.sh b/tasks/0056_160_56160021_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_160_56160021_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_160_56160021_qa_5/environment/pull_bucket.py b/tasks/0056_160_56160021_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_160_56160021_qa_5/environment/pull_bucket.py +++ b/tasks/0056_160_56160021_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_160_56160021_qa_5/task.toml b/tasks/0056_160_56160021_qa_5/task.toml index 6d4caec2a3b7aae88aa0f4c3e4996a8576bd0c61..c7a5d4b207094b0d2d89af634212155cc970dde5 100644 --- a/tasks/0056_160_56160021_qa_5/task.toml +++ b/tasks/0056_160_56160021_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_167_56167051_qa_3/environment/bootstrap.sh b/tasks/0056_167_56167051_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_167_56167051_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_167_56167051_qa_3/environment/pull_bucket.py b/tasks/0056_167_56167051_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_167_56167051_qa_3/environment/pull_bucket.py +++ b/tasks/0056_167_56167051_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_167_56167051_qa_3/task.toml b/tasks/0056_167_56167051_qa_3/task.toml index b70523d989f2b60a2e03009d76de317483f71211..e2930b2bc695e3e7d03bafeece40e324e124cc39 100644 --- a/tasks/0056_167_56167051_qa_3/task.toml +++ b/tasks/0056_167_56167051_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_167_56167051_qa_4/environment/bootstrap.sh b/tasks/0056_167_56167051_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_167_56167051_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_167_56167051_qa_4/environment/pull_bucket.py b/tasks/0056_167_56167051_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_167_56167051_qa_4/environment/pull_bucket.py +++ b/tasks/0056_167_56167051_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_167_56167051_qa_4/task.toml b/tasks/0056_167_56167051_qa_4/task.toml index 2f96843213e2f71bc793b956c948e4a49ae87323..ed963f88cc91da916a8c291720021c3f40fde70c 100644 --- a/tasks/0056_167_56167051_qa_4/task.toml +++ b/tasks/0056_167_56167051_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_224_56224214_qa_4/environment/bootstrap.sh b/tasks/0056_224_56224214_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_224_56224214_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_224_56224214_qa_4/environment/pull_bucket.py b/tasks/0056_224_56224214_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_224_56224214_qa_4/environment/pull_bucket.py +++ b/tasks/0056_224_56224214_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_224_56224214_qa_4/task.toml b/tasks/0056_224_56224214_qa_4/task.toml index a0a397de92da0cf72f0b278e5ecda21ba95acdd7..6f3884fa707a8332245c271c618235e2755fc196 100644 --- a/tasks/0056_224_56224214_qa_4/task.toml +++ b/tasks/0056_224_56224214_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_266_56266405_qa_3/environment/bootstrap.sh b/tasks/0056_266_56266405_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_266_56266405_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_266_56266405_qa_3/environment/pull_bucket.py b/tasks/0056_266_56266405_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_266_56266405_qa_3/environment/pull_bucket.py +++ b/tasks/0056_266_56266405_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_266_56266405_qa_3/task.toml b/tasks/0056_266_56266405_qa_3/task.toml index f11cc27569d95c83dda63b54b3bce501c252d08a..aa5b548c7d8831a1f1ecb9d2d4990b86f0dcf27e 100644 --- a/tasks/0056_266_56266405_qa_3/task.toml +++ b/tasks/0056_266_56266405_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_266_56266405_qa_4/environment/bootstrap.sh b/tasks/0056_266_56266405_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_266_56266405_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_266_56266405_qa_4/environment/pull_bucket.py b/tasks/0056_266_56266405_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_266_56266405_qa_4/environment/pull_bucket.py +++ b/tasks/0056_266_56266405_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_266_56266405_qa_4/task.toml b/tasks/0056_266_56266405_qa_4/task.toml index c80c0678f1a4f7b96fe05dbe4365af411e4a1315..30f39acd65737c2dae7e7882bed8c27b9eb9acf7 100644 --- a/tasks/0056_266_56266405_qa_4/task.toml +++ b/tasks/0056_266_56266405_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_269_56269828_qa_2/environment/bootstrap.sh b/tasks/0056_269_56269828_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_269_56269828_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_269_56269828_qa_2/environment/pull_bucket.py b/tasks/0056_269_56269828_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_269_56269828_qa_2/environment/pull_bucket.py +++ b/tasks/0056_269_56269828_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_269_56269828_qa_2/task.toml b/tasks/0056_269_56269828_qa_2/task.toml index 98f25606792ab94c2ef5d594b5d4bd4df5f9ecf5..e399309e545ccf600621dfed3a2d41bd33157d19 100644 --- a/tasks/0056_269_56269828_qa_2/task.toml +++ b/tasks/0056_269_56269828_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_269_56269828_qa_3/environment/bootstrap.sh b/tasks/0056_269_56269828_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_269_56269828_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_269_56269828_qa_3/environment/pull_bucket.py b/tasks/0056_269_56269828_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_269_56269828_qa_3/environment/pull_bucket.py +++ b/tasks/0056_269_56269828_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_269_56269828_qa_3/task.toml b/tasks/0056_269_56269828_qa_3/task.toml index 423c3a0bfbc17496848c9a9d29c6badec653c314..aa7a04663774345231b58a8960fd26dd185d8051 100644 --- a/tasks/0056_269_56269828_qa_3/task.toml +++ b/tasks/0056_269_56269828_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_343_56343164_qa_3/environment/bootstrap.sh b/tasks/0056_343_56343164_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_343_56343164_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_343_56343164_qa_3/environment/pull_bucket.py b/tasks/0056_343_56343164_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_343_56343164_qa_3/environment/pull_bucket.py +++ b/tasks/0056_343_56343164_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_343_56343164_qa_3/task.toml b/tasks/0056_343_56343164_qa_3/task.toml index b8d2a2e64e92d5e83f1ba2c9e68b23b4fd142b46..54c0d8fd1a6420ae804a03634a9e71f83a850f39 100644 --- a/tasks/0056_343_56343164_qa_3/task.toml +++ b/tasks/0056_343_56343164_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_349_56349410_qa_4/environment/bootstrap.sh b/tasks/0056_349_56349410_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_349_56349410_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_349_56349410_qa_4/environment/pull_bucket.py b/tasks/0056_349_56349410_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_349_56349410_qa_4/environment/pull_bucket.py +++ b/tasks/0056_349_56349410_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_349_56349410_qa_4/task.toml b/tasks/0056_349_56349410_qa_4/task.toml index fe04b89273044d2f5ae2d7262b9206924ed8eb53..a366d3131d4350c61b52a512ff76ac1b588bfeed 100644 --- a/tasks/0056_349_56349410_qa_4/task.toml +++ b/tasks/0056_349_56349410_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_391_56391883_qa_3/environment/bootstrap.sh b/tasks/0056_391_56391883_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_391_56391883_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_391_56391883_qa_3/environment/pull_bucket.py b/tasks/0056_391_56391883_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_391_56391883_qa_3/environment/pull_bucket.py +++ b/tasks/0056_391_56391883_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_391_56391883_qa_3/task.toml b/tasks/0056_391_56391883_qa_3/task.toml index acab867f0f064930e27c68cea21017bfd51b0639..78934068f2e9ebffd7d3bfa54938833421407b7e 100644 --- a/tasks/0056_391_56391883_qa_3/task.toml +++ b/tasks/0056_391_56391883_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_391_56391883_qa_4/environment/bootstrap.sh b/tasks/0056_391_56391883_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_391_56391883_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_391_56391883_qa_4/environment/pull_bucket.py b/tasks/0056_391_56391883_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_391_56391883_qa_4/environment/pull_bucket.py +++ b/tasks/0056_391_56391883_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_391_56391883_qa_4/task.toml b/tasks/0056_391_56391883_qa_4/task.toml index b6e76503ef81a919dbefbfb563d3fe5d1e37eb93..7004e6ff7ff17376f851f22ba775f0dfe747f707 100644 --- a/tasks/0056_391_56391883_qa_4/task.toml +++ b/tasks/0056_391_56391883_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_410_56410958_qa_1/environment/bootstrap.sh b/tasks/0056_410_56410958_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_410_56410958_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_410_56410958_qa_1/environment/pull_bucket.py b/tasks/0056_410_56410958_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_410_56410958_qa_1/environment/pull_bucket.py +++ b/tasks/0056_410_56410958_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_410_56410958_qa_1/task.toml b/tasks/0056_410_56410958_qa_1/task.toml index 3bd70bffb12d91608cf61557596317f57f9d781a..87f7fd3037c339862ab27d4c855ea50392cc4080 100644 --- a/tasks/0056_410_56410958_qa_1/task.toml +++ b/tasks/0056_410_56410958_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_410_56410958_qa_4/environment/bootstrap.sh b/tasks/0056_410_56410958_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_410_56410958_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_410_56410958_qa_4/environment/pull_bucket.py b/tasks/0056_410_56410958_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_410_56410958_qa_4/environment/pull_bucket.py +++ b/tasks/0056_410_56410958_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_410_56410958_qa_4/task.toml b/tasks/0056_410_56410958_qa_4/task.toml index 6522229db23182b3ae5f05b4854fd1523b7496b1..5f68815541d4ac118ab6c72c94d353b785f19c1b 100644 --- a/tasks/0056_410_56410958_qa_4/task.toml +++ b/tasks/0056_410_56410958_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_414_56414713_qa_1/environment/bootstrap.sh b/tasks/0056_414_56414713_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_414_56414713_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_414_56414713_qa_1/environment/pull_bucket.py b/tasks/0056_414_56414713_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_414_56414713_qa_1/environment/pull_bucket.py +++ b/tasks/0056_414_56414713_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_414_56414713_qa_1/task.toml b/tasks/0056_414_56414713_qa_1/task.toml index 8079577aaae49900275cfc9535e17bba3717d153..75d583a69cc3d5a250652727245a812c4d981f84 100644 --- a/tasks/0056_414_56414713_qa_1/task.toml +++ b/tasks/0056_414_56414713_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_414_56414713_qa_4/environment/bootstrap.sh b/tasks/0056_414_56414713_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_414_56414713_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_414_56414713_qa_4/environment/pull_bucket.py b/tasks/0056_414_56414713_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_414_56414713_qa_4/environment/pull_bucket.py +++ b/tasks/0056_414_56414713_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_414_56414713_qa_4/task.toml b/tasks/0056_414_56414713_qa_4/task.toml index 9700d519609f153503f296524cc14b4a1afd81ae..f12191a257484bd8feb37f560f53ab7b824c65f3 100644 --- a/tasks/0056_414_56414713_qa_4/task.toml +++ b/tasks/0056_414_56414713_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_464_56464038_qa_1/environment/bootstrap.sh b/tasks/0056_464_56464038_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_464_56464038_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_464_56464038_qa_1/environment/pull_bucket.py b/tasks/0056_464_56464038_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_464_56464038_qa_1/environment/pull_bucket.py +++ b/tasks/0056_464_56464038_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_464_56464038_qa_1/task.toml b/tasks/0056_464_56464038_qa_1/task.toml index f0c5eab149d64e6aa99193d3320d45141aa14e0a..3473be7c20bb223cc9425ac613c9a2de1a7127eb 100644 --- a/tasks/0056_464_56464038_qa_1/task.toml +++ b/tasks/0056_464_56464038_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_486_56486518_qa_2/environment/bootstrap.sh b/tasks/0056_486_56486518_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_486_56486518_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_486_56486518_qa_2/environment/pull_bucket.py b/tasks/0056_486_56486518_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_486_56486518_qa_2/environment/pull_bucket.py +++ b/tasks/0056_486_56486518_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_486_56486518_qa_2/task.toml b/tasks/0056_486_56486518_qa_2/task.toml index 3a6a54e40006016d1c642559810fd17d86897dd4..e4bb6bed469d241fc791518fe46cecf2a765ff68 100644 --- a/tasks/0056_486_56486518_qa_2/task.toml +++ b/tasks/0056_486_56486518_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_498_56498187_qa_2/environment/bootstrap.sh b/tasks/0056_498_56498187_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_498_56498187_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_498_56498187_qa_2/environment/pull_bucket.py b/tasks/0056_498_56498187_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_498_56498187_qa_2/environment/pull_bucket.py +++ b/tasks/0056_498_56498187_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_498_56498187_qa_2/task.toml b/tasks/0056_498_56498187_qa_2/task.toml index d35bdaa3d558c3353b1f8f47a790fd70cbcbd8c4..5e0a5debc082bafad851c33f9545d4b4216d9157 100644 --- a/tasks/0056_498_56498187_qa_2/task.toml +++ b/tasks/0056_498_56498187_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_526_56526864_qa_2/environment/bootstrap.sh b/tasks/0056_526_56526864_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_526_56526864_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_526_56526864_qa_2/environment/pull_bucket.py b/tasks/0056_526_56526864_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_526_56526864_qa_2/environment/pull_bucket.py +++ b/tasks/0056_526_56526864_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_526_56526864_qa_2/task.toml b/tasks/0056_526_56526864_qa_2/task.toml index a22ed60fa10b2787641ce63fcbcdf86b24c03c0f..7e2b1151b88441f564e2e08441243031d12bcb24 100644 --- a/tasks/0056_526_56526864_qa_2/task.toml +++ b/tasks/0056_526_56526864_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_538_56538672_qa_5/environment/bootstrap.sh b/tasks/0056_538_56538672_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_538_56538672_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_538_56538672_qa_5/environment/pull_bucket.py b/tasks/0056_538_56538672_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_538_56538672_qa_5/environment/pull_bucket.py +++ b/tasks/0056_538_56538672_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_538_56538672_qa_5/task.toml b/tasks/0056_538_56538672_qa_5/task.toml index 6eeede3988530ccf0942171f63562e266a7bcc41..76ac321c3b27f1c0abec5ba6fe440d5d6d7deca4 100644 --- a/tasks/0056_538_56538672_qa_5/task.toml +++ b/tasks/0056_538_56538672_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_603_56603541_qa_2/environment/bootstrap.sh b/tasks/0056_603_56603541_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_603_56603541_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_603_56603541_qa_2/environment/pull_bucket.py b/tasks/0056_603_56603541_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_603_56603541_qa_2/environment/pull_bucket.py +++ b/tasks/0056_603_56603541_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_603_56603541_qa_2/task.toml b/tasks/0056_603_56603541_qa_2/task.toml index ecbd19c52cd1e918d8570eb65a8768de5a3aebff..23734717fbbd6ae9224258e4cb858b3197989931 100644 --- a/tasks/0056_603_56603541_qa_2/task.toml +++ b/tasks/0056_603_56603541_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_615_56615334_qa_2/environment/bootstrap.sh b/tasks/0056_615_56615334_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_615_56615334_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_615_56615334_qa_2/environment/pull_bucket.py b/tasks/0056_615_56615334_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_615_56615334_qa_2/environment/pull_bucket.py +++ b/tasks/0056_615_56615334_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_615_56615334_qa_2/task.toml b/tasks/0056_615_56615334_qa_2/task.toml index 91505aaf298724c034309be21cc2c6f6c8d852b4..03244cad3ee1221d5f952467cd9595810b652d31 100644 --- a/tasks/0056_615_56615334_qa_2/task.toml +++ b/tasks/0056_615_56615334_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_615_56615334_qa_3/environment/bootstrap.sh b/tasks/0056_615_56615334_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_615_56615334_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_615_56615334_qa_3/environment/pull_bucket.py b/tasks/0056_615_56615334_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_615_56615334_qa_3/environment/pull_bucket.py +++ b/tasks/0056_615_56615334_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_615_56615334_qa_3/task.toml b/tasks/0056_615_56615334_qa_3/task.toml index 3bb729a397fbfd2eef61d38eb8a97558a7a8d0a5..2c25445f9afeeaa36733be8849e59af63cf12736 100644 --- a/tasks/0056_615_56615334_qa_3/task.toml +++ b/tasks/0056_615_56615334_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_665_56665612_qa_5/environment/bootstrap.sh b/tasks/0056_665_56665612_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_665_56665612_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_665_56665612_qa_5/environment/pull_bucket.py b/tasks/0056_665_56665612_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_665_56665612_qa_5/environment/pull_bucket.py +++ b/tasks/0056_665_56665612_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_665_56665612_qa_5/task.toml b/tasks/0056_665_56665612_qa_5/task.toml index 226d88ee703adb2c1821bddabc8129c2b14ddbe7..664fce5ffff5b12f68a0e2992b3c272d4881161f 100644 --- a/tasks/0056_665_56665612_qa_5/task.toml +++ b/tasks/0056_665_56665612_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_687_56687302_qa_2/environment/bootstrap.sh b/tasks/0056_687_56687302_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_687_56687302_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_687_56687302_qa_2/environment/pull_bucket.py b/tasks/0056_687_56687302_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_687_56687302_qa_2/environment/pull_bucket.py +++ b/tasks/0056_687_56687302_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_687_56687302_qa_2/task.toml b/tasks/0056_687_56687302_qa_2/task.toml index 9445a8a0aca6e9c092f8fbdebffedb3f899e0ab1..bac91e7233d88d68b271c7c25e98a0d47c31d3d5 100644 --- a/tasks/0056_687_56687302_qa_2/task.toml +++ b/tasks/0056_687_56687302_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_714_56714045_qa_3/environment/bootstrap.sh b/tasks/0056_714_56714045_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_714_56714045_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_714_56714045_qa_3/environment/pull_bucket.py b/tasks/0056_714_56714045_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_714_56714045_qa_3/environment/pull_bucket.py +++ b/tasks/0056_714_56714045_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_714_56714045_qa_3/task.toml b/tasks/0056_714_56714045_qa_3/task.toml index 3a4c15dddd1091ea0d1d9dc3edd2e9b4e1885090..1d4d657f2f34eb1a608aece897e5a9c6aa5c2965 100644 --- a/tasks/0056_714_56714045_qa_3/task.toml +++ b/tasks/0056_714_56714045_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_748_56748033_qa_1/environment/bootstrap.sh b/tasks/0056_748_56748033_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_748_56748033_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_748_56748033_qa_1/environment/pull_bucket.py b/tasks/0056_748_56748033_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_748_56748033_qa_1/environment/pull_bucket.py +++ b/tasks/0056_748_56748033_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_748_56748033_qa_1/task.toml b/tasks/0056_748_56748033_qa_1/task.toml index 43d2fb22f752b44455fca9090a7fc39713ddb9b0..6e0e3f5d2dc8034ef1c137cb7e68859fcb938948 100644 --- a/tasks/0056_748_56748033_qa_1/task.toml +++ b/tasks/0056_748_56748033_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_876_56876839_qa_5/environment/bootstrap.sh b/tasks/0056_876_56876839_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_876_56876839_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_876_56876839_qa_5/environment/pull_bucket.py b/tasks/0056_876_56876839_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_876_56876839_qa_5/environment/pull_bucket.py +++ b/tasks/0056_876_56876839_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_876_56876839_qa_5/task.toml b/tasks/0056_876_56876839_qa_5/task.toml index 8012b1a4511f36c1601074be9087be7a31d569b4..87cca996d8d53c0337339ecf9bdb9371132f4bfc 100644 --- a/tasks/0056_876_56876839_qa_5/task.toml +++ b/tasks/0056_876_56876839_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_896_56896780_qa_4/environment/bootstrap.sh b/tasks/0056_896_56896780_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_896_56896780_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_896_56896780_qa_4/environment/pull_bucket.py b/tasks/0056_896_56896780_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_896_56896780_qa_4/environment/pull_bucket.py +++ b/tasks/0056_896_56896780_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_896_56896780_qa_4/task.toml b/tasks/0056_896_56896780_qa_4/task.toml index 7590afe8f640dee9c0c8c73f0f0d708887a7b018..6d63dda542a43793a09c88b43e122780a2df969a 100644 --- a/tasks/0056_896_56896780_qa_4/task.toml +++ b/tasks/0056_896_56896780_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_907_56907084_qa_3/environment/bootstrap.sh b/tasks/0056_907_56907084_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_907_56907084_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_907_56907084_qa_3/environment/pull_bucket.py b/tasks/0056_907_56907084_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_907_56907084_qa_3/environment/pull_bucket.py +++ b/tasks/0056_907_56907084_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_907_56907084_qa_3/task.toml b/tasks/0056_907_56907084_qa_3/task.toml index 7d97d33e7d1c007685eb3ade23eb5cf190d7b331..894411f7663f1260a099f1711f3eda36ed9e65b1 100644 --- a/tasks/0056_907_56907084_qa_3/task.toml +++ b/tasks/0056_907_56907084_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_954_56954768_qa_2/environment/bootstrap.sh b/tasks/0056_954_56954768_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_954_56954768_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_954_56954768_qa_2/environment/pull_bucket.py b/tasks/0056_954_56954768_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_954_56954768_qa_2/environment/pull_bucket.py +++ b/tasks/0056_954_56954768_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_954_56954768_qa_2/task.toml b/tasks/0056_954_56954768_qa_2/task.toml index 6ca7d87e45f9e0d9453f00dc23d7d1c9b54d85de..ce1ca9411658c44d6d8bf6c85c1509db660059a9 100644 --- a/tasks/0056_954_56954768_qa_2/task.toml +++ b/tasks/0056_954_56954768_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0056_998_56998695_qa_4/environment/bootstrap.sh b/tasks/0056_998_56998695_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0056_998_56998695_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0056_998_56998695_qa_4/environment/pull_bucket.py b/tasks/0056_998_56998695_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0056_998_56998695_qa_4/environment/pull_bucket.py +++ b/tasks/0056_998_56998695_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0056_998_56998695_qa_4/task.toml b/tasks/0056_998_56998695_qa_4/task.toml index 7f78fef8e258783b2b030ee3478542a41a30f3af..519767533c5532a23cf50be4f9b9d172edd7e18d 100644 --- a/tasks/0056_998_56998695_qa_4/task.toml +++ b/tasks/0056_998_56998695_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_106_57106259_qa_1/environment/bootstrap.sh b/tasks/0057_106_57106259_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_106_57106259_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_106_57106259_qa_1/environment/pull_bucket.py b/tasks/0057_106_57106259_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_106_57106259_qa_1/environment/pull_bucket.py +++ b/tasks/0057_106_57106259_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_106_57106259_qa_1/task.toml b/tasks/0057_106_57106259_qa_1/task.toml index 4dfc489108c997b15c5b70608da326f328761662..446a699025f8a795df326ad482c368282890a15a 100644 --- a/tasks/0057_106_57106259_qa_1/task.toml +++ b/tasks/0057_106_57106259_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_110_57110418_qa_4/environment/bootstrap.sh b/tasks/0057_110_57110418_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_110_57110418_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_110_57110418_qa_4/environment/pull_bucket.py b/tasks/0057_110_57110418_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_110_57110418_qa_4/environment/pull_bucket.py +++ b/tasks/0057_110_57110418_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_110_57110418_qa_4/task.toml b/tasks/0057_110_57110418_qa_4/task.toml index 3164d168b0737a6f6c7805df3848e302ee25f3c0..4b0f94b279bb08843c95575f9d0850ead9d6d57f 100644 --- a/tasks/0057_110_57110418_qa_4/task.toml +++ b/tasks/0057_110_57110418_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_142_57142499_qa_5/environment/bootstrap.sh b/tasks/0057_142_57142499_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_142_57142499_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_142_57142499_qa_5/environment/pull_bucket.py b/tasks/0057_142_57142499_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_142_57142499_qa_5/environment/pull_bucket.py +++ b/tasks/0057_142_57142499_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_142_57142499_qa_5/task.toml b/tasks/0057_142_57142499_qa_5/task.toml index d257f7bf7dfe20a816516bcf7092acdda3551bfc..dce78a8b64adbf673d026448b5a84c3182e95642 100644 --- a/tasks/0057_142_57142499_qa_5/task.toml +++ b/tasks/0057_142_57142499_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_269_57269792_qa_5/environment/bootstrap.sh b/tasks/0057_269_57269792_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_269_57269792_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_269_57269792_qa_5/environment/pull_bucket.py b/tasks/0057_269_57269792_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_269_57269792_qa_5/environment/pull_bucket.py +++ b/tasks/0057_269_57269792_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_269_57269792_qa_5/task.toml b/tasks/0057_269_57269792_qa_5/task.toml index 307496622743faf6158c84c26dd0bcb6f8ce26b4..20841414344f1194b152bc4573f0e1995463f8fc 100644 --- a/tasks/0057_269_57269792_qa_5/task.toml +++ b/tasks/0057_269_57269792_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_378_57378613_qa_3/environment/bootstrap.sh b/tasks/0057_378_57378613_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_378_57378613_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_378_57378613_qa_3/environment/pull_bucket.py b/tasks/0057_378_57378613_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_378_57378613_qa_3/environment/pull_bucket.py +++ b/tasks/0057_378_57378613_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_378_57378613_qa_3/task.toml b/tasks/0057_378_57378613_qa_3/task.toml index fb33f9e663ad39b677099e646395388c0d92de06..a6c092d149231c596f550c5de6ccef92e20d89e2 100644 --- a/tasks/0057_378_57378613_qa_3/task.toml +++ b/tasks/0057_378_57378613_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_406_57406107_qa_4/environment/bootstrap.sh b/tasks/0057_406_57406107_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_406_57406107_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_406_57406107_qa_4/environment/pull_bucket.py b/tasks/0057_406_57406107_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_406_57406107_qa_4/environment/pull_bucket.py +++ b/tasks/0057_406_57406107_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_406_57406107_qa_4/task.toml b/tasks/0057_406_57406107_qa_4/task.toml index b599a89b65153d69f8beedd1f9a2d299869d4777..3e69a065dabd69a13ca6a8be55535f358e86f115 100644 --- a/tasks/0057_406_57406107_qa_4/task.toml +++ b/tasks/0057_406_57406107_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_443_57443371_qa_1/environment/bootstrap.sh b/tasks/0057_443_57443371_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_443_57443371_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_443_57443371_qa_1/environment/pull_bucket.py b/tasks/0057_443_57443371_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_443_57443371_qa_1/environment/pull_bucket.py +++ b/tasks/0057_443_57443371_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_443_57443371_qa_1/task.toml b/tasks/0057_443_57443371_qa_1/task.toml index a87733d5dc678c9c57902458f5b75aec61d81eca..f86ad6c960c5207cac20f477c75024c8d969d71c 100644 --- a/tasks/0057_443_57443371_qa_1/task.toml +++ b/tasks/0057_443_57443371_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_443_57443371_qa_2/environment/bootstrap.sh b/tasks/0057_443_57443371_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_443_57443371_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_443_57443371_qa_2/environment/pull_bucket.py b/tasks/0057_443_57443371_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_443_57443371_qa_2/environment/pull_bucket.py +++ b/tasks/0057_443_57443371_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_443_57443371_qa_2/task.toml b/tasks/0057_443_57443371_qa_2/task.toml index ba7805ed86bb796f015e13117f391c4676e5239b..af44578ca5a1aceb2d78e28893883bcb6d011b0d 100644 --- a/tasks/0057_443_57443371_qa_2/task.toml +++ b/tasks/0057_443_57443371_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_476_57476983_qa_4/environment/bootstrap.sh b/tasks/0057_476_57476983_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_476_57476983_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_476_57476983_qa_4/environment/pull_bucket.py b/tasks/0057_476_57476983_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_476_57476983_qa_4/environment/pull_bucket.py +++ b/tasks/0057_476_57476983_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_476_57476983_qa_4/task.toml b/tasks/0057_476_57476983_qa_4/task.toml index 6d87ff2adbea57dfbb553ce7cb43d5b05ce58c9d..45bc7bfef13cad35789885221fac023bb7648908 100644 --- a/tasks/0057_476_57476983_qa_4/task.toml +++ b/tasks/0057_476_57476983_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_503_57503702_qa_1/environment/bootstrap.sh b/tasks/0057_503_57503702_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_503_57503702_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_503_57503702_qa_1/environment/pull_bucket.py b/tasks/0057_503_57503702_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_503_57503702_qa_1/environment/pull_bucket.py +++ b/tasks/0057_503_57503702_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_503_57503702_qa_1/task.toml b/tasks/0057_503_57503702_qa_1/task.toml index b9c108cb8488dab6c59feee21e1402804faa2264..3a75584686ef1d6676fb1b39a95bc15d5feac5a2 100644 --- a/tasks/0057_503_57503702_qa_1/task.toml +++ b/tasks/0057_503_57503702_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_588_57588445_qa_1/environment/bootstrap.sh b/tasks/0057_588_57588445_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_588_57588445_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_588_57588445_qa_1/environment/pull_bucket.py b/tasks/0057_588_57588445_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_588_57588445_qa_1/environment/pull_bucket.py +++ b/tasks/0057_588_57588445_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_588_57588445_qa_1/task.toml b/tasks/0057_588_57588445_qa_1/task.toml index 44834f4a1bac62ab8861f4b49b0a4c3c05d2c8c7..0a159ef8bd31c9e82b7a5fbf35081ae5911adb51 100644 --- a/tasks/0057_588_57588445_qa_1/task.toml +++ b/tasks/0057_588_57588445_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_588_57588445_qa_2/environment/bootstrap.sh b/tasks/0057_588_57588445_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_588_57588445_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_588_57588445_qa_2/environment/pull_bucket.py b/tasks/0057_588_57588445_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_588_57588445_qa_2/environment/pull_bucket.py +++ b/tasks/0057_588_57588445_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_588_57588445_qa_2/task.toml b/tasks/0057_588_57588445_qa_2/task.toml index 1c78ec87252069e154ab6ba0ce2174220b6dddaf..dfa11b8e8c4d40ddfb659636b56b3a8b438d4843 100644 --- a/tasks/0057_588_57588445_qa_2/task.toml +++ b/tasks/0057_588_57588445_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_589_57589842_qa_4/environment/bootstrap.sh b/tasks/0057_589_57589842_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_589_57589842_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_589_57589842_qa_4/environment/pull_bucket.py b/tasks/0057_589_57589842_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_589_57589842_qa_4/environment/pull_bucket.py +++ b/tasks/0057_589_57589842_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_589_57589842_qa_4/task.toml b/tasks/0057_589_57589842_qa_4/task.toml index c3ef41feee623ec9a6121ecc58f20a70ae34e0c3..97e67acd1c09c7ce5daefe367e728856dce168ce 100644 --- a/tasks/0057_589_57589842_qa_4/task.toml +++ b/tasks/0057_589_57589842_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_632_57632820_qa_1/environment/bootstrap.sh b/tasks/0057_632_57632820_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_632_57632820_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_632_57632820_qa_1/environment/pull_bucket.py b/tasks/0057_632_57632820_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_632_57632820_qa_1/environment/pull_bucket.py +++ b/tasks/0057_632_57632820_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_632_57632820_qa_1/task.toml b/tasks/0057_632_57632820_qa_1/task.toml index 9959f87fc2fb8b51a222030729603864a6229d1d..1c51d287b459097f2828d627abc9b4d54250d20a 100644 --- a/tasks/0057_632_57632820_qa_1/task.toml +++ b/tasks/0057_632_57632820_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_632_57632820_qa_4/environment/bootstrap.sh b/tasks/0057_632_57632820_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_632_57632820_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_632_57632820_qa_4/environment/pull_bucket.py b/tasks/0057_632_57632820_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_632_57632820_qa_4/environment/pull_bucket.py +++ b/tasks/0057_632_57632820_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_632_57632820_qa_4/task.toml b/tasks/0057_632_57632820_qa_4/task.toml index 021bed770862f5e0e8d1f003b4173fd7e86e0f19..7e2203f546e106fcdbf6c9addd8afa2390287bf6 100644 --- a/tasks/0057_632_57632820_qa_4/task.toml +++ b/tasks/0057_632_57632820_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_632_57632820_qa_5/environment/bootstrap.sh b/tasks/0057_632_57632820_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_632_57632820_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_632_57632820_qa_5/environment/pull_bucket.py b/tasks/0057_632_57632820_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_632_57632820_qa_5/environment/pull_bucket.py +++ b/tasks/0057_632_57632820_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_632_57632820_qa_5/task.toml b/tasks/0057_632_57632820_qa_5/task.toml index 2edec2c7222d9f13d5a9fdb6485c8b82003d68bf..b1992a3c03fcbd37b72438dc3d2839784fa9f5a6 100644 --- a/tasks/0057_632_57632820_qa_5/task.toml +++ b/tasks/0057_632_57632820_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_639_57639553_qa_5/environment/bootstrap.sh b/tasks/0057_639_57639553_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_639_57639553_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_639_57639553_qa_5/environment/pull_bucket.py b/tasks/0057_639_57639553_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_639_57639553_qa_5/environment/pull_bucket.py +++ b/tasks/0057_639_57639553_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_639_57639553_qa_5/task.toml b/tasks/0057_639_57639553_qa_5/task.toml index 853c3878c9242a4935244bce66a9ab5011fe6c06..1264bcd0a371100c799e0881ddfd4ae566b35b7d 100644 --- a/tasks/0057_639_57639553_qa_5/task.toml +++ b/tasks/0057_639_57639553_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_640_57640669_qa_4/environment/bootstrap.sh b/tasks/0057_640_57640669_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_640_57640669_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_640_57640669_qa_4/environment/pull_bucket.py b/tasks/0057_640_57640669_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_640_57640669_qa_4/environment/pull_bucket.py +++ b/tasks/0057_640_57640669_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_640_57640669_qa_4/task.toml b/tasks/0057_640_57640669_qa_4/task.toml index efbc0f28cda736bce9085d54f677232ac301be86..6b5936c65f2c890b381996198b0acdcb799cbad6 100644 --- a/tasks/0057_640_57640669_qa_4/task.toml +++ b/tasks/0057_640_57640669_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_663_57663047_qa_2/environment/bootstrap.sh b/tasks/0057_663_57663047_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_663_57663047_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_663_57663047_qa_2/environment/pull_bucket.py b/tasks/0057_663_57663047_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_663_57663047_qa_2/environment/pull_bucket.py +++ b/tasks/0057_663_57663047_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_663_57663047_qa_2/task.toml b/tasks/0057_663_57663047_qa_2/task.toml index 970516021f088dc1f2cbfdc64b454d307d937f90..34bae1a16ef8c086c3738b01eb4e0e6e090accf3 100644 --- a/tasks/0057_663_57663047_qa_2/task.toml +++ b/tasks/0057_663_57663047_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_663_57663047_qa_5/environment/bootstrap.sh b/tasks/0057_663_57663047_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_663_57663047_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_663_57663047_qa_5/environment/pull_bucket.py b/tasks/0057_663_57663047_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_663_57663047_qa_5/environment/pull_bucket.py +++ b/tasks/0057_663_57663047_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_663_57663047_qa_5/task.toml b/tasks/0057_663_57663047_qa_5/task.toml index 03fa9edf8d6ab178096ede9f61bcfe1a6aa7475d..683c362e5067a24a4449abbd05db054e9f4387ce 100644 --- a/tasks/0057_663_57663047_qa_5/task.toml +++ b/tasks/0057_663_57663047_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_686_57686190_qa_1/environment/bootstrap.sh b/tasks/0057_686_57686190_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_686_57686190_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_686_57686190_qa_1/environment/pull_bucket.py b/tasks/0057_686_57686190_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_686_57686190_qa_1/environment/pull_bucket.py +++ b/tasks/0057_686_57686190_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_686_57686190_qa_1/task.toml b/tasks/0057_686_57686190_qa_1/task.toml index 7726db3d27097e5e87e38f6a096700d74f87ad86..6a274d985f184bdcbdc1c3e4e1891e6cdf1ed0b7 100644 --- a/tasks/0057_686_57686190_qa_1/task.toml +++ b/tasks/0057_686_57686190_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_712_57712524_qa_2/environment/bootstrap.sh b/tasks/0057_712_57712524_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_712_57712524_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_712_57712524_qa_2/environment/pull_bucket.py b/tasks/0057_712_57712524_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_712_57712524_qa_2/environment/pull_bucket.py +++ b/tasks/0057_712_57712524_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_712_57712524_qa_2/task.toml b/tasks/0057_712_57712524_qa_2/task.toml index ebe392a707757dba772abde53899bda52b25d6c7..3f58328fe979d73e750253089356f35c06351878 100644 --- a/tasks/0057_712_57712524_qa_2/task.toml +++ b/tasks/0057_712_57712524_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_712_57712524_qa_4/environment/bootstrap.sh b/tasks/0057_712_57712524_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_712_57712524_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_712_57712524_qa_4/environment/pull_bucket.py b/tasks/0057_712_57712524_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_712_57712524_qa_4/environment/pull_bucket.py +++ b/tasks/0057_712_57712524_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_712_57712524_qa_4/task.toml b/tasks/0057_712_57712524_qa_4/task.toml index de1fc7c442d8ded3fb5d8f8f3f94ede48a3c9576..73c6159b43c3fd08f2921a7407708906bf748ad7 100644 --- a/tasks/0057_712_57712524_qa_4/task.toml +++ b/tasks/0057_712_57712524_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_712_57712524_qa_5/environment/bootstrap.sh b/tasks/0057_712_57712524_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_712_57712524_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_712_57712524_qa_5/environment/pull_bucket.py b/tasks/0057_712_57712524_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_712_57712524_qa_5/environment/pull_bucket.py +++ b/tasks/0057_712_57712524_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_712_57712524_qa_5/task.toml b/tasks/0057_712_57712524_qa_5/task.toml index 6ee99e9bb0fae13adbf2666ced0a5273c930a068..8207782de0786ba138b3e517e8407a590a4c4a2f 100644 --- a/tasks/0057_712_57712524_qa_5/task.toml +++ b/tasks/0057_712_57712524_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_721_57721830_qa_1/environment/bootstrap.sh b/tasks/0057_721_57721830_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_721_57721830_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_721_57721830_qa_1/environment/pull_bucket.py b/tasks/0057_721_57721830_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_721_57721830_qa_1/environment/pull_bucket.py +++ b/tasks/0057_721_57721830_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_721_57721830_qa_1/task.toml b/tasks/0057_721_57721830_qa_1/task.toml index f8c5099b843fb2d976cc4b584e952776c2134ba5..2e6ec3f3f09f7a4571171fda8fb9c30cd9824f02 100644 --- a/tasks/0057_721_57721830_qa_1/task.toml +++ b/tasks/0057_721_57721830_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_750_57750345_qa_5/environment/bootstrap.sh b/tasks/0057_750_57750345_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_750_57750345_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_750_57750345_qa_5/environment/pull_bucket.py b/tasks/0057_750_57750345_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_750_57750345_qa_5/environment/pull_bucket.py +++ b/tasks/0057_750_57750345_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_750_57750345_qa_5/task.toml b/tasks/0057_750_57750345_qa_5/task.toml index d25d71c6e141ad9545ced2721c4b12ba6619d8ff..7b5751c7e1a34ee6c08c7b3e833ebc6e47cc5955 100644 --- a/tasks/0057_750_57750345_qa_5/task.toml +++ b/tasks/0057_750_57750345_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_771_57771025_qa_3/environment/bootstrap.sh b/tasks/0057_771_57771025_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_771_57771025_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_771_57771025_qa_3/environment/pull_bucket.py b/tasks/0057_771_57771025_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_771_57771025_qa_3/environment/pull_bucket.py +++ b/tasks/0057_771_57771025_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_771_57771025_qa_3/task.toml b/tasks/0057_771_57771025_qa_3/task.toml index 46ae1de0fe2fabde42480ae3b4ce00417c2a507f..a3d5dd85aa47b610f153948dc87c81ba5002119a 100644 --- a/tasks/0057_771_57771025_qa_3/task.toml +++ b/tasks/0057_771_57771025_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_778_57778333_qa_1/environment/bootstrap.sh b/tasks/0057_778_57778333_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_778_57778333_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_778_57778333_qa_1/environment/pull_bucket.py b/tasks/0057_778_57778333_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_778_57778333_qa_1/environment/pull_bucket.py +++ b/tasks/0057_778_57778333_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_778_57778333_qa_1/task.toml b/tasks/0057_778_57778333_qa_1/task.toml index aadab2237c8045b36225e417b7484fb780e966a9..fb3256b2d139fd9cda9023d306d83308f4b198fb 100644 --- a/tasks/0057_778_57778333_qa_1/task.toml +++ b/tasks/0057_778_57778333_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_778_57778333_qa_3/environment/bootstrap.sh b/tasks/0057_778_57778333_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_778_57778333_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_778_57778333_qa_3/environment/pull_bucket.py b/tasks/0057_778_57778333_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_778_57778333_qa_3/environment/pull_bucket.py +++ b/tasks/0057_778_57778333_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_778_57778333_qa_3/task.toml b/tasks/0057_778_57778333_qa_3/task.toml index 95aa54d11107f8392caaa2fcdb60f466ded8ca5b..ff1ca7d971884f921d966c97d4ee2c4358472a96 100644 --- a/tasks/0057_778_57778333_qa_3/task.toml +++ b/tasks/0057_778_57778333_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_778_57778333_qa_5/environment/bootstrap.sh b/tasks/0057_778_57778333_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_778_57778333_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_778_57778333_qa_5/environment/pull_bucket.py b/tasks/0057_778_57778333_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_778_57778333_qa_5/environment/pull_bucket.py +++ b/tasks/0057_778_57778333_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_778_57778333_qa_5/task.toml b/tasks/0057_778_57778333_qa_5/task.toml index 410ee417877258db6bdb12b70c532bcfa922c7d4..db280006b7b2290463d4b85799d00b553def437f 100644 --- a/tasks/0057_778_57778333_qa_5/task.toml +++ b/tasks/0057_778_57778333_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_851_57851395_qa_1/environment/bootstrap.sh b/tasks/0057_851_57851395_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_851_57851395_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_851_57851395_qa_1/environment/pull_bucket.py b/tasks/0057_851_57851395_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_851_57851395_qa_1/environment/pull_bucket.py +++ b/tasks/0057_851_57851395_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_851_57851395_qa_1/task.toml b/tasks/0057_851_57851395_qa_1/task.toml index bf7e243c43f343d4fa8cc296553a7ea8e6c9fdf3..75f315b424b462d461b5daaa615353fe1daae257 100644 --- a/tasks/0057_851_57851395_qa_1/task.toml +++ b/tasks/0057_851_57851395_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_851_57851395_qa_2/environment/bootstrap.sh b/tasks/0057_851_57851395_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_851_57851395_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_851_57851395_qa_2/environment/pull_bucket.py b/tasks/0057_851_57851395_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_851_57851395_qa_2/environment/pull_bucket.py +++ b/tasks/0057_851_57851395_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_851_57851395_qa_2/task.toml b/tasks/0057_851_57851395_qa_2/task.toml index 2795b350e133a40795dfa656892c4c55e2e6f460..976b1080649ce773a7e31eea859efe59edc44024 100644 --- a/tasks/0057_851_57851395_qa_2/task.toml +++ b/tasks/0057_851_57851395_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_915_57915748_qa_2/environment/bootstrap.sh b/tasks/0057_915_57915748_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_915_57915748_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_915_57915748_qa_2/environment/pull_bucket.py b/tasks/0057_915_57915748_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_915_57915748_qa_2/environment/pull_bucket.py +++ b/tasks/0057_915_57915748_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_915_57915748_qa_2/task.toml b/tasks/0057_915_57915748_qa_2/task.toml index 83638c65fcb7209a3ae36335dbadcaeb762b8a85..0c4884076adb7d1fe90fa30450af185c81e54b38 100644 --- a/tasks/0057_915_57915748_qa_2/task.toml +++ b/tasks/0057_915_57915748_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_925_57925686_qa_2/environment/bootstrap.sh b/tasks/0057_925_57925686_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_925_57925686_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_925_57925686_qa_2/environment/pull_bucket.py b/tasks/0057_925_57925686_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_925_57925686_qa_2/environment/pull_bucket.py +++ b/tasks/0057_925_57925686_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_925_57925686_qa_2/task.toml b/tasks/0057_925_57925686_qa_2/task.toml index e8cfd49476e405cdbe8e7989c898cc1e7267ce14..26feef9507a825396fff5207295e5fc3a6e55e44 100644 --- a/tasks/0057_925_57925686_qa_2/task.toml +++ b/tasks/0057_925_57925686_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0057_935_57935595_qa_2/environment/bootstrap.sh b/tasks/0057_935_57935595_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0057_935_57935595_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0057_935_57935595_qa_2/environment/pull_bucket.py b/tasks/0057_935_57935595_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0057_935_57935595_qa_2/environment/pull_bucket.py +++ b/tasks/0057_935_57935595_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0057_935_57935595_qa_2/task.toml b/tasks/0057_935_57935595_qa_2/task.toml index 623aa85721e414ad5c5db3dc704f93bbabcd9866..666bf0d7e6e3bdcf043c39affc29a0d2bbe00e18 100644 --- a/tasks/0057_935_57935595_qa_2/task.toml +++ b/tasks/0057_935_57935595_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_072_58072089_qa_2/environment/bootstrap.sh b/tasks/0058_072_58072089_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_072_58072089_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_072_58072089_qa_2/environment/pull_bucket.py b/tasks/0058_072_58072089_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_072_58072089_qa_2/environment/pull_bucket.py +++ b/tasks/0058_072_58072089_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_072_58072089_qa_2/task.toml b/tasks/0058_072_58072089_qa_2/task.toml index 911412a7f8fcaa4f8383c626b78a5a4012aac6db..fdbe1fc5b1eb04ac92d455b3712c06258b772682 100644 --- a/tasks/0058_072_58072089_qa_2/task.toml +++ b/tasks/0058_072_58072089_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_072_58072089_qa_5/environment/bootstrap.sh b/tasks/0058_072_58072089_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_072_58072089_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_072_58072089_qa_5/environment/pull_bucket.py b/tasks/0058_072_58072089_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_072_58072089_qa_5/environment/pull_bucket.py +++ b/tasks/0058_072_58072089_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_072_58072089_qa_5/task.toml b/tasks/0058_072_58072089_qa_5/task.toml index 7ab108dd5826c7a2953d7f42d533e9e8f79b12e3..c2ab14cd05581df2836b7657c731f36e9acabd9a 100644 --- a/tasks/0058_072_58072089_qa_5/task.toml +++ b/tasks/0058_072_58072089_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_169_58169113_qa_2/environment/bootstrap.sh b/tasks/0058_169_58169113_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_169_58169113_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_169_58169113_qa_2/environment/pull_bucket.py b/tasks/0058_169_58169113_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_169_58169113_qa_2/environment/pull_bucket.py +++ b/tasks/0058_169_58169113_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_169_58169113_qa_2/task.toml b/tasks/0058_169_58169113_qa_2/task.toml index 053cb6c57d657643eb81fded4dce10312e8f0d71..d38f69e16bd968b324078dbd5547fc861321ac75 100644 --- a/tasks/0058_169_58169113_qa_2/task.toml +++ b/tasks/0058_169_58169113_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_169_58169113_qa_4/environment/bootstrap.sh b/tasks/0058_169_58169113_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_169_58169113_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_169_58169113_qa_4/environment/pull_bucket.py b/tasks/0058_169_58169113_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_169_58169113_qa_4/environment/pull_bucket.py +++ b/tasks/0058_169_58169113_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_169_58169113_qa_4/task.toml b/tasks/0058_169_58169113_qa_4/task.toml index 9d037bf015a0760435169f69cc71efee98cb5acd..06f8705953e915cb574a5544706ad5821c6c7d3c 100644 --- a/tasks/0058_169_58169113_qa_4/task.toml +++ b/tasks/0058_169_58169113_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_175_58175407_qa_5/environment/bootstrap.sh b/tasks/0058_175_58175407_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_175_58175407_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_175_58175407_qa_5/environment/pull_bucket.py b/tasks/0058_175_58175407_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_175_58175407_qa_5/environment/pull_bucket.py +++ b/tasks/0058_175_58175407_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_175_58175407_qa_5/task.toml b/tasks/0058_175_58175407_qa_5/task.toml index d06326ac307d43349fbcc7645ded867cd17663d0..238d08273f4c0d0a131bca86113b236a0b814bc8 100644 --- a/tasks/0058_175_58175407_qa_5/task.toml +++ b/tasks/0058_175_58175407_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_175_58175546_qa_3/environment/bootstrap.sh b/tasks/0058_175_58175546_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_175_58175546_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_175_58175546_qa_3/environment/pull_bucket.py b/tasks/0058_175_58175546_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_175_58175546_qa_3/environment/pull_bucket.py +++ b/tasks/0058_175_58175546_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_175_58175546_qa_3/task.toml b/tasks/0058_175_58175546_qa_3/task.toml index dc9459aeb03fac3b2be5a9a417fe3c72e18225f5..604dbe5c157cca717dcc4457950d74063312c26b 100644 --- a/tasks/0058_175_58175546_qa_3/task.toml +++ b/tasks/0058_175_58175546_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_240_58240435_qa_1/environment/bootstrap.sh b/tasks/0058_240_58240435_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_240_58240435_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_240_58240435_qa_1/environment/pull_bucket.py b/tasks/0058_240_58240435_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_240_58240435_qa_1/environment/pull_bucket.py +++ b/tasks/0058_240_58240435_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_240_58240435_qa_1/task.toml b/tasks/0058_240_58240435_qa_1/task.toml index 7ffd76dfa1be92009712c4318b70a2f176fdd56c..1df4fc39fe84a466723c3089e8a2ea88b090cacf 100644 --- a/tasks/0058_240_58240435_qa_1/task.toml +++ b/tasks/0058_240_58240435_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_272_58272349_qa_4/environment/bootstrap.sh b/tasks/0058_272_58272349_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_272_58272349_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_272_58272349_qa_4/environment/pull_bucket.py b/tasks/0058_272_58272349_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_272_58272349_qa_4/environment/pull_bucket.py +++ b/tasks/0058_272_58272349_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_272_58272349_qa_4/task.toml b/tasks/0058_272_58272349_qa_4/task.toml index 9f9ec0fc694d50ba027ad533ba7a924a871cd339..d453fc546fd2b6fb361999900fe0d00131b944bb 100644 --- a/tasks/0058_272_58272349_qa_4/task.toml +++ b/tasks/0058_272_58272349_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_275_58275852_qa_3/environment/bootstrap.sh b/tasks/0058_275_58275852_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_275_58275852_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_275_58275852_qa_3/environment/pull_bucket.py b/tasks/0058_275_58275852_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_275_58275852_qa_3/environment/pull_bucket.py +++ b/tasks/0058_275_58275852_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_275_58275852_qa_3/task.toml b/tasks/0058_275_58275852_qa_3/task.toml index 985ffc18bccfcaaf0c57dcdba6904c6cbc05a3b7..a564b5d8b38bec52209bcad3f3c5d8379b1b54ef 100644 --- a/tasks/0058_275_58275852_qa_3/task.toml +++ b/tasks/0058_275_58275852_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_378_58378917_qa_2/environment/bootstrap.sh b/tasks/0058_378_58378917_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_378_58378917_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_378_58378917_qa_2/environment/pull_bucket.py b/tasks/0058_378_58378917_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_378_58378917_qa_2/environment/pull_bucket.py +++ b/tasks/0058_378_58378917_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_378_58378917_qa_2/task.toml b/tasks/0058_378_58378917_qa_2/task.toml index d7cb02508374687222ae287485989d7287ecad42..7bcae4b29c07648fa7ab4eb99dbabc1ce113ae10 100644 --- a/tasks/0058_378_58378917_qa_2/task.toml +++ b/tasks/0058_378_58378917_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_378_58378917_qa_4/environment/bootstrap.sh b/tasks/0058_378_58378917_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_378_58378917_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_378_58378917_qa_4/environment/pull_bucket.py b/tasks/0058_378_58378917_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_378_58378917_qa_4/environment/pull_bucket.py +++ b/tasks/0058_378_58378917_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_378_58378917_qa_4/task.toml b/tasks/0058_378_58378917_qa_4/task.toml index 55e08b80c534d38658fe8b20cb7397f41156d761..275700ab96b1cb67f888e6cefe8b7f417197f2ff 100644 --- a/tasks/0058_378_58378917_qa_4/task.toml +++ b/tasks/0058_378_58378917_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_407_58407068_qa_1/environment/bootstrap.sh b/tasks/0058_407_58407068_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_407_58407068_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_407_58407068_qa_1/environment/pull_bucket.py b/tasks/0058_407_58407068_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_407_58407068_qa_1/environment/pull_bucket.py +++ b/tasks/0058_407_58407068_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_407_58407068_qa_1/task.toml b/tasks/0058_407_58407068_qa_1/task.toml index 0e9644ff6a0e5105b997bb90ce0f49898d1b0a7b..e358d0bec232988dbcffa7c6ff428892005489ab 100644 --- a/tasks/0058_407_58407068_qa_1/task.toml +++ b/tasks/0058_407_58407068_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_407_58407702_qa_5/environment/bootstrap.sh b/tasks/0058_407_58407702_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_407_58407702_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_407_58407702_qa_5/environment/pull_bucket.py b/tasks/0058_407_58407702_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_407_58407702_qa_5/environment/pull_bucket.py +++ b/tasks/0058_407_58407702_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_407_58407702_qa_5/task.toml b/tasks/0058_407_58407702_qa_5/task.toml index 79be624475d574840fb203cbee777e6c47ed9fef..f98cb91d450735c66acf9c19e1323ff2aaf9b9d1 100644 --- a/tasks/0058_407_58407702_qa_5/task.toml +++ b/tasks/0058_407_58407702_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_494_58494583_qa_2/environment/bootstrap.sh b/tasks/0058_494_58494583_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_494_58494583_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_494_58494583_qa_2/environment/pull_bucket.py b/tasks/0058_494_58494583_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_494_58494583_qa_2/environment/pull_bucket.py +++ b/tasks/0058_494_58494583_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_494_58494583_qa_2/task.toml b/tasks/0058_494_58494583_qa_2/task.toml index a35642261bf08ac1a9ad49509c6282ff57a0a039..45eca037a7f580883f8a3c12308cd7682acfd66c 100644 --- a/tasks/0058_494_58494583_qa_2/task.toml +++ b/tasks/0058_494_58494583_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_529_58529660_qa_3/environment/bootstrap.sh b/tasks/0058_529_58529660_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_529_58529660_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_529_58529660_qa_3/environment/pull_bucket.py b/tasks/0058_529_58529660_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_529_58529660_qa_3/environment/pull_bucket.py +++ b/tasks/0058_529_58529660_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_529_58529660_qa_3/task.toml b/tasks/0058_529_58529660_qa_3/task.toml index 4a67098fd2412daa4478fabe60be10f737d39ca4..d5ec4817d7cb7a0043df09da1f0f2ae2e8740529 100644 --- a/tasks/0058_529_58529660_qa_3/task.toml +++ b/tasks/0058_529_58529660_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_565_58565902_qa_1/environment/bootstrap.sh b/tasks/0058_565_58565902_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_565_58565902_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_565_58565902_qa_1/environment/pull_bucket.py b/tasks/0058_565_58565902_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_565_58565902_qa_1/environment/pull_bucket.py +++ b/tasks/0058_565_58565902_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_565_58565902_qa_1/task.toml b/tasks/0058_565_58565902_qa_1/task.toml index 221aec9e9a5be17968b72ba61cb71bf9510c8c65..3ddabc210ef92582456788f16b3b08d1632dc553 100644 --- a/tasks/0058_565_58565902_qa_1/task.toml +++ b/tasks/0058_565_58565902_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_565_58565902_qa_3/environment/bootstrap.sh b/tasks/0058_565_58565902_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_565_58565902_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_565_58565902_qa_3/environment/pull_bucket.py b/tasks/0058_565_58565902_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_565_58565902_qa_3/environment/pull_bucket.py +++ b/tasks/0058_565_58565902_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_565_58565902_qa_3/task.toml b/tasks/0058_565_58565902_qa_3/task.toml index cf939ef036e4dc89fa75371bef2b58a376457711..6f287f4b57a247209abb807503d1bb30f2954ea7 100644 --- a/tasks/0058_565_58565902_qa_3/task.toml +++ b/tasks/0058_565_58565902_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_641_58641810_qa_2/environment/bootstrap.sh b/tasks/0058_641_58641810_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_641_58641810_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_641_58641810_qa_2/environment/pull_bucket.py b/tasks/0058_641_58641810_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_641_58641810_qa_2/environment/pull_bucket.py +++ b/tasks/0058_641_58641810_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_641_58641810_qa_2/task.toml b/tasks/0058_641_58641810_qa_2/task.toml index 418f6a9467861cc5baa461ab7c37e7437614cd26..99ce79ff1755b5d54bb5a07c5190ea03bf3dc63a 100644 --- a/tasks/0058_641_58641810_qa_2/task.toml +++ b/tasks/0058_641_58641810_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_674_58674481_qa_1/environment/bootstrap.sh b/tasks/0058_674_58674481_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_674_58674481_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_674_58674481_qa_1/environment/pull_bucket.py b/tasks/0058_674_58674481_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_674_58674481_qa_1/environment/pull_bucket.py +++ b/tasks/0058_674_58674481_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_674_58674481_qa_1/task.toml b/tasks/0058_674_58674481_qa_1/task.toml index 3f683699a6192a248e510f477c892dc2877991dd..146ad5a037affe025c84d3f92815e1a8d658498c 100644 --- a/tasks/0058_674_58674481_qa_1/task.toml +++ b/tasks/0058_674_58674481_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_674_58674481_qa_2/environment/bootstrap.sh b/tasks/0058_674_58674481_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_674_58674481_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_674_58674481_qa_2/environment/pull_bucket.py b/tasks/0058_674_58674481_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_674_58674481_qa_2/environment/pull_bucket.py +++ b/tasks/0058_674_58674481_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_674_58674481_qa_2/task.toml b/tasks/0058_674_58674481_qa_2/task.toml index a1f7695741a6e019efbe3ef45ec6fb2ff828fc5d..0277a3f0703845ef03667fe85439623f9cb107bc 100644 --- a/tasks/0058_674_58674481_qa_2/task.toml +++ b/tasks/0058_674_58674481_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_705_58705525_qa_1/environment/bootstrap.sh b/tasks/0058_705_58705525_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_705_58705525_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_705_58705525_qa_1/environment/pull_bucket.py b/tasks/0058_705_58705525_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_705_58705525_qa_1/environment/pull_bucket.py +++ b/tasks/0058_705_58705525_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_705_58705525_qa_1/task.toml b/tasks/0058_705_58705525_qa_1/task.toml index 28e6bd469633b0a19b90a07c6b66a190b82dc8cf..c2e73915d34c058793932e75d69a8c46dfbc2487 100644 --- a/tasks/0058_705_58705525_qa_1/task.toml +++ b/tasks/0058_705_58705525_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_773_58773976_qa_2/environment/bootstrap.sh b/tasks/0058_773_58773976_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_773_58773976_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_773_58773976_qa_2/environment/pull_bucket.py b/tasks/0058_773_58773976_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_773_58773976_qa_2/environment/pull_bucket.py +++ b/tasks/0058_773_58773976_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_773_58773976_qa_2/task.toml b/tasks/0058_773_58773976_qa_2/task.toml index e3c598ed69f4b90985dcec3579b9b644671f5903..01abdacc82ec26ff3e72b7d4a15fa57eeb3dd72f 100644 --- a/tasks/0058_773_58773976_qa_2/task.toml +++ b/tasks/0058_773_58773976_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_792_58792477_qa_5/environment/bootstrap.sh b/tasks/0058_792_58792477_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_792_58792477_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_792_58792477_qa_5/environment/pull_bucket.py b/tasks/0058_792_58792477_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_792_58792477_qa_5/environment/pull_bucket.py +++ b/tasks/0058_792_58792477_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_792_58792477_qa_5/task.toml b/tasks/0058_792_58792477_qa_5/task.toml index 312ba3e075f2734330422abe068fd806d4cce115..bda9842682fb908a53ad9271dbc9319ef2003d3b 100644 --- a/tasks/0058_792_58792477_qa_5/task.toml +++ b/tasks/0058_792_58792477_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_797_58797016_qa_2/environment/bootstrap.sh b/tasks/0058_797_58797016_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_797_58797016_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_797_58797016_qa_2/environment/pull_bucket.py b/tasks/0058_797_58797016_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_797_58797016_qa_2/environment/pull_bucket.py +++ b/tasks/0058_797_58797016_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_797_58797016_qa_2/task.toml b/tasks/0058_797_58797016_qa_2/task.toml index 501782f88e010a4661cc148752bec353a6911f91..0a19a5699802861bbf3842d30a822355e4541702 100644 --- a/tasks/0058_797_58797016_qa_2/task.toml +++ b/tasks/0058_797_58797016_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_801_58801372_qa_2/environment/bootstrap.sh b/tasks/0058_801_58801372_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_801_58801372_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_801_58801372_qa_2/environment/pull_bucket.py b/tasks/0058_801_58801372_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_801_58801372_qa_2/environment/pull_bucket.py +++ b/tasks/0058_801_58801372_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_801_58801372_qa_2/task.toml b/tasks/0058_801_58801372_qa_2/task.toml index 7f51cb813ca1497ef2ae10239c1fd11d4b8a5448..573566e1563d1867a6a2a625fd5e653fdad320d1 100644 --- a/tasks/0058_801_58801372_qa_2/task.toml +++ b/tasks/0058_801_58801372_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_805_58805287_qa_2/environment/bootstrap.sh b/tasks/0058_805_58805287_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_805_58805287_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_805_58805287_qa_2/environment/pull_bucket.py b/tasks/0058_805_58805287_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_805_58805287_qa_2/environment/pull_bucket.py +++ b/tasks/0058_805_58805287_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_805_58805287_qa_2/task.toml b/tasks/0058_805_58805287_qa_2/task.toml index 162fea50b52e3cff7df60fe52d08344bf4117d1a..c88ab09b585e091a4344e4b5d5d1b7d7da45b23b 100644 --- a/tasks/0058_805_58805287_qa_2/task.toml +++ b/tasks/0058_805_58805287_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_806_58806875_qa_3/environment/bootstrap.sh b/tasks/0058_806_58806875_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_806_58806875_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_806_58806875_qa_3/environment/pull_bucket.py b/tasks/0058_806_58806875_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_806_58806875_qa_3/environment/pull_bucket.py +++ b/tasks/0058_806_58806875_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_806_58806875_qa_3/task.toml b/tasks/0058_806_58806875_qa_3/task.toml index ccbdbcf78b6abcbc7542c6a43fc593a710ecd53e..2c3ac9edca9c78302cbb26f9ac430eba1cd499ca 100644 --- a/tasks/0058_806_58806875_qa_3/task.toml +++ b/tasks/0058_806_58806875_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_806_58806875_qa_4/environment/bootstrap.sh b/tasks/0058_806_58806875_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_806_58806875_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_806_58806875_qa_4/environment/pull_bucket.py b/tasks/0058_806_58806875_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_806_58806875_qa_4/environment/pull_bucket.py +++ b/tasks/0058_806_58806875_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_806_58806875_qa_4/task.toml b/tasks/0058_806_58806875_qa_4/task.toml index a9c0cc239cb186b59e6baad5fe2ba126f6f8b2a6..7faa3c3a47723e51e99e01ffc8209d0e7ef1e2f3 100644 --- a/tasks/0058_806_58806875_qa_4/task.toml +++ b/tasks/0058_806_58806875_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0058_924_58924130_qa_1/environment/bootstrap.sh b/tasks/0058_924_58924130_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0058_924_58924130_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0058_924_58924130_qa_1/environment/pull_bucket.py b/tasks/0058_924_58924130_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0058_924_58924130_qa_1/environment/pull_bucket.py +++ b/tasks/0058_924_58924130_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0058_924_58924130_qa_1/task.toml b/tasks/0058_924_58924130_qa_1/task.toml index 8d3ad99e6a2ed252c1c30ad843b2ac6f4636a4b0..5cd8a81e8f5f4f78ac9c574cb3a2b491e912565b 100644 --- a/tasks/0058_924_58924130_qa_1/task.toml +++ b/tasks/0058_924_58924130_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_000_59000863_qa_2/environment/bootstrap.sh b/tasks/0059_000_59000863_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_000_59000863_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_000_59000863_qa_2/environment/pull_bucket.py b/tasks/0059_000_59000863_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_000_59000863_qa_2/environment/pull_bucket.py +++ b/tasks/0059_000_59000863_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_000_59000863_qa_2/task.toml b/tasks/0059_000_59000863_qa_2/task.toml index 360a99f944bf1cf3f13af0e283c40ab0f0b6cf42..7095eb17aa99503126859a794877733ecd437fee 100644 --- a/tasks/0059_000_59000863_qa_2/task.toml +++ b/tasks/0059_000_59000863_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_003_59003505_qa_4/environment/bootstrap.sh b/tasks/0059_003_59003505_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_003_59003505_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_003_59003505_qa_4/environment/pull_bucket.py b/tasks/0059_003_59003505_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_003_59003505_qa_4/environment/pull_bucket.py +++ b/tasks/0059_003_59003505_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_003_59003505_qa_4/task.toml b/tasks/0059_003_59003505_qa_4/task.toml index 4e3a9af36aa40ba8f17da660bc0a327df2590264..fc9f31e7d425983094a443a79825cce52622e814 100644 --- a/tasks/0059_003_59003505_qa_4/task.toml +++ b/tasks/0059_003_59003505_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_055_59055646_qa_1/environment/bootstrap.sh b/tasks/0059_055_59055646_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_055_59055646_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_055_59055646_qa_1/environment/pull_bucket.py b/tasks/0059_055_59055646_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_055_59055646_qa_1/environment/pull_bucket.py +++ b/tasks/0059_055_59055646_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_055_59055646_qa_1/task.toml b/tasks/0059_055_59055646_qa_1/task.toml index 2b3bd34d08e208ffc45fa08c073af8be8fa83fb4..d1f25d4778c058cc44903253fac32ba001482d57 100644 --- a/tasks/0059_055_59055646_qa_1/task.toml +++ b/tasks/0059_055_59055646_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_141_59141107_qa_1/environment/bootstrap.sh b/tasks/0059_141_59141107_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_141_59141107_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_141_59141107_qa_1/environment/pull_bucket.py b/tasks/0059_141_59141107_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_141_59141107_qa_1/environment/pull_bucket.py +++ b/tasks/0059_141_59141107_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_141_59141107_qa_1/task.toml b/tasks/0059_141_59141107_qa_1/task.toml index 5bc5b3772dc3b4aa7263207c7d14000f12936c61..d9e2fc573a425ed3444e8a76032975b5156b52b2 100644 --- a/tasks/0059_141_59141107_qa_1/task.toml +++ b/tasks/0059_141_59141107_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_141_59141107_qa_4/environment/bootstrap.sh b/tasks/0059_141_59141107_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_141_59141107_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_141_59141107_qa_4/environment/pull_bucket.py b/tasks/0059_141_59141107_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_141_59141107_qa_4/environment/pull_bucket.py +++ b/tasks/0059_141_59141107_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_141_59141107_qa_4/task.toml b/tasks/0059_141_59141107_qa_4/task.toml index 397b414c6aed4a52f33507f9b0ed1b61493ca84c..494e90920fab8877561f22a36935974c69cf7cdb 100644 --- a/tasks/0059_141_59141107_qa_4/task.toml +++ b/tasks/0059_141_59141107_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_268_59268311_qa_3/environment/bootstrap.sh b/tasks/0059_268_59268311_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_268_59268311_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_268_59268311_qa_3/environment/pull_bucket.py b/tasks/0059_268_59268311_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_268_59268311_qa_3/environment/pull_bucket.py +++ b/tasks/0059_268_59268311_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_268_59268311_qa_3/task.toml b/tasks/0059_268_59268311_qa_3/task.toml index 20b6326a823272fa130efdb6c07121c269603e10..ed45729a3130bb2065fe7ccb104de0b80c7404da 100644 --- a/tasks/0059_268_59268311_qa_3/task.toml +++ b/tasks/0059_268_59268311_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_268_59268311_qa_5/environment/bootstrap.sh b/tasks/0059_268_59268311_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_268_59268311_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_268_59268311_qa_5/environment/pull_bucket.py b/tasks/0059_268_59268311_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_268_59268311_qa_5/environment/pull_bucket.py +++ b/tasks/0059_268_59268311_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_268_59268311_qa_5/task.toml b/tasks/0059_268_59268311_qa_5/task.toml index ac75a7d7b8729a74e48073da38480aa81f4abcfc..d702a240ca1c9d5ee4e5fab60b81f3da848befb1 100644 --- a/tasks/0059_268_59268311_qa_5/task.toml +++ b/tasks/0059_268_59268311_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_292_59292943_qa_2/environment/bootstrap.sh b/tasks/0059_292_59292943_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_292_59292943_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_292_59292943_qa_2/environment/pull_bucket.py b/tasks/0059_292_59292943_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_292_59292943_qa_2/environment/pull_bucket.py +++ b/tasks/0059_292_59292943_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_292_59292943_qa_2/task.toml b/tasks/0059_292_59292943_qa_2/task.toml index 65f72ba3b3b9d63e82a8de7dd788ad9121291ea1..8bfc77ee3e7118171ab11d98cfae3c449fcac566 100644 --- a/tasks/0059_292_59292943_qa_2/task.toml +++ b/tasks/0059_292_59292943_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_341_59341953_qa_1/environment/bootstrap.sh b/tasks/0059_341_59341953_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_341_59341953_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_341_59341953_qa_1/environment/pull_bucket.py b/tasks/0059_341_59341953_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_341_59341953_qa_1/environment/pull_bucket.py +++ b/tasks/0059_341_59341953_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_341_59341953_qa_1/task.toml b/tasks/0059_341_59341953_qa_1/task.toml index 449308b95bb853c3c213d86bee8825167fd41501..147a6225edb14e3fccf885e1077f4889a438140a 100644 --- a/tasks/0059_341_59341953_qa_1/task.toml +++ b/tasks/0059_341_59341953_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_410_59410836_qa_1/environment/bootstrap.sh b/tasks/0059_410_59410836_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_410_59410836_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_410_59410836_qa_1/environment/pull_bucket.py b/tasks/0059_410_59410836_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_410_59410836_qa_1/environment/pull_bucket.py +++ b/tasks/0059_410_59410836_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_410_59410836_qa_1/task.toml b/tasks/0059_410_59410836_qa_1/task.toml index 5740d61452d06512e2b7df2b85bb40f056254977..0b98432ddd57d8eef6ec1c10abd468415c56cf0a 100644 --- a/tasks/0059_410_59410836_qa_1/task.toml +++ b/tasks/0059_410_59410836_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_425_59425314_qa_1/environment/bootstrap.sh b/tasks/0059_425_59425314_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_425_59425314_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_425_59425314_qa_1/environment/pull_bucket.py b/tasks/0059_425_59425314_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_425_59425314_qa_1/environment/pull_bucket.py +++ b/tasks/0059_425_59425314_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_425_59425314_qa_1/task.toml b/tasks/0059_425_59425314_qa_1/task.toml index ffa15d116e5d4d23294d4ba3245a9cc62c7504f7..2612481812e7ac2d94f964b58838be9444a92dd1 100644 --- a/tasks/0059_425_59425314_qa_1/task.toml +++ b/tasks/0059_425_59425314_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_425_59425314_qa_2/environment/bootstrap.sh b/tasks/0059_425_59425314_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_425_59425314_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_425_59425314_qa_2/environment/pull_bucket.py b/tasks/0059_425_59425314_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_425_59425314_qa_2/environment/pull_bucket.py +++ b/tasks/0059_425_59425314_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_425_59425314_qa_2/task.toml b/tasks/0059_425_59425314_qa_2/task.toml index b2308d9689f0a0ad13c32f267a8e1ff7fe4bff48..258c4226319868e1612c482a648fad6424db99b6 100644 --- a/tasks/0059_425_59425314_qa_2/task.toml +++ b/tasks/0059_425_59425314_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_452_59452642_qa_1/environment/bootstrap.sh b/tasks/0059_452_59452642_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_452_59452642_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_452_59452642_qa_1/environment/pull_bucket.py b/tasks/0059_452_59452642_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_452_59452642_qa_1/environment/pull_bucket.py +++ b/tasks/0059_452_59452642_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_452_59452642_qa_1/task.toml b/tasks/0059_452_59452642_qa_1/task.toml index 2b45ae72961bc13945cb568e2fa680ce941f8ed6..e29c3efca7a1b0814cad10c759b1eb949b6e4c49 100644 --- a/tasks/0059_452_59452642_qa_1/task.toml +++ b/tasks/0059_452_59452642_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_452_59452642_qa_3/environment/bootstrap.sh b/tasks/0059_452_59452642_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_452_59452642_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_452_59452642_qa_3/environment/pull_bucket.py b/tasks/0059_452_59452642_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_452_59452642_qa_3/environment/pull_bucket.py +++ b/tasks/0059_452_59452642_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_452_59452642_qa_3/task.toml b/tasks/0059_452_59452642_qa_3/task.toml index 03fd9ed5fed54d64b4d2d2480c29f74a5565d70f..391281d1124ae5f6775cd1dd888d8260070cb986 100644 --- a/tasks/0059_452_59452642_qa_3/task.toml +++ b/tasks/0059_452_59452642_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_470_59470070_qa_5/environment/bootstrap.sh b/tasks/0059_470_59470070_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_470_59470070_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_470_59470070_qa_5/environment/pull_bucket.py b/tasks/0059_470_59470070_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_470_59470070_qa_5/environment/pull_bucket.py +++ b/tasks/0059_470_59470070_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_470_59470070_qa_5/task.toml b/tasks/0059_470_59470070_qa_5/task.toml index 2a74cda5d76340861177078c388bb59352712246..732e5b33c5690dc1c4b04e0bb945e4e23129ddd3 100644 --- a/tasks/0059_470_59470070_qa_5/task.toml +++ b/tasks/0059_470_59470070_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_523_59523535_qa_3/environment/bootstrap.sh b/tasks/0059_523_59523535_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_523_59523535_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_523_59523535_qa_3/environment/pull_bucket.py b/tasks/0059_523_59523535_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_523_59523535_qa_3/environment/pull_bucket.py +++ b/tasks/0059_523_59523535_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_523_59523535_qa_3/task.toml b/tasks/0059_523_59523535_qa_3/task.toml index 008846b7f4f2825cb6b2e16c75292558f62d945a..f7fdc0ddf7ded9f992e85a448039db7fe721af75 100644 --- a/tasks/0059_523_59523535_qa_3/task.toml +++ b/tasks/0059_523_59523535_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_575_59575558_qa_3/environment/bootstrap.sh b/tasks/0059_575_59575558_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_575_59575558_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_575_59575558_qa_3/environment/pull_bucket.py b/tasks/0059_575_59575558_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_575_59575558_qa_3/environment/pull_bucket.py +++ b/tasks/0059_575_59575558_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_575_59575558_qa_3/task.toml b/tasks/0059_575_59575558_qa_3/task.toml index 6ca4b40719bc84e3ef888c026d7225223f9a0f90..f2382a8bdd65d933b2ccd144d0a9c62f33c596e6 100644 --- a/tasks/0059_575_59575558_qa_3/task.toml +++ b/tasks/0059_575_59575558_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_698_59698837_qa_3/environment/bootstrap.sh b/tasks/0059_698_59698837_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_698_59698837_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_698_59698837_qa_3/environment/pull_bucket.py b/tasks/0059_698_59698837_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_698_59698837_qa_3/environment/pull_bucket.py +++ b/tasks/0059_698_59698837_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_698_59698837_qa_3/task.toml b/tasks/0059_698_59698837_qa_3/task.toml index faa9b342edbce3d83110a71a23833ab686d69808..a06379bb43f289bd27df4f4e0b9cd1579737cf72 100644 --- a/tasks/0059_698_59698837_qa_3/task.toml +++ b/tasks/0059_698_59698837_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_844_59844912_qa_4/environment/bootstrap.sh b/tasks/0059_844_59844912_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_844_59844912_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_844_59844912_qa_4/environment/pull_bucket.py b/tasks/0059_844_59844912_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_844_59844912_qa_4/environment/pull_bucket.py +++ b/tasks/0059_844_59844912_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_844_59844912_qa_4/task.toml b/tasks/0059_844_59844912_qa_4/task.toml index f410e46beb753cf6e038296b9f1031b023ee9e94..de25ec27924c87c6444f01ec12f3c3821b56cfca 100644 --- a/tasks/0059_844_59844912_qa_4/task.toml +++ b/tasks/0059_844_59844912_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_844_59844912_qa_5/environment/bootstrap.sh b/tasks/0059_844_59844912_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_844_59844912_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_844_59844912_qa_5/environment/pull_bucket.py b/tasks/0059_844_59844912_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_844_59844912_qa_5/environment/pull_bucket.py +++ b/tasks/0059_844_59844912_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_844_59844912_qa_5/task.toml b/tasks/0059_844_59844912_qa_5/task.toml index 4be0e713ec6a89b7e04f6500cefe82fb3a46edb8..24c20f8ad9caaeb3dbc8a4c173f1a5abe6006d58 100644 --- a/tasks/0059_844_59844912_qa_5/task.toml +++ b/tasks/0059_844_59844912_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_858_59858896_qa_4/environment/bootstrap.sh b/tasks/0059_858_59858896_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_858_59858896_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_858_59858896_qa_4/environment/pull_bucket.py b/tasks/0059_858_59858896_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_858_59858896_qa_4/environment/pull_bucket.py +++ b/tasks/0059_858_59858896_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_858_59858896_qa_4/task.toml b/tasks/0059_858_59858896_qa_4/task.toml index 36e5f50190e361624d67b841def5309a4ba2c33f..3ea6e33b463a95ee93f17e66f106a8b78c3c53f2 100644 --- a/tasks/0059_858_59858896_qa_4/task.toml +++ b/tasks/0059_858_59858896_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_864_59864963_qa_3/environment/bootstrap.sh b/tasks/0059_864_59864963_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_864_59864963_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_864_59864963_qa_3/environment/pull_bucket.py b/tasks/0059_864_59864963_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_864_59864963_qa_3/environment/pull_bucket.py +++ b/tasks/0059_864_59864963_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_864_59864963_qa_3/task.toml b/tasks/0059_864_59864963_qa_3/task.toml index 1df3197c42a79755a7e914e97cc21f7594702735..65312c215cef60bc95f0a33f5145d0cd2df13d55 100644 --- a/tasks/0059_864_59864963_qa_3/task.toml +++ b/tasks/0059_864_59864963_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0059_918_59918276_qa_5/environment/bootstrap.sh b/tasks/0059_918_59918276_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0059_918_59918276_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0059_918_59918276_qa_5/environment/pull_bucket.py b/tasks/0059_918_59918276_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0059_918_59918276_qa_5/environment/pull_bucket.py +++ b/tasks/0059_918_59918276_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0059_918_59918276_qa_5/task.toml b/tasks/0059_918_59918276_qa_5/task.toml index 86f7f9aab14be0a61e8702a6d395722537f64a0e..89c8cfad907fba382cd0bf5d52cef21aa420677d 100644 --- a/tasks/0059_918_59918276_qa_5/task.toml +++ b/tasks/0059_918_59918276_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_044_60044614_qa_2/environment/bootstrap.sh b/tasks/0060_044_60044614_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_044_60044614_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_044_60044614_qa_2/environment/pull_bucket.py b/tasks/0060_044_60044614_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_044_60044614_qa_2/environment/pull_bucket.py +++ b/tasks/0060_044_60044614_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_044_60044614_qa_2/task.toml b/tasks/0060_044_60044614_qa_2/task.toml index 0864b0cbe2cdd6c7be800bb4f7bf20759ebe9c0e..964af4635d7f18fe33cb0238df18f27ff55dab1e 100644 --- a/tasks/0060_044_60044614_qa_2/task.toml +++ b/tasks/0060_044_60044614_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_059_60059192_qa_1/environment/bootstrap.sh b/tasks/0060_059_60059192_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_059_60059192_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_059_60059192_qa_1/environment/pull_bucket.py b/tasks/0060_059_60059192_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_059_60059192_qa_1/environment/pull_bucket.py +++ b/tasks/0060_059_60059192_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_059_60059192_qa_1/task.toml b/tasks/0060_059_60059192_qa_1/task.toml index 6f59394c76ea0b5708566ae13cfa7aa84c300f86..d36fe699cf8bc76a784709edc8cff1ff2d49ef30 100644 --- a/tasks/0060_059_60059192_qa_1/task.toml +++ b/tasks/0060_059_60059192_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_095_60095066_qa_1/environment/bootstrap.sh b/tasks/0060_095_60095066_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_095_60095066_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_095_60095066_qa_1/environment/pull_bucket.py b/tasks/0060_095_60095066_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_095_60095066_qa_1/environment/pull_bucket.py +++ b/tasks/0060_095_60095066_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_095_60095066_qa_1/task.toml b/tasks/0060_095_60095066_qa_1/task.toml index 7dfa6c31002304a2fd39f86b364db062aac3b785..021ec08c7e7f2b17fbb03a45801ea557ac42206c 100644 --- a/tasks/0060_095_60095066_qa_1/task.toml +++ b/tasks/0060_095_60095066_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_106_60106319_qa_1/environment/bootstrap.sh b/tasks/0060_106_60106319_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_106_60106319_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_106_60106319_qa_1/environment/pull_bucket.py b/tasks/0060_106_60106319_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_106_60106319_qa_1/environment/pull_bucket.py +++ b/tasks/0060_106_60106319_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_106_60106319_qa_1/task.toml b/tasks/0060_106_60106319_qa_1/task.toml index febf1eee88a3eb31b2370dc76f1c395f7c607ee0..2007ee4f0d3af18511af4a1d6cd1e32f61627f7a 100644 --- a/tasks/0060_106_60106319_qa_1/task.toml +++ b/tasks/0060_106_60106319_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_106_60106319_qa_2/environment/bootstrap.sh b/tasks/0060_106_60106319_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_106_60106319_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_106_60106319_qa_2/environment/pull_bucket.py b/tasks/0060_106_60106319_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_106_60106319_qa_2/environment/pull_bucket.py +++ b/tasks/0060_106_60106319_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_106_60106319_qa_2/task.toml b/tasks/0060_106_60106319_qa_2/task.toml index 7ad30de653791f19ec53ed0d21c8a13f10390bd5..1d3b5b81be0d03505ef43825e788a4f0b733cabb 100644 --- a/tasks/0060_106_60106319_qa_2/task.toml +++ b/tasks/0060_106_60106319_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_106_60106319_qa_4/environment/bootstrap.sh b/tasks/0060_106_60106319_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_106_60106319_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_106_60106319_qa_4/environment/pull_bucket.py b/tasks/0060_106_60106319_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_106_60106319_qa_4/environment/pull_bucket.py +++ b/tasks/0060_106_60106319_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_106_60106319_qa_4/task.toml b/tasks/0060_106_60106319_qa_4/task.toml index 0f1ac9d3153a53b4c0f12f1e90cf47bc2b12889a..20201f5d3bcdba5d33c7529c54c5937f6aa937d7 100644 --- a/tasks/0060_106_60106319_qa_4/task.toml +++ b/tasks/0060_106_60106319_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_157_60157882_qa_1/environment/bootstrap.sh b/tasks/0060_157_60157882_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_157_60157882_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_157_60157882_qa_1/environment/pull_bucket.py b/tasks/0060_157_60157882_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_157_60157882_qa_1/environment/pull_bucket.py +++ b/tasks/0060_157_60157882_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_157_60157882_qa_1/task.toml b/tasks/0060_157_60157882_qa_1/task.toml index 693cdf7d72d2a463cd28cc5fd34d1399848c0937..505e5fb6f7db1ee6dc5982292d3c47938d046e54 100644 --- a/tasks/0060_157_60157882_qa_1/task.toml +++ b/tasks/0060_157_60157882_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_211_60211356_qa_1/environment/bootstrap.sh b/tasks/0060_211_60211356_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_211_60211356_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_211_60211356_qa_1/environment/pull_bucket.py b/tasks/0060_211_60211356_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_211_60211356_qa_1/environment/pull_bucket.py +++ b/tasks/0060_211_60211356_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_211_60211356_qa_1/task.toml b/tasks/0060_211_60211356_qa_1/task.toml index d375ddcd6bfb156a402ca4ade712c6a7f70ad5cd..39056839fd1a366cfaf272458a9b74e7f7d5a9e2 100644 --- a/tasks/0060_211_60211356_qa_1/task.toml +++ b/tasks/0060_211_60211356_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_220_60220408_qa_3/environment/bootstrap.sh b/tasks/0060_220_60220408_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_220_60220408_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_220_60220408_qa_3/environment/pull_bucket.py b/tasks/0060_220_60220408_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_220_60220408_qa_3/environment/pull_bucket.py +++ b/tasks/0060_220_60220408_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_220_60220408_qa_3/task.toml b/tasks/0060_220_60220408_qa_3/task.toml index c182584acd5dfab552ff1785a8e8220fcdbbaa4e..4f43ce01f287fcbaf91fbde8692cdda3511e3cbe 100644 --- a/tasks/0060_220_60220408_qa_3/task.toml +++ b/tasks/0060_220_60220408_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_239_60239619_qa_4/environment/bootstrap.sh b/tasks/0060_239_60239619_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_239_60239619_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_239_60239619_qa_4/environment/pull_bucket.py b/tasks/0060_239_60239619_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_239_60239619_qa_4/environment/pull_bucket.py +++ b/tasks/0060_239_60239619_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_239_60239619_qa_4/task.toml b/tasks/0060_239_60239619_qa_4/task.toml index 83aed3ac82bb99f55239f8d05953382562e467a5..6a10272c96116d22a8d40394eff3e329aa3f0545 100644 --- a/tasks/0060_239_60239619_qa_4/task.toml +++ b/tasks/0060_239_60239619_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_240_60240221_qa_2/environment/bootstrap.sh b/tasks/0060_240_60240221_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_240_60240221_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_240_60240221_qa_2/environment/pull_bucket.py b/tasks/0060_240_60240221_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_240_60240221_qa_2/environment/pull_bucket.py +++ b/tasks/0060_240_60240221_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_240_60240221_qa_2/task.toml b/tasks/0060_240_60240221_qa_2/task.toml index de469cb5bb44698e584372879a962ace0c765fd6..7cad8458ae71352a754fd59d9e9581ec8a07c3d3 100644 --- a/tasks/0060_240_60240221_qa_2/task.toml +++ b/tasks/0060_240_60240221_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_240_60240221_qa_3/environment/bootstrap.sh b/tasks/0060_240_60240221_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_240_60240221_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_240_60240221_qa_3/environment/pull_bucket.py b/tasks/0060_240_60240221_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_240_60240221_qa_3/environment/pull_bucket.py +++ b/tasks/0060_240_60240221_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_240_60240221_qa_3/task.toml b/tasks/0060_240_60240221_qa_3/task.toml index 9abe3b2094afa537b4dc73672001c147d63c565e..5bf14d936d85405c42f95d885abc5e39c3be5833 100644 --- a/tasks/0060_240_60240221_qa_3/task.toml +++ b/tasks/0060_240_60240221_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_299_60299194_qa_5/environment/bootstrap.sh b/tasks/0060_299_60299194_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_299_60299194_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_299_60299194_qa_5/environment/pull_bucket.py b/tasks/0060_299_60299194_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_299_60299194_qa_5/environment/pull_bucket.py +++ b/tasks/0060_299_60299194_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_299_60299194_qa_5/task.toml b/tasks/0060_299_60299194_qa_5/task.toml index cf3105f89746ea6e36d422122e5d0ac881b0d257..4adf49edb840cc0177645a2fe3be2f375acd660a 100644 --- a/tasks/0060_299_60299194_qa_5/task.toml +++ b/tasks/0060_299_60299194_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_331_60331255_qa_2/environment/bootstrap.sh b/tasks/0060_331_60331255_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_331_60331255_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_331_60331255_qa_2/environment/pull_bucket.py b/tasks/0060_331_60331255_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_331_60331255_qa_2/environment/pull_bucket.py +++ b/tasks/0060_331_60331255_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_331_60331255_qa_2/task.toml b/tasks/0060_331_60331255_qa_2/task.toml index 5919ab97c63edee86a414b4c264ab6824e14cd1e..5c9e88e2b7d42d243a1bc6e93f6c5dab50b34496 100644 --- a/tasks/0060_331_60331255_qa_2/task.toml +++ b/tasks/0060_331_60331255_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_331_60331255_qa_3/environment/bootstrap.sh b/tasks/0060_331_60331255_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_331_60331255_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_331_60331255_qa_3/environment/pull_bucket.py b/tasks/0060_331_60331255_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_331_60331255_qa_3/environment/pull_bucket.py +++ b/tasks/0060_331_60331255_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_331_60331255_qa_3/task.toml b/tasks/0060_331_60331255_qa_3/task.toml index 904148c49c257545d2321bc8a01112302d81c370..432bb0ce52407657face55e2421496d770740cfa 100644 --- a/tasks/0060_331_60331255_qa_3/task.toml +++ b/tasks/0060_331_60331255_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_331_60331255_qa_4/environment/bootstrap.sh b/tasks/0060_331_60331255_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_331_60331255_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_331_60331255_qa_4/environment/pull_bucket.py b/tasks/0060_331_60331255_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_331_60331255_qa_4/environment/pull_bucket.py +++ b/tasks/0060_331_60331255_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_331_60331255_qa_4/task.toml b/tasks/0060_331_60331255_qa_4/task.toml index 45413159103f7e04cce435bcf737e7fbe4238e12..ffbd8b39b0aa80563c178a8bfe8de85d1393673f 100644 --- a/tasks/0060_331_60331255_qa_4/task.toml +++ b/tasks/0060_331_60331255_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_333_60333012_qa_1/environment/bootstrap.sh b/tasks/0060_333_60333012_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_333_60333012_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_333_60333012_qa_1/environment/pull_bucket.py b/tasks/0060_333_60333012_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_333_60333012_qa_1/environment/pull_bucket.py +++ b/tasks/0060_333_60333012_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_333_60333012_qa_1/task.toml b/tasks/0060_333_60333012_qa_1/task.toml index bf7ba8516cf508c86fcabe3ce0dd3c6ab0007e78..26533e1d435418ff386904a2fcef43de373f1479 100644 --- a/tasks/0060_333_60333012_qa_1/task.toml +++ b/tasks/0060_333_60333012_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_333_60333012_qa_4/environment/bootstrap.sh b/tasks/0060_333_60333012_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_333_60333012_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_333_60333012_qa_4/environment/pull_bucket.py b/tasks/0060_333_60333012_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_333_60333012_qa_4/environment/pull_bucket.py +++ b/tasks/0060_333_60333012_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_333_60333012_qa_4/task.toml b/tasks/0060_333_60333012_qa_4/task.toml index 1767054321defa8741ea115dfe4b3a0a3a7543fb..eb3744cf9f68941596e7868773cc62226f74ae36 100644 --- a/tasks/0060_333_60333012_qa_4/task.toml +++ b/tasks/0060_333_60333012_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_418_60418523_qa_5/environment/bootstrap.sh b/tasks/0060_418_60418523_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_418_60418523_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_418_60418523_qa_5/environment/pull_bucket.py b/tasks/0060_418_60418523_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_418_60418523_qa_5/environment/pull_bucket.py +++ b/tasks/0060_418_60418523_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_418_60418523_qa_5/task.toml b/tasks/0060_418_60418523_qa_5/task.toml index 4aa3b9ae146999ec2ae34fbf94bdec2dd8976f0b..398a16a4b6730c0dcb8a9126c42c7f015c9070f8 100644 --- a/tasks/0060_418_60418523_qa_5/task.toml +++ b/tasks/0060_418_60418523_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_427_60427905_qa_2/environment/bootstrap.sh b/tasks/0060_427_60427905_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_427_60427905_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_427_60427905_qa_2/environment/pull_bucket.py b/tasks/0060_427_60427905_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_427_60427905_qa_2/environment/pull_bucket.py +++ b/tasks/0060_427_60427905_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_427_60427905_qa_2/task.toml b/tasks/0060_427_60427905_qa_2/task.toml index cefe2ed8bb4a2900159537f6f604fb453b63a200..2bce3025ea55e1638c6478f199e350a0f121478f 100644 --- a/tasks/0060_427_60427905_qa_2/task.toml +++ b/tasks/0060_427_60427905_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_435_60435924_qa_1/environment/bootstrap.sh b/tasks/0060_435_60435924_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_435_60435924_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_435_60435924_qa_1/environment/pull_bucket.py b/tasks/0060_435_60435924_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_435_60435924_qa_1/environment/pull_bucket.py +++ b/tasks/0060_435_60435924_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_435_60435924_qa_1/task.toml b/tasks/0060_435_60435924_qa_1/task.toml index af13b14cbc8a8492db686fd9339e5ac6e775b738..879beb8892c40619ec072d5bd679fb0f6374eea6 100644 --- a/tasks/0060_435_60435924_qa_1/task.toml +++ b/tasks/0060_435_60435924_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_435_60435924_qa_2/environment/bootstrap.sh b/tasks/0060_435_60435924_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_435_60435924_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_435_60435924_qa_2/environment/pull_bucket.py b/tasks/0060_435_60435924_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_435_60435924_qa_2/environment/pull_bucket.py +++ b/tasks/0060_435_60435924_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_435_60435924_qa_2/task.toml b/tasks/0060_435_60435924_qa_2/task.toml index 5d49bbc6004c96aa85eec882c75c474dc5c6f9e7..9609e1737c7468600f5baa4df5168eca4c634e99 100644 --- a/tasks/0060_435_60435924_qa_2/task.toml +++ b/tasks/0060_435_60435924_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_435_60435924_qa_3/environment/bootstrap.sh b/tasks/0060_435_60435924_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_435_60435924_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_435_60435924_qa_3/environment/pull_bucket.py b/tasks/0060_435_60435924_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_435_60435924_qa_3/environment/pull_bucket.py +++ b/tasks/0060_435_60435924_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_435_60435924_qa_3/task.toml b/tasks/0060_435_60435924_qa_3/task.toml index afd28c7c2fe777ff5c6ba16cba5c857c6f7c9600..32bb76704565613a76ad5f0d8fc81b91f4cb6d31 100644 --- a/tasks/0060_435_60435924_qa_3/task.toml +++ b/tasks/0060_435_60435924_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_490_60490802_qa_1/environment/bootstrap.sh b/tasks/0060_490_60490802_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_490_60490802_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_490_60490802_qa_1/environment/pull_bucket.py b/tasks/0060_490_60490802_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_490_60490802_qa_1/environment/pull_bucket.py +++ b/tasks/0060_490_60490802_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_490_60490802_qa_1/task.toml b/tasks/0060_490_60490802_qa_1/task.toml index dfb6040c57143db5f12c7b1e80d8eba46774699f..47c103bf519d2d07ed77b1d221556fe447f31327 100644 --- a/tasks/0060_490_60490802_qa_1/task.toml +++ b/tasks/0060_490_60490802_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_511_60511698_qa_4/environment/bootstrap.sh b/tasks/0060_511_60511698_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_511_60511698_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_511_60511698_qa_4/environment/pull_bucket.py b/tasks/0060_511_60511698_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_511_60511698_qa_4/environment/pull_bucket.py +++ b/tasks/0060_511_60511698_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_511_60511698_qa_4/task.toml b/tasks/0060_511_60511698_qa_4/task.toml index 7718bcf053d5883e52c22214345cc972fd9cbeaf..0820a58f9a4d32acd2060fae2b55944700afe64f 100644 --- a/tasks/0060_511_60511698_qa_4/task.toml +++ b/tasks/0060_511_60511698_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_532_60532216_qa_3/environment/bootstrap.sh b/tasks/0060_532_60532216_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_532_60532216_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_532_60532216_qa_3/environment/pull_bucket.py b/tasks/0060_532_60532216_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_532_60532216_qa_3/environment/pull_bucket.py +++ b/tasks/0060_532_60532216_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_532_60532216_qa_3/task.toml b/tasks/0060_532_60532216_qa_3/task.toml index 9ea6fb66de17da9a5eb64b145f1e67a6fb1df872..7633341c4b24c244352cb2d309cf9b1fb9543725 100644 --- a/tasks/0060_532_60532216_qa_3/task.toml +++ b/tasks/0060_532_60532216_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_532_60532216_qa_4/environment/bootstrap.sh b/tasks/0060_532_60532216_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_532_60532216_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_532_60532216_qa_4/environment/pull_bucket.py b/tasks/0060_532_60532216_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_532_60532216_qa_4/environment/pull_bucket.py +++ b/tasks/0060_532_60532216_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_532_60532216_qa_4/task.toml b/tasks/0060_532_60532216_qa_4/task.toml index 8c1206661c7c02f48338021720b009bc169027c4..df87646d4c4cdcc8d851901a4d949c3f900587f1 100644 --- a/tasks/0060_532_60532216_qa_4/task.toml +++ b/tasks/0060_532_60532216_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_533_60533129_qa_5/environment/bootstrap.sh b/tasks/0060_533_60533129_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_533_60533129_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_533_60533129_qa_5/environment/pull_bucket.py b/tasks/0060_533_60533129_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_533_60533129_qa_5/environment/pull_bucket.py +++ b/tasks/0060_533_60533129_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_533_60533129_qa_5/task.toml b/tasks/0060_533_60533129_qa_5/task.toml index a4a587c1fdd192c5c6eedf88d92e44a44fdf2d8c..f76aa2000688a24f6b9730dea9ed3ac628fee3f7 100644 --- a/tasks/0060_533_60533129_qa_5/task.toml +++ b/tasks/0060_533_60533129_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_557_60557640_qa_1/environment/bootstrap.sh b/tasks/0060_557_60557640_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_557_60557640_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_557_60557640_qa_1/environment/pull_bucket.py b/tasks/0060_557_60557640_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_557_60557640_qa_1/environment/pull_bucket.py +++ b/tasks/0060_557_60557640_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_557_60557640_qa_1/task.toml b/tasks/0060_557_60557640_qa_1/task.toml index 4c881f47818abbd4510d72e019f3a63847976a58..ea7897d37b799b59ecf549e5f49542139dbaee9c 100644 --- a/tasks/0060_557_60557640_qa_1/task.toml +++ b/tasks/0060_557_60557640_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_557_60557640_qa_3/environment/bootstrap.sh b/tasks/0060_557_60557640_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_557_60557640_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_557_60557640_qa_3/environment/pull_bucket.py b/tasks/0060_557_60557640_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_557_60557640_qa_3/environment/pull_bucket.py +++ b/tasks/0060_557_60557640_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_557_60557640_qa_3/task.toml b/tasks/0060_557_60557640_qa_3/task.toml index 33eaa74328355690e19668afd852117402b91f2c..e3f5baaf6ec40b1c352b5dacdabece7d37217ddc 100644 --- a/tasks/0060_557_60557640_qa_3/task.toml +++ b/tasks/0060_557_60557640_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_557_60557640_qa_4/environment/bootstrap.sh b/tasks/0060_557_60557640_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_557_60557640_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_557_60557640_qa_4/environment/pull_bucket.py b/tasks/0060_557_60557640_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_557_60557640_qa_4/environment/pull_bucket.py +++ b/tasks/0060_557_60557640_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_557_60557640_qa_4/task.toml b/tasks/0060_557_60557640_qa_4/task.toml index 8ff7a50f347787a21931b5e389224ff36b8e900e..7a1327c1dbc258c5351708c72fe84420336a70cf 100644 --- a/tasks/0060_557_60557640_qa_4/task.toml +++ b/tasks/0060_557_60557640_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_573_60573328_qa_1/environment/bootstrap.sh b/tasks/0060_573_60573328_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_573_60573328_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_573_60573328_qa_1/environment/pull_bucket.py b/tasks/0060_573_60573328_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_573_60573328_qa_1/environment/pull_bucket.py +++ b/tasks/0060_573_60573328_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_573_60573328_qa_1/task.toml b/tasks/0060_573_60573328_qa_1/task.toml index 9fac4a8fddb6b66f26de0e4cb7a410c8e5a86410..e140ec4373341da8ee01f7c974bf21c78c463bcc 100644 --- a/tasks/0060_573_60573328_qa_1/task.toml +++ b/tasks/0060_573_60573328_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_573_60573328_qa_3/environment/bootstrap.sh b/tasks/0060_573_60573328_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_573_60573328_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_573_60573328_qa_3/environment/pull_bucket.py b/tasks/0060_573_60573328_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_573_60573328_qa_3/environment/pull_bucket.py +++ b/tasks/0060_573_60573328_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_573_60573328_qa_3/task.toml b/tasks/0060_573_60573328_qa_3/task.toml index dbda202a262141be6ad96bb1ed1b6718bf7ca648..0b459d5fe83e2318aa0fa067056dd30e88cd0001 100644 --- a/tasks/0060_573_60573328_qa_3/task.toml +++ b/tasks/0060_573_60573328_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_577_60577566_qa_2/environment/bootstrap.sh b/tasks/0060_577_60577566_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_577_60577566_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_577_60577566_qa_2/environment/pull_bucket.py b/tasks/0060_577_60577566_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_577_60577566_qa_2/environment/pull_bucket.py +++ b/tasks/0060_577_60577566_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_577_60577566_qa_2/task.toml b/tasks/0060_577_60577566_qa_2/task.toml index 54064affb758a7423c3b1cc6c9c98b5707b1c975..5e8ea08933c221224b6efb9adc3294fc191de2ca 100644 --- a/tasks/0060_577_60577566_qa_2/task.toml +++ b/tasks/0060_577_60577566_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_577_60577566_qa_5/environment/bootstrap.sh b/tasks/0060_577_60577566_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_577_60577566_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_577_60577566_qa_5/environment/pull_bucket.py b/tasks/0060_577_60577566_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_577_60577566_qa_5/environment/pull_bucket.py +++ b/tasks/0060_577_60577566_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_577_60577566_qa_5/task.toml b/tasks/0060_577_60577566_qa_5/task.toml index b9d3e06a74ff1bf87ccf7952a53a3a4736acc2d1..0cbae09935dde51a0ee0a1892abbd40fbe2024e3 100644 --- a/tasks/0060_577_60577566_qa_5/task.toml +++ b/tasks/0060_577_60577566_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_651_60651529_qa_4/environment/bootstrap.sh b/tasks/0060_651_60651529_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_651_60651529_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_651_60651529_qa_4/environment/pull_bucket.py b/tasks/0060_651_60651529_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_651_60651529_qa_4/environment/pull_bucket.py +++ b/tasks/0060_651_60651529_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_651_60651529_qa_4/task.toml b/tasks/0060_651_60651529_qa_4/task.toml index a64b8218d4a19b2314f9792a5c3d2ab2d631776b..fdf700e8c39ff89f1cf04982d98baed30838694f 100644 --- a/tasks/0060_651_60651529_qa_4/task.toml +++ b/tasks/0060_651_60651529_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_702_60702546_qa_2/environment/bootstrap.sh b/tasks/0060_702_60702546_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_702_60702546_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_702_60702546_qa_2/environment/pull_bucket.py b/tasks/0060_702_60702546_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_702_60702546_qa_2/environment/pull_bucket.py +++ b/tasks/0060_702_60702546_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_702_60702546_qa_2/task.toml b/tasks/0060_702_60702546_qa_2/task.toml index 14302dc7646837680ccf478900896a11a333f370..dcc9d6ee5433c20988996b04d05441fbe94c0104 100644 --- a/tasks/0060_702_60702546_qa_2/task.toml +++ b/tasks/0060_702_60702546_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_702_60702546_qa_3/environment/bootstrap.sh b/tasks/0060_702_60702546_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_702_60702546_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_702_60702546_qa_3/environment/pull_bucket.py b/tasks/0060_702_60702546_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_702_60702546_qa_3/environment/pull_bucket.py +++ b/tasks/0060_702_60702546_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_702_60702546_qa_3/task.toml b/tasks/0060_702_60702546_qa_3/task.toml index 2fd8ae4e03a531ca3028e637da27aff620403404..4d1fda518080db73eda9f385feca533f71ba53b4 100644 --- a/tasks/0060_702_60702546_qa_3/task.toml +++ b/tasks/0060_702_60702546_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_804_60804329_qa_5/environment/bootstrap.sh b/tasks/0060_804_60804329_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_804_60804329_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_804_60804329_qa_5/environment/pull_bucket.py b/tasks/0060_804_60804329_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_804_60804329_qa_5/environment/pull_bucket.py +++ b/tasks/0060_804_60804329_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_804_60804329_qa_5/task.toml b/tasks/0060_804_60804329_qa_5/task.toml index 64e5bcce3655c237bf2bda9c0e073acff338534e..b90d33b98d697fdf08205e0d880e743836292fae 100644 --- a/tasks/0060_804_60804329_qa_5/task.toml +++ b/tasks/0060_804_60804329_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_827_60827703_qa_1/environment/bootstrap.sh b/tasks/0060_827_60827703_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_827_60827703_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_827_60827703_qa_1/environment/pull_bucket.py b/tasks/0060_827_60827703_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_827_60827703_qa_1/environment/pull_bucket.py +++ b/tasks/0060_827_60827703_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_827_60827703_qa_1/task.toml b/tasks/0060_827_60827703_qa_1/task.toml index 49f5f2e30d9c8f3204b2a42667b0fed162f18584..5e2d86a177007c4a2514988baa10c9959c9dedfd 100644 --- a/tasks/0060_827_60827703_qa_1/task.toml +++ b/tasks/0060_827_60827703_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_965_60965228_qa_4/environment/bootstrap.sh b/tasks/0060_965_60965228_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_965_60965228_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_965_60965228_qa_4/environment/pull_bucket.py b/tasks/0060_965_60965228_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_965_60965228_qa_4/environment/pull_bucket.py +++ b/tasks/0060_965_60965228_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_965_60965228_qa_4/task.toml b/tasks/0060_965_60965228_qa_4/task.toml index 94f5acad5f93586fbaca3a52d3d1b29e31041bb3..b7f7882b7aaa9ee7d337226d8bc26d6dcf2de185 100644 --- a/tasks/0060_965_60965228_qa_4/task.toml +++ b/tasks/0060_965_60965228_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0060_983_60983312_qa_4/environment/bootstrap.sh b/tasks/0060_983_60983312_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0060_983_60983312_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0060_983_60983312_qa_4/environment/pull_bucket.py b/tasks/0060_983_60983312_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0060_983_60983312_qa_4/environment/pull_bucket.py +++ b/tasks/0060_983_60983312_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0060_983_60983312_qa_4/task.toml b/tasks/0060_983_60983312_qa_4/task.toml index 757e84dedca048a2a87bd196a20662675f799826..8b5edba7a7b5a6a42f2754e3206e64ccfeba8d6e 100644 --- a/tasks/0060_983_60983312_qa_4/task.toml +++ b/tasks/0060_983_60983312_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_020_61020399_qa_5/environment/bootstrap.sh b/tasks/0061_020_61020399_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_020_61020399_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_020_61020399_qa_5/environment/pull_bucket.py b/tasks/0061_020_61020399_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_020_61020399_qa_5/environment/pull_bucket.py +++ b/tasks/0061_020_61020399_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_020_61020399_qa_5/task.toml b/tasks/0061_020_61020399_qa_5/task.toml index d4bf350f13a39b9541777b9adadfea427a8e2691..10b1a0b7ea6fc0d013cfd20ea8fd673038e201b4 100644 --- a/tasks/0061_020_61020399_qa_5/task.toml +++ b/tasks/0061_020_61020399_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_041_61041621_qa_1/environment/bootstrap.sh b/tasks/0061_041_61041621_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_041_61041621_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_041_61041621_qa_1/environment/pull_bucket.py b/tasks/0061_041_61041621_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_041_61041621_qa_1/environment/pull_bucket.py +++ b/tasks/0061_041_61041621_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_041_61041621_qa_1/task.toml b/tasks/0061_041_61041621_qa_1/task.toml index 7169de203d1f577cb0487ead8c98ab2aabfdf567..5d564249168fb29ba9c33af187addda5db0c9e79 100644 --- a/tasks/0061_041_61041621_qa_1/task.toml +++ b/tasks/0061_041_61041621_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_041_61041621_qa_3/environment/bootstrap.sh b/tasks/0061_041_61041621_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_041_61041621_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_041_61041621_qa_3/environment/pull_bucket.py b/tasks/0061_041_61041621_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_041_61041621_qa_3/environment/pull_bucket.py +++ b/tasks/0061_041_61041621_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_041_61041621_qa_3/task.toml b/tasks/0061_041_61041621_qa_3/task.toml index d4fed7b7dcfabd2053e7429656aed5c38e95ff99..c38cdf34961bb84b61bf5a149ba7d3e4188b1bb9 100644 --- a/tasks/0061_041_61041621_qa_3/task.toml +++ b/tasks/0061_041_61041621_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_041_61041621_qa_5/environment/bootstrap.sh b/tasks/0061_041_61041621_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_041_61041621_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_041_61041621_qa_5/environment/pull_bucket.py b/tasks/0061_041_61041621_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_041_61041621_qa_5/environment/pull_bucket.py +++ b/tasks/0061_041_61041621_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_041_61041621_qa_5/task.toml b/tasks/0061_041_61041621_qa_5/task.toml index 9c8de522a225d209f2cce20499159c0c03a1bcb0..fabf20cdb4c8df460411df835e5007f673d6e25d 100644 --- a/tasks/0061_041_61041621_qa_5/task.toml +++ b/tasks/0061_041_61041621_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_109_61109875_qa_1/environment/bootstrap.sh b/tasks/0061_109_61109875_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_109_61109875_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_109_61109875_qa_1/environment/pull_bucket.py b/tasks/0061_109_61109875_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_109_61109875_qa_1/environment/pull_bucket.py +++ b/tasks/0061_109_61109875_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_109_61109875_qa_1/task.toml b/tasks/0061_109_61109875_qa_1/task.toml index 3b99cdc97411f3e4f3c46956bc7550b601831c71..1b914dc666075249671ccbc870c06834287017aa 100644 --- a/tasks/0061_109_61109875_qa_1/task.toml +++ b/tasks/0061_109_61109875_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_146_61146157_qa_1/environment/bootstrap.sh b/tasks/0061_146_61146157_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_146_61146157_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_146_61146157_qa_1/environment/pull_bucket.py b/tasks/0061_146_61146157_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_146_61146157_qa_1/environment/pull_bucket.py +++ b/tasks/0061_146_61146157_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_146_61146157_qa_1/task.toml b/tasks/0061_146_61146157_qa_1/task.toml index 621bb9c58ef79911d29b5fa6071e5aed28f0a323..ddb355d86c56b410c72ed8db33e904c1de3d75af 100644 --- a/tasks/0061_146_61146157_qa_1/task.toml +++ b/tasks/0061_146_61146157_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_164_61164683_qa_1/environment/bootstrap.sh b/tasks/0061_164_61164683_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_164_61164683_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_164_61164683_qa_1/environment/pull_bucket.py b/tasks/0061_164_61164683_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_164_61164683_qa_1/environment/pull_bucket.py +++ b/tasks/0061_164_61164683_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_164_61164683_qa_1/task.toml b/tasks/0061_164_61164683_qa_1/task.toml index 13e654982f18f01421568b3d326a6d95d324e539..400584addb588145b3bb5efa190b0cfb7d333cc5 100644 --- a/tasks/0061_164_61164683_qa_1/task.toml +++ b/tasks/0061_164_61164683_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_164_61164683_qa_2/environment/bootstrap.sh b/tasks/0061_164_61164683_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_164_61164683_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_164_61164683_qa_2/environment/pull_bucket.py b/tasks/0061_164_61164683_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_164_61164683_qa_2/environment/pull_bucket.py +++ b/tasks/0061_164_61164683_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_164_61164683_qa_2/task.toml b/tasks/0061_164_61164683_qa_2/task.toml index 1388e33330b51b227a0a78bfca59c38793083642..308e2e81c7d92b1dcdbf209644f856a9663f7048 100644 --- a/tasks/0061_164_61164683_qa_2/task.toml +++ b/tasks/0061_164_61164683_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_190_61190042_qa_2/environment/bootstrap.sh b/tasks/0061_190_61190042_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_190_61190042_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_190_61190042_qa_2/environment/pull_bucket.py b/tasks/0061_190_61190042_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_190_61190042_qa_2/environment/pull_bucket.py +++ b/tasks/0061_190_61190042_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_190_61190042_qa_2/task.toml b/tasks/0061_190_61190042_qa_2/task.toml index 5627ab4b4bdcdc93f4faa04cb72c1366b25e65fe..286559958919b760e4d362910159d1f924611c68 100644 --- a/tasks/0061_190_61190042_qa_2/task.toml +++ b/tasks/0061_190_61190042_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_208_61208833_qa_5/environment/bootstrap.sh b/tasks/0061_208_61208833_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_208_61208833_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_208_61208833_qa_5/environment/pull_bucket.py b/tasks/0061_208_61208833_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_208_61208833_qa_5/environment/pull_bucket.py +++ b/tasks/0061_208_61208833_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_208_61208833_qa_5/task.toml b/tasks/0061_208_61208833_qa_5/task.toml index 81bb63729fbdc79cc52b994d360e7fbe100fe22c..d085f5eef8a68dacb1312abd242655722e1fae5c 100644 --- a/tasks/0061_208_61208833_qa_5/task.toml +++ b/tasks/0061_208_61208833_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_220_61220733_qa_2/environment/bootstrap.sh b/tasks/0061_220_61220733_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_220_61220733_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_220_61220733_qa_2/environment/pull_bucket.py b/tasks/0061_220_61220733_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_220_61220733_qa_2/environment/pull_bucket.py +++ b/tasks/0061_220_61220733_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_220_61220733_qa_2/task.toml b/tasks/0061_220_61220733_qa_2/task.toml index 903f600db2ccdf5bb2be70469b84618c363195ca..0ad8cac173ef9bd338b93dddc9597ac321937678 100644 --- a/tasks/0061_220_61220733_qa_2/task.toml +++ b/tasks/0061_220_61220733_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_283_61283870_qa_3/environment/bootstrap.sh b/tasks/0061_283_61283870_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_283_61283870_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_283_61283870_qa_3/environment/pull_bucket.py b/tasks/0061_283_61283870_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_283_61283870_qa_3/environment/pull_bucket.py +++ b/tasks/0061_283_61283870_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_283_61283870_qa_3/task.toml b/tasks/0061_283_61283870_qa_3/task.toml index 0a037492d9a2c6d0ae838a2a67b855002b2571c8..aec7d5f18f968175b67e53a75233b5bb63da8f0c 100644 --- a/tasks/0061_283_61283870_qa_3/task.toml +++ b/tasks/0061_283_61283870_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_292_61292134_qa_1/environment/bootstrap.sh b/tasks/0061_292_61292134_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_292_61292134_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_292_61292134_qa_1/environment/pull_bucket.py b/tasks/0061_292_61292134_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_292_61292134_qa_1/environment/pull_bucket.py +++ b/tasks/0061_292_61292134_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_292_61292134_qa_1/task.toml b/tasks/0061_292_61292134_qa_1/task.toml index 4fa9b3a6497749c4d6e92bf234d10bdd48bff48f..5abb5fbb75cbb202ea8c1b66544e0f577ca5d097 100644 --- a/tasks/0061_292_61292134_qa_1/task.toml +++ b/tasks/0061_292_61292134_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_292_61292134_qa_2/environment/bootstrap.sh b/tasks/0061_292_61292134_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_292_61292134_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_292_61292134_qa_2/environment/pull_bucket.py b/tasks/0061_292_61292134_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_292_61292134_qa_2/environment/pull_bucket.py +++ b/tasks/0061_292_61292134_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_292_61292134_qa_2/task.toml b/tasks/0061_292_61292134_qa_2/task.toml index 3ca1b009d7f1a6e4f707c2e0a94842ddec06f34e..2e16e6674ffdc654854b1b1597533469744d9c20 100644 --- a/tasks/0061_292_61292134_qa_2/task.toml +++ b/tasks/0061_292_61292134_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_292_61292134_qa_3/environment/bootstrap.sh b/tasks/0061_292_61292134_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_292_61292134_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_292_61292134_qa_3/environment/pull_bucket.py b/tasks/0061_292_61292134_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_292_61292134_qa_3/environment/pull_bucket.py +++ b/tasks/0061_292_61292134_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_292_61292134_qa_3/task.toml b/tasks/0061_292_61292134_qa_3/task.toml index 46e0cd472f3210e663696c4f97a90532fbedeafe..9ec96c5f4490004102482cd6a12c0b5ec005d400 100644 --- a/tasks/0061_292_61292134_qa_3/task.toml +++ b/tasks/0061_292_61292134_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_311_61311344_qa_3/environment/bootstrap.sh b/tasks/0061_311_61311344_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_311_61311344_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_311_61311344_qa_3/environment/pull_bucket.py b/tasks/0061_311_61311344_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_311_61311344_qa_3/environment/pull_bucket.py +++ b/tasks/0061_311_61311344_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_311_61311344_qa_3/task.toml b/tasks/0061_311_61311344_qa_3/task.toml index 9f3510ae665044f2c4208538b8cfb0436b1b11d4..63dae23ad135fbb2dabc987fcfc5b04c2fe3e3cc 100644 --- a/tasks/0061_311_61311344_qa_3/task.toml +++ b/tasks/0061_311_61311344_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_311_61311344_qa_5/environment/bootstrap.sh b/tasks/0061_311_61311344_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_311_61311344_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_311_61311344_qa_5/environment/pull_bucket.py b/tasks/0061_311_61311344_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_311_61311344_qa_5/environment/pull_bucket.py +++ b/tasks/0061_311_61311344_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_311_61311344_qa_5/task.toml b/tasks/0061_311_61311344_qa_5/task.toml index a9ae649566fe1dc10b1f939b41a9e002bcde8eb9..c47210fe9252481157b675e8194f0433684a9c8b 100644 --- a/tasks/0061_311_61311344_qa_5/task.toml +++ b/tasks/0061_311_61311344_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_330_61330810_qa_1/environment/bootstrap.sh b/tasks/0061_330_61330810_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_330_61330810_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_330_61330810_qa_1/environment/pull_bucket.py b/tasks/0061_330_61330810_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_330_61330810_qa_1/environment/pull_bucket.py +++ b/tasks/0061_330_61330810_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_330_61330810_qa_1/task.toml b/tasks/0061_330_61330810_qa_1/task.toml index 7bcf1491c6e3241d69e71a1924cb3e8bd88ccef6..1bb19e9a390754aad322dc3f6342ada49ef5b42e 100644 --- a/tasks/0061_330_61330810_qa_1/task.toml +++ b/tasks/0061_330_61330810_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_353_61353471_qa_1/environment/bootstrap.sh b/tasks/0061_353_61353471_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_353_61353471_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_353_61353471_qa_1/environment/pull_bucket.py b/tasks/0061_353_61353471_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_353_61353471_qa_1/environment/pull_bucket.py +++ b/tasks/0061_353_61353471_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_353_61353471_qa_1/task.toml b/tasks/0061_353_61353471_qa_1/task.toml index bf05206ca6503442e9215c6f068d9c9a01176c4d..6389dbaff12d400fc61b146b9c27097395e72eb3 100644 --- a/tasks/0061_353_61353471_qa_1/task.toml +++ b/tasks/0061_353_61353471_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_353_61353471_qa_2/environment/bootstrap.sh b/tasks/0061_353_61353471_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_353_61353471_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_353_61353471_qa_2/environment/pull_bucket.py b/tasks/0061_353_61353471_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_353_61353471_qa_2/environment/pull_bucket.py +++ b/tasks/0061_353_61353471_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_353_61353471_qa_2/task.toml b/tasks/0061_353_61353471_qa_2/task.toml index c046d89cdad2b79700eca4709f9b44225f4dffc2..d0de5000fcf5cc28a104c8c3b87657ed101875ba 100644 --- a/tasks/0061_353_61353471_qa_2/task.toml +++ b/tasks/0061_353_61353471_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_353_61353471_qa_4/environment/bootstrap.sh b/tasks/0061_353_61353471_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_353_61353471_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_353_61353471_qa_4/environment/pull_bucket.py b/tasks/0061_353_61353471_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_353_61353471_qa_4/environment/pull_bucket.py +++ b/tasks/0061_353_61353471_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_353_61353471_qa_4/task.toml b/tasks/0061_353_61353471_qa_4/task.toml index fa8ce0c465f04cf4fa6c448330bba04505def9b0..137899db7b2a5267eba7bcc6d6f6591c2d73db85 100644 --- a/tasks/0061_353_61353471_qa_4/task.toml +++ b/tasks/0061_353_61353471_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_353_61353471_qa_5/environment/bootstrap.sh b/tasks/0061_353_61353471_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_353_61353471_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_353_61353471_qa_5/environment/pull_bucket.py b/tasks/0061_353_61353471_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_353_61353471_qa_5/environment/pull_bucket.py +++ b/tasks/0061_353_61353471_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_353_61353471_qa_5/task.toml b/tasks/0061_353_61353471_qa_5/task.toml index 713e949f97ab7ac8bd9a28cf3c06fb3a9f0dbf83..6531e15063de9a4b66a3d0104546544872b82b7c 100644 --- a/tasks/0061_353_61353471_qa_5/task.toml +++ b/tasks/0061_353_61353471_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_362_61362835_qa_2/environment/bootstrap.sh b/tasks/0061_362_61362835_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_362_61362835_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_362_61362835_qa_2/environment/pull_bucket.py b/tasks/0061_362_61362835_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_362_61362835_qa_2/environment/pull_bucket.py +++ b/tasks/0061_362_61362835_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_362_61362835_qa_2/task.toml b/tasks/0061_362_61362835_qa_2/task.toml index 38cb506618cf5ee54835f2a8dca4c4edae5b6f2b..1d52a077ba59b4f1c3f38c938d99bb82d6c6abbd 100644 --- a/tasks/0061_362_61362835_qa_2/task.toml +++ b/tasks/0061_362_61362835_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_362_61362835_qa_3/environment/bootstrap.sh b/tasks/0061_362_61362835_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_362_61362835_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_362_61362835_qa_3/environment/pull_bucket.py b/tasks/0061_362_61362835_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_362_61362835_qa_3/environment/pull_bucket.py +++ b/tasks/0061_362_61362835_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_362_61362835_qa_3/task.toml b/tasks/0061_362_61362835_qa_3/task.toml index d75a995a4840cbd8551706e4585c3d0afa229ee3..07bfb419497d1d13439eb96eafb373215f51324b 100644 --- a/tasks/0061_362_61362835_qa_3/task.toml +++ b/tasks/0061_362_61362835_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_519_61519361_qa_1/environment/bootstrap.sh b/tasks/0061_519_61519361_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_519_61519361_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_519_61519361_qa_1/environment/pull_bucket.py b/tasks/0061_519_61519361_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_519_61519361_qa_1/environment/pull_bucket.py +++ b/tasks/0061_519_61519361_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_519_61519361_qa_1/task.toml b/tasks/0061_519_61519361_qa_1/task.toml index 5e3469980f29668db27d6715f7d0bb7e38fdcec3..60e466c11235038edd9b5be9cd571e7300f4a581 100644 --- a/tasks/0061_519_61519361_qa_1/task.toml +++ b/tasks/0061_519_61519361_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_528_61528663_qa_5/environment/bootstrap.sh b/tasks/0061_528_61528663_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_528_61528663_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_528_61528663_qa_5/environment/pull_bucket.py b/tasks/0061_528_61528663_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_528_61528663_qa_5/environment/pull_bucket.py +++ b/tasks/0061_528_61528663_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_528_61528663_qa_5/task.toml b/tasks/0061_528_61528663_qa_5/task.toml index ece083f4acd1e7f511e945b6397cfb5092b2640c..00645c30d98743c42b06262f66c851c13cd9ac16 100644 --- a/tasks/0061_528_61528663_qa_5/task.toml +++ b/tasks/0061_528_61528663_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_626_61626049_qa_5/environment/bootstrap.sh b/tasks/0061_626_61626049_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_626_61626049_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_626_61626049_qa_5/environment/pull_bucket.py b/tasks/0061_626_61626049_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_626_61626049_qa_5/environment/pull_bucket.py +++ b/tasks/0061_626_61626049_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_626_61626049_qa_5/task.toml b/tasks/0061_626_61626049_qa_5/task.toml index eab8df6078d4342b0bbaad122e3073da9893860f..486dd3f19a52b9c1bc13cbde1633e324555e5dea 100644 --- a/tasks/0061_626_61626049_qa_5/task.toml +++ b/tasks/0061_626_61626049_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_651_61651144_qa_2/environment/bootstrap.sh b/tasks/0061_651_61651144_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_651_61651144_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_651_61651144_qa_2/environment/pull_bucket.py b/tasks/0061_651_61651144_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_651_61651144_qa_2/environment/pull_bucket.py +++ b/tasks/0061_651_61651144_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_651_61651144_qa_2/task.toml b/tasks/0061_651_61651144_qa_2/task.toml index 55d8107eddd77e73eeb205a5e53f45d48e65d3a8..5900457d6d46ec5a7fca759c31e3cc14614f88d0 100644 --- a/tasks/0061_651_61651144_qa_2/task.toml +++ b/tasks/0061_651_61651144_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_651_61651144_qa_4/environment/bootstrap.sh b/tasks/0061_651_61651144_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_651_61651144_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_651_61651144_qa_4/environment/pull_bucket.py b/tasks/0061_651_61651144_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_651_61651144_qa_4/environment/pull_bucket.py +++ b/tasks/0061_651_61651144_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_651_61651144_qa_4/task.toml b/tasks/0061_651_61651144_qa_4/task.toml index 38e33ffa273e29ef63a5fbdd3ae7ee8b35cb558d..e5963d91441758d17ba0d349b4734a1e6dfb5078 100644 --- a/tasks/0061_651_61651144_qa_4/task.toml +++ b/tasks/0061_651_61651144_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_651_61651144_qa_5/environment/bootstrap.sh b/tasks/0061_651_61651144_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_651_61651144_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_651_61651144_qa_5/environment/pull_bucket.py b/tasks/0061_651_61651144_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_651_61651144_qa_5/environment/pull_bucket.py +++ b/tasks/0061_651_61651144_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_651_61651144_qa_5/task.toml b/tasks/0061_651_61651144_qa_5/task.toml index ede17449a257c75db9784d4f57f861f1418cb556..914220b7f94bceb0a3db57c5d18ccb976924ec70 100644 --- a/tasks/0061_651_61651144_qa_5/task.toml +++ b/tasks/0061_651_61651144_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_664_61664085_qa_2/environment/bootstrap.sh b/tasks/0061_664_61664085_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_664_61664085_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_664_61664085_qa_2/environment/pull_bucket.py b/tasks/0061_664_61664085_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_664_61664085_qa_2/environment/pull_bucket.py +++ b/tasks/0061_664_61664085_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_664_61664085_qa_2/task.toml b/tasks/0061_664_61664085_qa_2/task.toml index 1031b662ff1857ff7e60ad8b7d785ed61cc7467e..66e26f23d560482f567251409d3fb72ebc1c8974 100644 --- a/tasks/0061_664_61664085_qa_2/task.toml +++ b/tasks/0061_664_61664085_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_664_61664085_qa_3/environment/bootstrap.sh b/tasks/0061_664_61664085_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_664_61664085_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_664_61664085_qa_3/environment/pull_bucket.py b/tasks/0061_664_61664085_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_664_61664085_qa_3/environment/pull_bucket.py +++ b/tasks/0061_664_61664085_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_664_61664085_qa_3/task.toml b/tasks/0061_664_61664085_qa_3/task.toml index b86916fa1c041cb4af9b3fb5b016cc65f3cf9322..91ec4eb8b4f49cd7a6fe77a0627a6f5c68f5d9ad 100644 --- a/tasks/0061_664_61664085_qa_3/task.toml +++ b/tasks/0061_664_61664085_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_683_61683051_qa_3/environment/bootstrap.sh b/tasks/0061_683_61683051_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_683_61683051_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_683_61683051_qa_3/environment/pull_bucket.py b/tasks/0061_683_61683051_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_683_61683051_qa_3/environment/pull_bucket.py +++ b/tasks/0061_683_61683051_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_683_61683051_qa_3/task.toml b/tasks/0061_683_61683051_qa_3/task.toml index 28533afbb62670d1746596a895a2490c0df5c0fa..087130f3bd75026e308f0458fafce69850a7bc8c 100644 --- a/tasks/0061_683_61683051_qa_3/task.toml +++ b/tasks/0061_683_61683051_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_683_61683051_qa_5/environment/bootstrap.sh b/tasks/0061_683_61683051_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_683_61683051_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_683_61683051_qa_5/environment/pull_bucket.py b/tasks/0061_683_61683051_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_683_61683051_qa_5/environment/pull_bucket.py +++ b/tasks/0061_683_61683051_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_683_61683051_qa_5/task.toml b/tasks/0061_683_61683051_qa_5/task.toml index 5d3cde4473cb278f4aa92d13ebf8f071561397c0..72be75f1375a31000460102d7c6dcf072907cafd 100644 --- a/tasks/0061_683_61683051_qa_5/task.toml +++ b/tasks/0061_683_61683051_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_702_61702080_qa_4/environment/bootstrap.sh b/tasks/0061_702_61702080_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_702_61702080_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_702_61702080_qa_4/environment/pull_bucket.py b/tasks/0061_702_61702080_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_702_61702080_qa_4/environment/pull_bucket.py +++ b/tasks/0061_702_61702080_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_702_61702080_qa_4/task.toml b/tasks/0061_702_61702080_qa_4/task.toml index e0c2ab662b4135d5773db3a88596aeecdba7e165..1f9a8968a2a0445da30601a914192c9683a0cb82 100644 --- a/tasks/0061_702_61702080_qa_4/task.toml +++ b/tasks/0061_702_61702080_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_736_61736140_qa_1/environment/bootstrap.sh b/tasks/0061_736_61736140_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_736_61736140_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_736_61736140_qa_1/environment/pull_bucket.py b/tasks/0061_736_61736140_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_736_61736140_qa_1/environment/pull_bucket.py +++ b/tasks/0061_736_61736140_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_736_61736140_qa_1/task.toml b/tasks/0061_736_61736140_qa_1/task.toml index e4e693c806bc67dc271fc1ed9ae71f3ae941b65b..588d7a3a5ca06e2cf9e1d9b4cc9f72f045ae63b1 100644 --- a/tasks/0061_736_61736140_qa_1/task.toml +++ b/tasks/0061_736_61736140_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_736_61736140_qa_4/environment/bootstrap.sh b/tasks/0061_736_61736140_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_736_61736140_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_736_61736140_qa_4/environment/pull_bucket.py b/tasks/0061_736_61736140_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_736_61736140_qa_4/environment/pull_bucket.py +++ b/tasks/0061_736_61736140_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_736_61736140_qa_4/task.toml b/tasks/0061_736_61736140_qa_4/task.toml index 600e7cfa57bdb38982348956ee6d3a22925e0a7d..6bb01ee6f2a929bc730a0ffe96b5714840c1f880 100644 --- a/tasks/0061_736_61736140_qa_4/task.toml +++ b/tasks/0061_736_61736140_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_770_61770230_qa_3/environment/bootstrap.sh b/tasks/0061_770_61770230_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_770_61770230_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_770_61770230_qa_3/environment/pull_bucket.py b/tasks/0061_770_61770230_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_770_61770230_qa_3/environment/pull_bucket.py +++ b/tasks/0061_770_61770230_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_770_61770230_qa_3/task.toml b/tasks/0061_770_61770230_qa_3/task.toml index b7a5f91d3bf4fe3e134c6069df5cbc3e66586c36..00d8c59083eb7fc6834eaa8182bb55302b4c040a 100644 --- a/tasks/0061_770_61770230_qa_3/task.toml +++ b/tasks/0061_770_61770230_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_837_61837525_qa_5/environment/bootstrap.sh b/tasks/0061_837_61837525_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_837_61837525_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_837_61837525_qa_5/environment/pull_bucket.py b/tasks/0061_837_61837525_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_837_61837525_qa_5/environment/pull_bucket.py +++ b/tasks/0061_837_61837525_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_837_61837525_qa_5/task.toml b/tasks/0061_837_61837525_qa_5/task.toml index 29bc2e54dad5465254f04aaf8d2e9cfaf34aacd1..440d0f4983e4b77b064ca7b9e0d7d189918efd88 100644 --- a/tasks/0061_837_61837525_qa_5/task.toml +++ b/tasks/0061_837_61837525_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_860_61860657_qa_4/environment/bootstrap.sh b/tasks/0061_860_61860657_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_860_61860657_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_860_61860657_qa_4/environment/pull_bucket.py b/tasks/0061_860_61860657_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_860_61860657_qa_4/environment/pull_bucket.py +++ b/tasks/0061_860_61860657_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_860_61860657_qa_4/task.toml b/tasks/0061_860_61860657_qa_4/task.toml index f61b195cafbbbb7e606ca87a0fe8ff5dfd77246c..278b58c1ef9722dc2043bb9d7a73897782df4c01 100644 --- a/tasks/0061_860_61860657_qa_4/task.toml +++ b/tasks/0061_860_61860657_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_879_61879031_qa_2/environment/bootstrap.sh b/tasks/0061_879_61879031_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_879_61879031_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_879_61879031_qa_2/environment/pull_bucket.py b/tasks/0061_879_61879031_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_879_61879031_qa_2/environment/pull_bucket.py +++ b/tasks/0061_879_61879031_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_879_61879031_qa_2/task.toml b/tasks/0061_879_61879031_qa_2/task.toml index e68c723fa16cd80c66f95381ed574bb595aff44d..d566ed196f81ea055d53ad0e7d32e96f8c5c2e67 100644 --- a/tasks/0061_879_61879031_qa_2/task.toml +++ b/tasks/0061_879_61879031_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_879_61879031_qa_3/environment/bootstrap.sh b/tasks/0061_879_61879031_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_879_61879031_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_879_61879031_qa_3/environment/pull_bucket.py b/tasks/0061_879_61879031_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_879_61879031_qa_3/environment/pull_bucket.py +++ b/tasks/0061_879_61879031_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_879_61879031_qa_3/task.toml b/tasks/0061_879_61879031_qa_3/task.toml index 0a21320f52d1b7182c876d7e70e1101d00d71dd7..1128d47b5a994d2c45e1e4a503b318342e3b1cbd 100644 --- a/tasks/0061_879_61879031_qa_3/task.toml +++ b/tasks/0061_879_61879031_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_998_61998767_qa_1/environment/bootstrap.sh b/tasks/0061_998_61998767_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_998_61998767_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_998_61998767_qa_1/environment/pull_bucket.py b/tasks/0061_998_61998767_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_998_61998767_qa_1/environment/pull_bucket.py +++ b/tasks/0061_998_61998767_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_998_61998767_qa_1/task.toml b/tasks/0061_998_61998767_qa_1/task.toml index b87bf9d404c8e630c931bed9e663add250a36e55..e2caf21eb543d230c36ea781bd6d8e8df0b0939f 100644 --- a/tasks/0061_998_61998767_qa_1/task.toml +++ b/tasks/0061_998_61998767_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0061_998_61998767_qa_3/environment/bootstrap.sh b/tasks/0061_998_61998767_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0061_998_61998767_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0061_998_61998767_qa_3/environment/pull_bucket.py b/tasks/0061_998_61998767_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0061_998_61998767_qa_3/environment/pull_bucket.py +++ b/tasks/0061_998_61998767_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0061_998_61998767_qa_3/task.toml b/tasks/0061_998_61998767_qa_3/task.toml index 887c7cd92efa86203cfe378e320a62add5d2b74e..29e3d0aa6bc62f22902eabb70fe52896ab1d2a41 100644 --- a/tasks/0061_998_61998767_qa_3/task.toml +++ b/tasks/0061_998_61998767_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_015_62015834_qa_1/environment/bootstrap.sh b/tasks/0062_015_62015834_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_015_62015834_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_015_62015834_qa_1/environment/pull_bucket.py b/tasks/0062_015_62015834_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_015_62015834_qa_1/environment/pull_bucket.py +++ b/tasks/0062_015_62015834_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_015_62015834_qa_1/task.toml b/tasks/0062_015_62015834_qa_1/task.toml index 8c1e589c2be4507c364f0f818707c7e8e54110fc..713173f3cb3c1a3c986914d8f7281a9f73ba8275 100644 --- a/tasks/0062_015_62015834_qa_1/task.toml +++ b/tasks/0062_015_62015834_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_017_62017707_qa_4/environment/bootstrap.sh b/tasks/0062_017_62017707_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_017_62017707_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_017_62017707_qa_4/environment/pull_bucket.py b/tasks/0062_017_62017707_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_017_62017707_qa_4/environment/pull_bucket.py +++ b/tasks/0062_017_62017707_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_017_62017707_qa_4/task.toml b/tasks/0062_017_62017707_qa_4/task.toml index 759bd09d884b78beefa3cd40220238103643753d..68e9f1f21dfa9fd2a6f8eda4277a8f8dca7ad01c 100644 --- a/tasks/0062_017_62017707_qa_4/task.toml +++ b/tasks/0062_017_62017707_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_036_62036706_qa_4/environment/bootstrap.sh b/tasks/0062_036_62036706_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_036_62036706_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_036_62036706_qa_4/environment/pull_bucket.py b/tasks/0062_036_62036706_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_036_62036706_qa_4/environment/pull_bucket.py +++ b/tasks/0062_036_62036706_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_036_62036706_qa_4/task.toml b/tasks/0062_036_62036706_qa_4/task.toml index 97b352749054b9fb90135a5bab076b7ad6b45075..ca2e3b67bbc85289e958edb535956adc5cc045b0 100644 --- a/tasks/0062_036_62036706_qa_4/task.toml +++ b/tasks/0062_036_62036706_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_048_62048358_qa_3/environment/bootstrap.sh b/tasks/0062_048_62048358_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_048_62048358_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_048_62048358_qa_3/environment/pull_bucket.py b/tasks/0062_048_62048358_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_048_62048358_qa_3/environment/pull_bucket.py +++ b/tasks/0062_048_62048358_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_048_62048358_qa_3/task.toml b/tasks/0062_048_62048358_qa_3/task.toml index b533ef3fa5bb2515233f6c60eca4708c98253f59..72f5422ead19f930305c62a1fe1308b34be86c3a 100644 --- a/tasks/0062_048_62048358_qa_3/task.toml +++ b/tasks/0062_048_62048358_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_069_62069115_qa_4/environment/bootstrap.sh b/tasks/0062_069_62069115_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_069_62069115_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_069_62069115_qa_4/environment/pull_bucket.py b/tasks/0062_069_62069115_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_069_62069115_qa_4/environment/pull_bucket.py +++ b/tasks/0062_069_62069115_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_069_62069115_qa_4/task.toml b/tasks/0062_069_62069115_qa_4/task.toml index 07d3479942367a465ce66b6a94738efc9bd63baf..bfbecdffa148e5721590a8f88c7476a813bea705 100644 --- a/tasks/0062_069_62069115_qa_4/task.toml +++ b/tasks/0062_069_62069115_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_214_62214042_qa_4/environment/bootstrap.sh b/tasks/0062_214_62214042_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_214_62214042_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_214_62214042_qa_4/environment/pull_bucket.py b/tasks/0062_214_62214042_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_214_62214042_qa_4/environment/pull_bucket.py +++ b/tasks/0062_214_62214042_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_214_62214042_qa_4/task.toml b/tasks/0062_214_62214042_qa_4/task.toml index f33162075cfd16965631dbecdf05760a4151976c..9e2bfe96f89de818cd3425b20f152abd7e13e1de 100644 --- a/tasks/0062_214_62214042_qa_4/task.toml +++ b/tasks/0062_214_62214042_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_214_62214042_qa_5/environment/bootstrap.sh b/tasks/0062_214_62214042_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_214_62214042_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_214_62214042_qa_5/environment/pull_bucket.py b/tasks/0062_214_62214042_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_214_62214042_qa_5/environment/pull_bucket.py +++ b/tasks/0062_214_62214042_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_214_62214042_qa_5/task.toml b/tasks/0062_214_62214042_qa_5/task.toml index 4dedb9ba0204134e13b41b95daeeab6f829731cf..879b96eef5a8631b098adf3d09acc2f21915bfbc 100644 --- a/tasks/0062_214_62214042_qa_5/task.toml +++ b/tasks/0062_214_62214042_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_251_62251582_qa_2/environment/bootstrap.sh b/tasks/0062_251_62251582_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_251_62251582_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_251_62251582_qa_2/environment/pull_bucket.py b/tasks/0062_251_62251582_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_251_62251582_qa_2/environment/pull_bucket.py +++ b/tasks/0062_251_62251582_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_251_62251582_qa_2/task.toml b/tasks/0062_251_62251582_qa_2/task.toml index 71e9fff80da6db146b5bd26041b31392cb7f2d85..d5dac74edbddd98d1b21146749f29274c9188019 100644 --- a/tasks/0062_251_62251582_qa_2/task.toml +++ b/tasks/0062_251_62251582_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_251_62251582_qa_3/environment/bootstrap.sh b/tasks/0062_251_62251582_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_251_62251582_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_251_62251582_qa_3/environment/pull_bucket.py b/tasks/0062_251_62251582_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_251_62251582_qa_3/environment/pull_bucket.py +++ b/tasks/0062_251_62251582_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_251_62251582_qa_3/task.toml b/tasks/0062_251_62251582_qa_3/task.toml index 40f13260fa7e2320f846fa454e7c2714e83d57c2..de384138c31d29a7f60d790e585d46f31f8f6d82 100644 --- a/tasks/0062_251_62251582_qa_3/task.toml +++ b/tasks/0062_251_62251582_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_362_62362701_qa_4/environment/bootstrap.sh b/tasks/0062_362_62362701_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_362_62362701_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_362_62362701_qa_4/environment/pull_bucket.py b/tasks/0062_362_62362701_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_362_62362701_qa_4/environment/pull_bucket.py +++ b/tasks/0062_362_62362701_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_362_62362701_qa_4/task.toml b/tasks/0062_362_62362701_qa_4/task.toml index c8368b9964ad70e0077b3a26ad245caab825791a..4f73a28bfb01269960c23dbb3ffb44c3550e9eea 100644 --- a/tasks/0062_362_62362701_qa_4/task.toml +++ b/tasks/0062_362_62362701_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_379_62379173_qa_2/environment/bootstrap.sh b/tasks/0062_379_62379173_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_379_62379173_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_379_62379173_qa_2/environment/pull_bucket.py b/tasks/0062_379_62379173_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_379_62379173_qa_2/environment/pull_bucket.py +++ b/tasks/0062_379_62379173_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_379_62379173_qa_2/task.toml b/tasks/0062_379_62379173_qa_2/task.toml index c27fa88d9b1fc919829cab36699b789eb140e7ec..5d120560336e7ea6fe28eef265918d7d9c887c64 100644 --- a/tasks/0062_379_62379173_qa_2/task.toml +++ b/tasks/0062_379_62379173_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_379_62379173_qa_3/environment/bootstrap.sh b/tasks/0062_379_62379173_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_379_62379173_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_379_62379173_qa_3/environment/pull_bucket.py b/tasks/0062_379_62379173_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_379_62379173_qa_3/environment/pull_bucket.py +++ b/tasks/0062_379_62379173_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_379_62379173_qa_3/task.toml b/tasks/0062_379_62379173_qa_3/task.toml index 3ce79b1a745ba94c51954c901712786961dc47ac..63f89e06624ae3ba1ac32f429cfa3c94c6c83e22 100644 --- a/tasks/0062_379_62379173_qa_3/task.toml +++ b/tasks/0062_379_62379173_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_391_62391096_qa_3/environment/bootstrap.sh b/tasks/0062_391_62391096_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_391_62391096_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_391_62391096_qa_3/environment/pull_bucket.py b/tasks/0062_391_62391096_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_391_62391096_qa_3/environment/pull_bucket.py +++ b/tasks/0062_391_62391096_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_391_62391096_qa_3/task.toml b/tasks/0062_391_62391096_qa_3/task.toml index 43e025e12605317deb2bf8b1df3b936b5fc47787..4994d426fb0d079781fc0cd2f3b7a377897b033f 100644 --- a/tasks/0062_391_62391096_qa_3/task.toml +++ b/tasks/0062_391_62391096_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_401_62401866_qa_3/environment/bootstrap.sh b/tasks/0062_401_62401866_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_401_62401866_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_401_62401866_qa_3/environment/pull_bucket.py b/tasks/0062_401_62401866_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_401_62401866_qa_3/environment/pull_bucket.py +++ b/tasks/0062_401_62401866_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_401_62401866_qa_3/task.toml b/tasks/0062_401_62401866_qa_3/task.toml index ba5f46f8aace428a521459ec44af13dde7c5b71b..7844dfd7b5e7ab7df1e946807c42b7a45846be6c 100644 --- a/tasks/0062_401_62401866_qa_3/task.toml +++ b/tasks/0062_401_62401866_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_450_62450924_qa_2/environment/bootstrap.sh b/tasks/0062_450_62450924_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_450_62450924_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_450_62450924_qa_2/environment/pull_bucket.py b/tasks/0062_450_62450924_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_450_62450924_qa_2/environment/pull_bucket.py +++ b/tasks/0062_450_62450924_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_450_62450924_qa_2/task.toml b/tasks/0062_450_62450924_qa_2/task.toml index d75f2645fa26abe23c4312c190d2f8ffb8c90bb2..70dee1d5e7f4797a6b0bac3ab4e276f2dbe2ffa8 100644 --- a/tasks/0062_450_62450924_qa_2/task.toml +++ b/tasks/0062_450_62450924_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_457_62457023_qa_2/environment/bootstrap.sh b/tasks/0062_457_62457023_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_457_62457023_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_457_62457023_qa_2/environment/pull_bucket.py b/tasks/0062_457_62457023_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_457_62457023_qa_2/environment/pull_bucket.py +++ b/tasks/0062_457_62457023_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_457_62457023_qa_2/task.toml b/tasks/0062_457_62457023_qa_2/task.toml index a911d1c128f9878bf5f32b15b50a6e767eab177a..d96f3f890ae3a6cc8613fbab268210cd63f5b4e2 100644 --- a/tasks/0062_457_62457023_qa_2/task.toml +++ b/tasks/0062_457_62457023_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_459_62459243_qa_5/environment/bootstrap.sh b/tasks/0062_459_62459243_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_459_62459243_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_459_62459243_qa_5/environment/pull_bucket.py b/tasks/0062_459_62459243_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_459_62459243_qa_5/environment/pull_bucket.py +++ b/tasks/0062_459_62459243_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_459_62459243_qa_5/task.toml b/tasks/0062_459_62459243_qa_5/task.toml index 95177232b6235f0a4631910bf1128456fe5c65a6..9c5cc2b4295cf66e2cc7d2321bd2ddbeab352267 100644 --- a/tasks/0062_459_62459243_qa_5/task.toml +++ b/tasks/0062_459_62459243_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_459_62459774_qa_4/environment/bootstrap.sh b/tasks/0062_459_62459774_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_459_62459774_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_459_62459774_qa_4/environment/pull_bucket.py b/tasks/0062_459_62459774_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_459_62459774_qa_4/environment/pull_bucket.py +++ b/tasks/0062_459_62459774_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_459_62459774_qa_4/task.toml b/tasks/0062_459_62459774_qa_4/task.toml index 3924241e766a2b8a2a98a70c8fa660354ece4f03..61ad15215994737d63eb0d1c21be21f891a83c80 100644 --- a/tasks/0062_459_62459774_qa_4/task.toml +++ b/tasks/0062_459_62459774_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_545_62545707_qa_1/environment/bootstrap.sh b/tasks/0062_545_62545707_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_545_62545707_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_545_62545707_qa_1/environment/pull_bucket.py b/tasks/0062_545_62545707_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_545_62545707_qa_1/environment/pull_bucket.py +++ b/tasks/0062_545_62545707_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_545_62545707_qa_1/task.toml b/tasks/0062_545_62545707_qa_1/task.toml index 0c77b2391c70150d0bc02909a564dfe7d7842c0e..355f841254d352bfb51fb384d9cace1994430085 100644 --- a/tasks/0062_545_62545707_qa_1/task.toml +++ b/tasks/0062_545_62545707_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_545_62545707_qa_2/environment/bootstrap.sh b/tasks/0062_545_62545707_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_545_62545707_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_545_62545707_qa_2/environment/pull_bucket.py b/tasks/0062_545_62545707_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_545_62545707_qa_2/environment/pull_bucket.py +++ b/tasks/0062_545_62545707_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_545_62545707_qa_2/task.toml b/tasks/0062_545_62545707_qa_2/task.toml index fe28eb0f3d7c2c3c1a2834d2933b7f616a6fb2df..847648e64d073697f9016e6e95b987a229cf581f 100644 --- a/tasks/0062_545_62545707_qa_2/task.toml +++ b/tasks/0062_545_62545707_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_545_62545707_qa_5/environment/bootstrap.sh b/tasks/0062_545_62545707_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_545_62545707_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_545_62545707_qa_5/environment/pull_bucket.py b/tasks/0062_545_62545707_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_545_62545707_qa_5/environment/pull_bucket.py +++ b/tasks/0062_545_62545707_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_545_62545707_qa_5/task.toml b/tasks/0062_545_62545707_qa_5/task.toml index a8c46d9a640a02809e2b097339ac5568dd3c5719..3717cfb526e3e223b13445af988f14ed4e9c6f32 100644 --- a/tasks/0062_545_62545707_qa_5/task.toml +++ b/tasks/0062_545_62545707_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_642_62642092_qa_4/environment/bootstrap.sh b/tasks/0062_642_62642092_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_642_62642092_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_642_62642092_qa_4/environment/pull_bucket.py b/tasks/0062_642_62642092_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_642_62642092_qa_4/environment/pull_bucket.py +++ b/tasks/0062_642_62642092_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_642_62642092_qa_4/task.toml b/tasks/0062_642_62642092_qa_4/task.toml index 66b5135c700dc9bf24fb92ac960b5428fead5b05..652d7164635552beeec2b9294e112cc49b04035d 100644 --- a/tasks/0062_642_62642092_qa_4/task.toml +++ b/tasks/0062_642_62642092_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_642_62642092_qa_5/environment/bootstrap.sh b/tasks/0062_642_62642092_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_642_62642092_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_642_62642092_qa_5/environment/pull_bucket.py b/tasks/0062_642_62642092_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_642_62642092_qa_5/environment/pull_bucket.py +++ b/tasks/0062_642_62642092_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_642_62642092_qa_5/task.toml b/tasks/0062_642_62642092_qa_5/task.toml index bbffcb14fb413e7f530c7fe90dec73c5dc758d9f..50dc3362e15826d0313d8cfb33c5c8ceeab56601 100644 --- a/tasks/0062_642_62642092_qa_5/task.toml +++ b/tasks/0062_642_62642092_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_653_62653158_qa_1/environment/bootstrap.sh b/tasks/0062_653_62653158_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_653_62653158_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_653_62653158_qa_1/environment/pull_bucket.py b/tasks/0062_653_62653158_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_653_62653158_qa_1/environment/pull_bucket.py +++ b/tasks/0062_653_62653158_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_653_62653158_qa_1/task.toml b/tasks/0062_653_62653158_qa_1/task.toml index a67c59a80bbce2e5afd839e93bddff41b5233aba..99360f07d98918b95a5e58debab258948a84c5f7 100644 --- a/tasks/0062_653_62653158_qa_1/task.toml +++ b/tasks/0062_653_62653158_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_653_62653158_qa_5/environment/bootstrap.sh b/tasks/0062_653_62653158_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_653_62653158_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_653_62653158_qa_5/environment/pull_bucket.py b/tasks/0062_653_62653158_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_653_62653158_qa_5/environment/pull_bucket.py +++ b/tasks/0062_653_62653158_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_653_62653158_qa_5/task.toml b/tasks/0062_653_62653158_qa_5/task.toml index 249954fcdf4ac24d22ae56640828d3da538e30b9..c638a16b028bd68d29748df93f8af6c66c4930a7 100644 --- a/tasks/0062_653_62653158_qa_5/task.toml +++ b/tasks/0062_653_62653158_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_663_62663778_qa_2/environment/bootstrap.sh b/tasks/0062_663_62663778_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_663_62663778_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_663_62663778_qa_2/environment/pull_bucket.py b/tasks/0062_663_62663778_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_663_62663778_qa_2/environment/pull_bucket.py +++ b/tasks/0062_663_62663778_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_663_62663778_qa_2/task.toml b/tasks/0062_663_62663778_qa_2/task.toml index 37e2c0501986791f70187753ab34ec1a226021a9..20e8fc2bf551e5ac2ab49938ac666edfc953a0e4 100644 --- a/tasks/0062_663_62663778_qa_2/task.toml +++ b/tasks/0062_663_62663778_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_755_62755543_qa_2/environment/bootstrap.sh b/tasks/0062_755_62755543_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_755_62755543_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_755_62755543_qa_2/environment/pull_bucket.py b/tasks/0062_755_62755543_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_755_62755543_qa_2/environment/pull_bucket.py +++ b/tasks/0062_755_62755543_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_755_62755543_qa_2/task.toml b/tasks/0062_755_62755543_qa_2/task.toml index 2917b9a1b3d34937d0f0299c18a6dd6f374d89c6..1275a35dba2e92bb20ad1fff72faff2267452397 100644 --- a/tasks/0062_755_62755543_qa_2/task.toml +++ b/tasks/0062_755_62755543_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_755_62755543_qa_4/environment/bootstrap.sh b/tasks/0062_755_62755543_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_755_62755543_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_755_62755543_qa_4/environment/pull_bucket.py b/tasks/0062_755_62755543_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_755_62755543_qa_4/environment/pull_bucket.py +++ b/tasks/0062_755_62755543_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_755_62755543_qa_4/task.toml b/tasks/0062_755_62755543_qa_4/task.toml index 56ee1562b42ff1b808aa76947303039466745a63..1322d5d51c2aa991cb1884e1ff1a88b7747c4679 100644 --- a/tasks/0062_755_62755543_qa_4/task.toml +++ b/tasks/0062_755_62755543_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_869_62869673_qa_2/environment/bootstrap.sh b/tasks/0062_869_62869673_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_869_62869673_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_869_62869673_qa_2/environment/pull_bucket.py b/tasks/0062_869_62869673_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_869_62869673_qa_2/environment/pull_bucket.py +++ b/tasks/0062_869_62869673_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_869_62869673_qa_2/task.toml b/tasks/0062_869_62869673_qa_2/task.toml index 0239a7cae936a3d48ac250b8d0b68fccd7b275f5..f8e3090a0e5c7d6388d1c3577e089dfd7854f4b1 100644 --- a/tasks/0062_869_62869673_qa_2/task.toml +++ b/tasks/0062_869_62869673_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_945_62945279_qa_1/environment/bootstrap.sh b/tasks/0062_945_62945279_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_945_62945279_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_945_62945279_qa_1/environment/pull_bucket.py b/tasks/0062_945_62945279_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_945_62945279_qa_1/environment/pull_bucket.py +++ b/tasks/0062_945_62945279_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_945_62945279_qa_1/task.toml b/tasks/0062_945_62945279_qa_1/task.toml index 195f0563c09b3165be0814eeaf6c2111bd9f5a42..e1823b1117ea3ec5e9e7b1fe24b53355488f7480 100644 --- a/tasks/0062_945_62945279_qa_1/task.toml +++ b/tasks/0062_945_62945279_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_945_62945279_qa_3/environment/bootstrap.sh b/tasks/0062_945_62945279_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_945_62945279_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_945_62945279_qa_3/environment/pull_bucket.py b/tasks/0062_945_62945279_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_945_62945279_qa_3/environment/pull_bucket.py +++ b/tasks/0062_945_62945279_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_945_62945279_qa_3/task.toml b/tasks/0062_945_62945279_qa_3/task.toml index ad8abce5694c6ef4efec9a35d850a0b26dbe3c8f..1c248250ccf6bb33c7f64fe3a163e7d4f4c43263 100644 --- a/tasks/0062_945_62945279_qa_3/task.toml +++ b/tasks/0062_945_62945279_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_973_62973078_qa_1/environment/bootstrap.sh b/tasks/0062_973_62973078_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_973_62973078_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_973_62973078_qa_1/environment/pull_bucket.py b/tasks/0062_973_62973078_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_973_62973078_qa_1/environment/pull_bucket.py +++ b/tasks/0062_973_62973078_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_973_62973078_qa_1/task.toml b/tasks/0062_973_62973078_qa_1/task.toml index f27bc0005461f48c9ae052c79711db240bc17f3a..b50ce26a48ceb4c087a71828b517d677cf30ac15 100644 --- a/tasks/0062_973_62973078_qa_1/task.toml +++ b/tasks/0062_973_62973078_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_973_62973078_qa_2/environment/bootstrap.sh b/tasks/0062_973_62973078_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_973_62973078_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_973_62973078_qa_2/environment/pull_bucket.py b/tasks/0062_973_62973078_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_973_62973078_qa_2/environment/pull_bucket.py +++ b/tasks/0062_973_62973078_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_973_62973078_qa_2/task.toml b/tasks/0062_973_62973078_qa_2/task.toml index 9b81a2bb4c51b215852c65ce8da3488b0acb9984..c932ac3a037e33aa5bbff250ffb0cfa1003c920a 100644 --- a/tasks/0062_973_62973078_qa_2/task.toml +++ b/tasks/0062_973_62973078_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_986_62986591_qa_2/environment/bootstrap.sh b/tasks/0062_986_62986591_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_986_62986591_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_986_62986591_qa_2/environment/pull_bucket.py b/tasks/0062_986_62986591_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_986_62986591_qa_2/environment/pull_bucket.py +++ b/tasks/0062_986_62986591_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_986_62986591_qa_2/task.toml b/tasks/0062_986_62986591_qa_2/task.toml index badbaa68d6c0f0758438a5dcf7832cb0e3b086bc..21027df457d15bca641cade5b901af43672e092a 100644 --- a/tasks/0062_986_62986591_qa_2/task.toml +++ b/tasks/0062_986_62986591_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0062_986_62986591_qa_3/environment/bootstrap.sh b/tasks/0062_986_62986591_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0062_986_62986591_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0062_986_62986591_qa_3/environment/pull_bucket.py b/tasks/0062_986_62986591_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0062_986_62986591_qa_3/environment/pull_bucket.py +++ b/tasks/0062_986_62986591_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0062_986_62986591_qa_3/task.toml b/tasks/0062_986_62986591_qa_3/task.toml index a4a4bd23858db0b074c5f6510490a9f4b06a3e1f..036b4fb9c756efebbddbf63f75f8565ff2bd4481 100644 --- a/tasks/0062_986_62986591_qa_3/task.toml +++ b/tasks/0062_986_62986591_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_002_63002419_qa_1/environment/bootstrap.sh b/tasks/0063_002_63002419_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_002_63002419_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_002_63002419_qa_1/environment/pull_bucket.py b/tasks/0063_002_63002419_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_002_63002419_qa_1/environment/pull_bucket.py +++ b/tasks/0063_002_63002419_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_002_63002419_qa_1/task.toml b/tasks/0063_002_63002419_qa_1/task.toml index 3af52ccf47b62fc5a2b3c83235c3a1ddf46ef077..5c66d5cff13e9142b14f04869804eb073abf4967 100644 --- a/tasks/0063_002_63002419_qa_1/task.toml +++ b/tasks/0063_002_63002419_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_032_63032404_qa_3/environment/bootstrap.sh b/tasks/0063_032_63032404_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_032_63032404_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_032_63032404_qa_3/environment/pull_bucket.py b/tasks/0063_032_63032404_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_032_63032404_qa_3/environment/pull_bucket.py +++ b/tasks/0063_032_63032404_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_032_63032404_qa_3/task.toml b/tasks/0063_032_63032404_qa_3/task.toml index 7f98cad8c5cf07be328bc73935b9215681b95849..1c78b6fcf4ab38dc121f4a1ca996d5ef6433cd76 100644 --- a/tasks/0063_032_63032404_qa_3/task.toml +++ b/tasks/0063_032_63032404_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_038_63038880_qa_3/environment/bootstrap.sh b/tasks/0063_038_63038880_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_038_63038880_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_038_63038880_qa_3/environment/pull_bucket.py b/tasks/0063_038_63038880_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_038_63038880_qa_3/environment/pull_bucket.py +++ b/tasks/0063_038_63038880_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_038_63038880_qa_3/task.toml b/tasks/0063_038_63038880_qa_3/task.toml index e4c8074e79faffa1b6d4acddf110e26d11b7e123..37d018671901e1b4ed4cf611ac66719b6362fe89 100644 --- a/tasks/0063_038_63038880_qa_3/task.toml +++ b/tasks/0063_038_63038880_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_056_63056064_qa_2/environment/bootstrap.sh b/tasks/0063_056_63056064_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_056_63056064_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_056_63056064_qa_2/environment/pull_bucket.py b/tasks/0063_056_63056064_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_056_63056064_qa_2/environment/pull_bucket.py +++ b/tasks/0063_056_63056064_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_056_63056064_qa_2/task.toml b/tasks/0063_056_63056064_qa_2/task.toml index 43ae8d77ae8a9f0454a375835c2951fcda2c30fd..188e3782411614be82a005049ee7aecd312705c4 100644 --- a/tasks/0063_056_63056064_qa_2/task.toml +++ b/tasks/0063_056_63056064_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_184_63184274_qa_1/environment/bootstrap.sh b/tasks/0063_184_63184274_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_184_63184274_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_184_63184274_qa_1/environment/pull_bucket.py b/tasks/0063_184_63184274_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_184_63184274_qa_1/environment/pull_bucket.py +++ b/tasks/0063_184_63184274_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_184_63184274_qa_1/task.toml b/tasks/0063_184_63184274_qa_1/task.toml index 23dc38055b3aca2db8ce5a3779ce10462db94268..838ed1b73a9cfd281a82f064cfaa05a91ea39989 100644 --- a/tasks/0063_184_63184274_qa_1/task.toml +++ b/tasks/0063_184_63184274_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_189_63189965_qa_5/environment/bootstrap.sh b/tasks/0063_189_63189965_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_189_63189965_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_189_63189965_qa_5/environment/pull_bucket.py b/tasks/0063_189_63189965_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_189_63189965_qa_5/environment/pull_bucket.py +++ b/tasks/0063_189_63189965_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_189_63189965_qa_5/task.toml b/tasks/0063_189_63189965_qa_5/task.toml index 981d4a3de653f41ca90999e4d6538b6d11899750..1889d7f87838f170a0968f1a0fd90aab3bac6c11 100644 --- a/tasks/0063_189_63189965_qa_5/task.toml +++ b/tasks/0063_189_63189965_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_228_63228280_qa_3/environment/bootstrap.sh b/tasks/0063_228_63228280_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_228_63228280_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_228_63228280_qa_3/environment/pull_bucket.py b/tasks/0063_228_63228280_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_228_63228280_qa_3/environment/pull_bucket.py +++ b/tasks/0063_228_63228280_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_228_63228280_qa_3/task.toml b/tasks/0063_228_63228280_qa_3/task.toml index bc42eef1e269fdfa8c541600ae85ef3621a15028..44da4521360ebe311c2d26fbdd4b41c6078ead07 100644 --- a/tasks/0063_228_63228280_qa_3/task.toml +++ b/tasks/0063_228_63228280_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_243_63243800_qa_2/environment/bootstrap.sh b/tasks/0063_243_63243800_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_243_63243800_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_243_63243800_qa_2/environment/pull_bucket.py b/tasks/0063_243_63243800_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_243_63243800_qa_2/environment/pull_bucket.py +++ b/tasks/0063_243_63243800_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_243_63243800_qa_2/task.toml b/tasks/0063_243_63243800_qa_2/task.toml index 8b5915dbefdebe4b185dffa90664ed1389c522c8..5d60078ebd9225e5e48c19d7548265ea4af23a3e 100644 --- a/tasks/0063_243_63243800_qa_2/task.toml +++ b/tasks/0063_243_63243800_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_304_63304459_qa_1/environment/bootstrap.sh b/tasks/0063_304_63304459_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_304_63304459_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_304_63304459_qa_1/environment/pull_bucket.py b/tasks/0063_304_63304459_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_304_63304459_qa_1/environment/pull_bucket.py +++ b/tasks/0063_304_63304459_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_304_63304459_qa_1/task.toml b/tasks/0063_304_63304459_qa_1/task.toml index bd431cc79fc1e74853dcf3bb79cd9c635c1156f2..d0748620ea3223f33b589ad2a84a1259753f7454 100644 --- a/tasks/0063_304_63304459_qa_1/task.toml +++ b/tasks/0063_304_63304459_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_341_63341228_qa_2/environment/bootstrap.sh b/tasks/0063_341_63341228_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_341_63341228_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_341_63341228_qa_2/environment/pull_bucket.py b/tasks/0063_341_63341228_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_341_63341228_qa_2/environment/pull_bucket.py +++ b/tasks/0063_341_63341228_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_341_63341228_qa_2/task.toml b/tasks/0063_341_63341228_qa_2/task.toml index 9938076fef204837beb66c2e23dec58ff5ed6ed8..471f6e9ae8e1e9a2f5661da946cc9a40be140ab5 100644 --- a/tasks/0063_341_63341228_qa_2/task.toml +++ b/tasks/0063_341_63341228_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_341_63341228_qa_4/environment/bootstrap.sh b/tasks/0063_341_63341228_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_341_63341228_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_341_63341228_qa_4/environment/pull_bucket.py b/tasks/0063_341_63341228_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_341_63341228_qa_4/environment/pull_bucket.py +++ b/tasks/0063_341_63341228_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_341_63341228_qa_4/task.toml b/tasks/0063_341_63341228_qa_4/task.toml index b6e0280bda29af0e301f6f55c8bd881ecbeed8e6..9d6a03682cfb9d2e2a62acd66af00a1f7442f805 100644 --- a/tasks/0063_341_63341228_qa_4/task.toml +++ b/tasks/0063_341_63341228_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_350_63350967_qa_3/environment/bootstrap.sh b/tasks/0063_350_63350967_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_350_63350967_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_350_63350967_qa_3/environment/pull_bucket.py b/tasks/0063_350_63350967_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_350_63350967_qa_3/environment/pull_bucket.py +++ b/tasks/0063_350_63350967_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_350_63350967_qa_3/task.toml b/tasks/0063_350_63350967_qa_3/task.toml index e44a8b44036750ee1f60ec0e982be1581106582b..8e982d776df1329a9d4dfb71b85a34d6087502a8 100644 --- a/tasks/0063_350_63350967_qa_3/task.toml +++ b/tasks/0063_350_63350967_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_386_63386776_qa_1/environment/bootstrap.sh b/tasks/0063_386_63386776_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_386_63386776_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_386_63386776_qa_1/environment/pull_bucket.py b/tasks/0063_386_63386776_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_386_63386776_qa_1/environment/pull_bucket.py +++ b/tasks/0063_386_63386776_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_386_63386776_qa_1/task.toml b/tasks/0063_386_63386776_qa_1/task.toml index 56b66901df111a450f0c751796f05ee033e2950d..6044cc217bbaa4efc6a12d9ca571163ce45c817f 100644 --- a/tasks/0063_386_63386776_qa_1/task.toml +++ b/tasks/0063_386_63386776_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_386_63386776_qa_5/environment/bootstrap.sh b/tasks/0063_386_63386776_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_386_63386776_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_386_63386776_qa_5/environment/pull_bucket.py b/tasks/0063_386_63386776_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_386_63386776_qa_5/environment/pull_bucket.py +++ b/tasks/0063_386_63386776_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_386_63386776_qa_5/task.toml b/tasks/0063_386_63386776_qa_5/task.toml index 1a939bfa1f64be41593a04cdcd287d59d814fca0..157c3da69a53d1249c5cbbe393b09d43664d7760 100644 --- a/tasks/0063_386_63386776_qa_5/task.toml +++ b/tasks/0063_386_63386776_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_399_63399748_qa_1/environment/bootstrap.sh b/tasks/0063_399_63399748_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_399_63399748_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_399_63399748_qa_1/environment/pull_bucket.py b/tasks/0063_399_63399748_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_399_63399748_qa_1/environment/pull_bucket.py +++ b/tasks/0063_399_63399748_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_399_63399748_qa_1/task.toml b/tasks/0063_399_63399748_qa_1/task.toml index edf89f332ff89279215c9bbe82f486eabc8a62c0..3770c0c73dc5f5ac730354f6d446da977240c448 100644 --- a/tasks/0063_399_63399748_qa_1/task.toml +++ b/tasks/0063_399_63399748_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_399_63399748_qa_5/environment/bootstrap.sh b/tasks/0063_399_63399748_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_399_63399748_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_399_63399748_qa_5/environment/pull_bucket.py b/tasks/0063_399_63399748_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_399_63399748_qa_5/environment/pull_bucket.py +++ b/tasks/0063_399_63399748_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_399_63399748_qa_5/task.toml b/tasks/0063_399_63399748_qa_5/task.toml index 0ced1048ef9a9d807dbf56024a015bb97422a84c..2a2ffb439f9acef5ee9d7667326bec5a5730a7de 100644 --- a/tasks/0063_399_63399748_qa_5/task.toml +++ b/tasks/0063_399_63399748_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_468_63468812_qa_1/environment/bootstrap.sh b/tasks/0063_468_63468812_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_468_63468812_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_468_63468812_qa_1/environment/pull_bucket.py b/tasks/0063_468_63468812_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_468_63468812_qa_1/environment/pull_bucket.py +++ b/tasks/0063_468_63468812_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_468_63468812_qa_1/task.toml b/tasks/0063_468_63468812_qa_1/task.toml index d3b407749b7a9c9ceee1385ff58bfb9b604fcdb1..148fccb31eda558851188c4d9e53674f22f434b4 100644 --- a/tasks/0063_468_63468812_qa_1/task.toml +++ b/tasks/0063_468_63468812_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_468_63468812_qa_5/environment/bootstrap.sh b/tasks/0063_468_63468812_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_468_63468812_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_468_63468812_qa_5/environment/pull_bucket.py b/tasks/0063_468_63468812_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_468_63468812_qa_5/environment/pull_bucket.py +++ b/tasks/0063_468_63468812_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_468_63468812_qa_5/task.toml b/tasks/0063_468_63468812_qa_5/task.toml index 4ea4fd0a4ca3c786c7e833617457edea7b4a0095..d9922931c1957318cd1e65293247f7b5d6d1e104 100644 --- a/tasks/0063_468_63468812_qa_5/task.toml +++ b/tasks/0063_468_63468812_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_482_63482132_qa_1/environment/bootstrap.sh b/tasks/0063_482_63482132_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_482_63482132_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_482_63482132_qa_1/environment/pull_bucket.py b/tasks/0063_482_63482132_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_482_63482132_qa_1/environment/pull_bucket.py +++ b/tasks/0063_482_63482132_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_482_63482132_qa_1/task.toml b/tasks/0063_482_63482132_qa_1/task.toml index 645f43607604e85dcf44e64ab1d8c0a8f025a7ae..6e53c4408e33c0dfd9210ccc044cdaa4e2dd4dd8 100644 --- a/tasks/0063_482_63482132_qa_1/task.toml +++ b/tasks/0063_482_63482132_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_482_63482132_qa_5/environment/bootstrap.sh b/tasks/0063_482_63482132_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_482_63482132_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_482_63482132_qa_5/environment/pull_bucket.py b/tasks/0063_482_63482132_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_482_63482132_qa_5/environment/pull_bucket.py +++ b/tasks/0063_482_63482132_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_482_63482132_qa_5/task.toml b/tasks/0063_482_63482132_qa_5/task.toml index ef54cc5fb465001bd873b42e6ae4de257879de8c..9891844d8c42e92f1f84d0a0c5be7ea22a861d25 100644 --- a/tasks/0063_482_63482132_qa_5/task.toml +++ b/tasks/0063_482_63482132_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_490_63490471_qa_1/environment/bootstrap.sh b/tasks/0063_490_63490471_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_490_63490471_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_490_63490471_qa_1/environment/pull_bucket.py b/tasks/0063_490_63490471_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_490_63490471_qa_1/environment/pull_bucket.py +++ b/tasks/0063_490_63490471_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_490_63490471_qa_1/task.toml b/tasks/0063_490_63490471_qa_1/task.toml index 8e880c2ce7fa8373b47f533b24345f96adeea71a..cf1b9bd35f14c7a48b625750e577ca9087ef559d 100644 --- a/tasks/0063_490_63490471_qa_1/task.toml +++ b/tasks/0063_490_63490471_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_547_63547734_qa_1/environment/bootstrap.sh b/tasks/0063_547_63547734_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_547_63547734_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_547_63547734_qa_1/environment/pull_bucket.py b/tasks/0063_547_63547734_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_547_63547734_qa_1/environment/pull_bucket.py +++ b/tasks/0063_547_63547734_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_547_63547734_qa_1/task.toml b/tasks/0063_547_63547734_qa_1/task.toml index dcbd074a3217b614dadcce3b85a51a705659847e..475c0e94c4a1fe5691f34737cad77e4892e0ac17 100644 --- a/tasks/0063_547_63547734_qa_1/task.toml +++ b/tasks/0063_547_63547734_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_552_63552439_qa_4/environment/bootstrap.sh b/tasks/0063_552_63552439_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_552_63552439_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_552_63552439_qa_4/environment/pull_bucket.py b/tasks/0063_552_63552439_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_552_63552439_qa_4/environment/pull_bucket.py +++ b/tasks/0063_552_63552439_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_552_63552439_qa_4/task.toml b/tasks/0063_552_63552439_qa_4/task.toml index 659590be7afcc3655ca1577630d32fb894039c10..544c910456e89a4450ba1bd24ae8f7aa9180d8c1 100644 --- a/tasks/0063_552_63552439_qa_4/task.toml +++ b/tasks/0063_552_63552439_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_575_63575701_qa_2/environment/bootstrap.sh b/tasks/0063_575_63575701_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_575_63575701_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_575_63575701_qa_2/environment/pull_bucket.py b/tasks/0063_575_63575701_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_575_63575701_qa_2/environment/pull_bucket.py +++ b/tasks/0063_575_63575701_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_575_63575701_qa_2/task.toml b/tasks/0063_575_63575701_qa_2/task.toml index 8846d91cdab175a351566c6ca64f494fbc30f97f..d920fccd9d7597b844d4e8329f1571e2345fcc0b 100644 --- a/tasks/0063_575_63575701_qa_2/task.toml +++ b/tasks/0063_575_63575701_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_605_63605458_qa_2/environment/bootstrap.sh b/tasks/0063_605_63605458_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_605_63605458_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_605_63605458_qa_2/environment/pull_bucket.py b/tasks/0063_605_63605458_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_605_63605458_qa_2/environment/pull_bucket.py +++ b/tasks/0063_605_63605458_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_605_63605458_qa_2/task.toml b/tasks/0063_605_63605458_qa_2/task.toml index 5ded0b7e816a1827c7de2f01ad8e94b1f387cacd..2bcffec961657ef9ad5960729887b326cbbfe1a5 100644 --- a/tasks/0063_605_63605458_qa_2/task.toml +++ b/tasks/0063_605_63605458_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_605_63605458_qa_3/environment/bootstrap.sh b/tasks/0063_605_63605458_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_605_63605458_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_605_63605458_qa_3/environment/pull_bucket.py b/tasks/0063_605_63605458_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_605_63605458_qa_3/environment/pull_bucket.py +++ b/tasks/0063_605_63605458_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_605_63605458_qa_3/task.toml b/tasks/0063_605_63605458_qa_3/task.toml index 2d98c59934c0868624a5b63d539abe1b2dbec4b4..677ac1958c41290ab520ea8b17a09314ef5e4746 100644 --- a/tasks/0063_605_63605458_qa_3/task.toml +++ b/tasks/0063_605_63605458_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_605_63605458_qa_4/environment/bootstrap.sh b/tasks/0063_605_63605458_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_605_63605458_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_605_63605458_qa_4/environment/pull_bucket.py b/tasks/0063_605_63605458_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_605_63605458_qa_4/environment/pull_bucket.py +++ b/tasks/0063_605_63605458_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_605_63605458_qa_4/task.toml b/tasks/0063_605_63605458_qa_4/task.toml index 72abbc445d7a556e4254f2b9896552e3125faa2a..9496108ba838e336867dd016d574a3009fdb9a47 100644 --- a/tasks/0063_605_63605458_qa_4/task.toml +++ b/tasks/0063_605_63605458_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_631_63631791_qa_5/environment/bootstrap.sh b/tasks/0063_631_63631791_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_631_63631791_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_631_63631791_qa_5/environment/pull_bucket.py b/tasks/0063_631_63631791_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_631_63631791_qa_5/environment/pull_bucket.py +++ b/tasks/0063_631_63631791_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_631_63631791_qa_5/task.toml b/tasks/0063_631_63631791_qa_5/task.toml index 64c9a651be0c82c65875c3d97709f8834e642b27..7014d5169866c2e75e6fb7208e91a580fc8585a1 100644 --- a/tasks/0063_631_63631791_qa_5/task.toml +++ b/tasks/0063_631_63631791_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_668_63668659_qa_2/environment/bootstrap.sh b/tasks/0063_668_63668659_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_668_63668659_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_668_63668659_qa_2/environment/pull_bucket.py b/tasks/0063_668_63668659_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_668_63668659_qa_2/environment/pull_bucket.py +++ b/tasks/0063_668_63668659_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_668_63668659_qa_2/task.toml b/tasks/0063_668_63668659_qa_2/task.toml index 41ebbe2f7aca9f9876f4d94d5a2bc9e8481b6737..fccc172a0be5ffc05137e84205b057d1d14ea1c1 100644 --- a/tasks/0063_668_63668659_qa_2/task.toml +++ b/tasks/0063_668_63668659_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_708_63708411_qa_1/environment/bootstrap.sh b/tasks/0063_708_63708411_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_708_63708411_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_708_63708411_qa_1/environment/pull_bucket.py b/tasks/0063_708_63708411_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_708_63708411_qa_1/environment/pull_bucket.py +++ b/tasks/0063_708_63708411_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_708_63708411_qa_1/task.toml b/tasks/0063_708_63708411_qa_1/task.toml index 291478969d99aa452d36d75aa6f6e5c899af1ab4..3c1065b7736fc73be264e9964425c0afcf54e8de 100644 --- a/tasks/0063_708_63708411_qa_1/task.toml +++ b/tasks/0063_708_63708411_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_711_63711638_qa_5/environment/bootstrap.sh b/tasks/0063_711_63711638_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_711_63711638_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_711_63711638_qa_5/environment/pull_bucket.py b/tasks/0063_711_63711638_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_711_63711638_qa_5/environment/pull_bucket.py +++ b/tasks/0063_711_63711638_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_711_63711638_qa_5/task.toml b/tasks/0063_711_63711638_qa_5/task.toml index 78503a53ef088913230f48737c837f2da3b1ae13..b4698410a4610900bc38090f9d1bcf20ddeb6128 100644 --- a/tasks/0063_711_63711638_qa_5/task.toml +++ b/tasks/0063_711_63711638_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_759_63759604_qa_1/environment/bootstrap.sh b/tasks/0063_759_63759604_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_759_63759604_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_759_63759604_qa_1/environment/pull_bucket.py b/tasks/0063_759_63759604_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_759_63759604_qa_1/environment/pull_bucket.py +++ b/tasks/0063_759_63759604_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_759_63759604_qa_1/task.toml b/tasks/0063_759_63759604_qa_1/task.toml index 2334af6346cd0cc3908603b35ff69482a9fbf5a5..52d1392c0f30c1ad2537643e5ff504f54b101c7f 100644 --- a/tasks/0063_759_63759604_qa_1/task.toml +++ b/tasks/0063_759_63759604_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_793_63793650_qa_5/environment/bootstrap.sh b/tasks/0063_793_63793650_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_793_63793650_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_793_63793650_qa_5/environment/pull_bucket.py b/tasks/0063_793_63793650_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_793_63793650_qa_5/environment/pull_bucket.py +++ b/tasks/0063_793_63793650_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_793_63793650_qa_5/task.toml b/tasks/0063_793_63793650_qa_5/task.toml index 609a297f0c6660d450f0622f9398a8fdee064291..0c4226e08f52856fadc6d14bb5c841acb88de63c 100644 --- a/tasks/0063_793_63793650_qa_5/task.toml +++ b/tasks/0063_793_63793650_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_836_63836300_qa_1/environment/bootstrap.sh b/tasks/0063_836_63836300_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_836_63836300_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_836_63836300_qa_1/environment/pull_bucket.py b/tasks/0063_836_63836300_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_836_63836300_qa_1/environment/pull_bucket.py +++ b/tasks/0063_836_63836300_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_836_63836300_qa_1/task.toml b/tasks/0063_836_63836300_qa_1/task.toml index c703dc8d5151b27bdf3f13d0aa8d14ff415c207a..95b78b0f6909f63c05c03d0e4a9ab2501c59f6c8 100644 --- a/tasks/0063_836_63836300_qa_1/task.toml +++ b/tasks/0063_836_63836300_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_836_63836300_qa_2/environment/bootstrap.sh b/tasks/0063_836_63836300_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_836_63836300_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_836_63836300_qa_2/environment/pull_bucket.py b/tasks/0063_836_63836300_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_836_63836300_qa_2/environment/pull_bucket.py +++ b/tasks/0063_836_63836300_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_836_63836300_qa_2/task.toml b/tasks/0063_836_63836300_qa_2/task.toml index d06f5ca9717631bd2d568e024c669a80365e14e8..1678243037684dfcce90f9b3868718aa5ec95f02 100644 --- a/tasks/0063_836_63836300_qa_2/task.toml +++ b/tasks/0063_836_63836300_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_842_63842304_qa_4/environment/bootstrap.sh b/tasks/0063_842_63842304_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_842_63842304_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_842_63842304_qa_4/environment/pull_bucket.py b/tasks/0063_842_63842304_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_842_63842304_qa_4/environment/pull_bucket.py +++ b/tasks/0063_842_63842304_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_842_63842304_qa_4/task.toml b/tasks/0063_842_63842304_qa_4/task.toml index dbaee9b7ac3744300c6b192939e0a0e2a2781500..04a3e894d26a22c5512946003d24e6289f42d598 100644 --- a/tasks/0063_842_63842304_qa_4/task.toml +++ b/tasks/0063_842_63842304_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_879_63879344_qa_3/environment/bootstrap.sh b/tasks/0063_879_63879344_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_879_63879344_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_879_63879344_qa_3/environment/pull_bucket.py b/tasks/0063_879_63879344_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_879_63879344_qa_3/environment/pull_bucket.py +++ b/tasks/0063_879_63879344_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_879_63879344_qa_3/task.toml b/tasks/0063_879_63879344_qa_3/task.toml index d61d7932a141753458aa415cb3fcbce11c55234e..aaba77dc2100de2c1238b18bd4a542a169800e1e 100644 --- a/tasks/0063_879_63879344_qa_3/task.toml +++ b/tasks/0063_879_63879344_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_909_63909128_qa_3/environment/bootstrap.sh b/tasks/0063_909_63909128_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_909_63909128_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_909_63909128_qa_3/environment/pull_bucket.py b/tasks/0063_909_63909128_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_909_63909128_qa_3/environment/pull_bucket.py +++ b/tasks/0063_909_63909128_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_909_63909128_qa_3/task.toml b/tasks/0063_909_63909128_qa_3/task.toml index cc018566d4a1414d6c7d5d9bc960a8903c7910f2..6674c67f0e7c659cf04f78351956268c1e460613 100644 --- a/tasks/0063_909_63909128_qa_3/task.toml +++ b/tasks/0063_909_63909128_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_914_63914761_qa_4/environment/bootstrap.sh b/tasks/0063_914_63914761_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_914_63914761_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_914_63914761_qa_4/environment/pull_bucket.py b/tasks/0063_914_63914761_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_914_63914761_qa_4/environment/pull_bucket.py +++ b/tasks/0063_914_63914761_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_914_63914761_qa_4/task.toml b/tasks/0063_914_63914761_qa_4/task.toml index 6d866d97b6b5134747bd119eb10e8814ced6e716..ba585f5f4e0bc6a6f86789d6b13579fe1159170d 100644 --- a/tasks/0063_914_63914761_qa_4/task.toml +++ b/tasks/0063_914_63914761_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_914_63914904_qa_3/environment/bootstrap.sh b/tasks/0063_914_63914904_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_914_63914904_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_914_63914904_qa_3/environment/pull_bucket.py b/tasks/0063_914_63914904_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_914_63914904_qa_3/environment/pull_bucket.py +++ b/tasks/0063_914_63914904_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_914_63914904_qa_3/task.toml b/tasks/0063_914_63914904_qa_3/task.toml index a8a62690f97dce42616332e5de57aca2ef5b5951..6a884bdf83d3ff9d0e6ba40ea498718cb706eb0a 100644 --- a/tasks/0063_914_63914904_qa_3/task.toml +++ b/tasks/0063_914_63914904_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_931_63931182_qa_4/environment/bootstrap.sh b/tasks/0063_931_63931182_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_931_63931182_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_931_63931182_qa_4/environment/pull_bucket.py b/tasks/0063_931_63931182_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_931_63931182_qa_4/environment/pull_bucket.py +++ b/tasks/0063_931_63931182_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_931_63931182_qa_4/task.toml b/tasks/0063_931_63931182_qa_4/task.toml index 8ed3b958845ce5643f3e3f867147addbab1aefad..1cc38729b4c15d0be1f4c4df70b9381e28a4c875 100644 --- a/tasks/0063_931_63931182_qa_4/task.toml +++ b/tasks/0063_931_63931182_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_942_63942638_qa_2/environment/bootstrap.sh b/tasks/0063_942_63942638_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_942_63942638_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_942_63942638_qa_2/environment/pull_bucket.py b/tasks/0063_942_63942638_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_942_63942638_qa_2/environment/pull_bucket.py +++ b/tasks/0063_942_63942638_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_942_63942638_qa_2/task.toml b/tasks/0063_942_63942638_qa_2/task.toml index 8eb6ebcea4ee436df6ea9a345368588059b6cb5f..c8b61d3102c4cf3d9ccee26b9978c70a76015a9b 100644 --- a/tasks/0063_942_63942638_qa_2/task.toml +++ b/tasks/0063_942_63942638_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0063_943_63943567_qa_2/environment/bootstrap.sh b/tasks/0063_943_63943567_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0063_943_63943567_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0063_943_63943567_qa_2/environment/pull_bucket.py b/tasks/0063_943_63943567_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0063_943_63943567_qa_2/environment/pull_bucket.py +++ b/tasks/0063_943_63943567_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0063_943_63943567_qa_2/task.toml b/tasks/0063_943_63943567_qa_2/task.toml index 1e3be374bb4dda3819a6dfeea2a491ef1c2187f8..fd5803c73a7058770c02dbd8a906448a425abdbb 100644 --- a/tasks/0063_943_63943567_qa_2/task.toml +++ b/tasks/0063_943_63943567_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_084_64084849_qa_4/environment/bootstrap.sh b/tasks/0064_084_64084849_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_084_64084849_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_084_64084849_qa_4/environment/pull_bucket.py b/tasks/0064_084_64084849_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_084_64084849_qa_4/environment/pull_bucket.py +++ b/tasks/0064_084_64084849_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_084_64084849_qa_4/task.toml b/tasks/0064_084_64084849_qa_4/task.toml index 91db595aa94e1bf35108eb03c6a2ae0431e536f6..7980d9f2b7d1f83c1063de986caa572a30c6cf04 100644 --- a/tasks/0064_084_64084849_qa_4/task.toml +++ b/tasks/0064_084_64084849_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_089_64089732_qa_2/environment/bootstrap.sh b/tasks/0064_089_64089732_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_089_64089732_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_089_64089732_qa_2/environment/pull_bucket.py b/tasks/0064_089_64089732_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_089_64089732_qa_2/environment/pull_bucket.py +++ b/tasks/0064_089_64089732_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_089_64089732_qa_2/task.toml b/tasks/0064_089_64089732_qa_2/task.toml index cfde278ce1ca7f0d30ddabd8e78ccc257b5413f9..4d6fe8df11004d2d7a09a3062e165828ad3c887b 100644 --- a/tasks/0064_089_64089732_qa_2/task.toml +++ b/tasks/0064_089_64089732_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_090_64090883_qa_3/environment/bootstrap.sh b/tasks/0064_090_64090883_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_090_64090883_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_090_64090883_qa_3/environment/pull_bucket.py b/tasks/0064_090_64090883_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_090_64090883_qa_3/environment/pull_bucket.py +++ b/tasks/0064_090_64090883_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_090_64090883_qa_3/task.toml b/tasks/0064_090_64090883_qa_3/task.toml index 576842d7511335297a24b7a973cc1db73be40364..3ded57bf0594e394e750c21f9794cc6eb38ab7eb 100644 --- a/tasks/0064_090_64090883_qa_3/task.toml +++ b/tasks/0064_090_64090883_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_090_64090883_qa_5/environment/bootstrap.sh b/tasks/0064_090_64090883_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_090_64090883_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_090_64090883_qa_5/environment/pull_bucket.py b/tasks/0064_090_64090883_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_090_64090883_qa_5/environment/pull_bucket.py +++ b/tasks/0064_090_64090883_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_090_64090883_qa_5/task.toml b/tasks/0064_090_64090883_qa_5/task.toml index 484800411f4d6b32383b3b09e9d84f1701933662..b44e1a0f67e38be28746d26084c27b77299b179c 100644 --- a/tasks/0064_090_64090883_qa_5/task.toml +++ b/tasks/0064_090_64090883_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_173_64173346_qa_2/environment/bootstrap.sh b/tasks/0064_173_64173346_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_173_64173346_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_173_64173346_qa_2/environment/pull_bucket.py b/tasks/0064_173_64173346_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_173_64173346_qa_2/environment/pull_bucket.py +++ b/tasks/0064_173_64173346_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_173_64173346_qa_2/task.toml b/tasks/0064_173_64173346_qa_2/task.toml index 28aea82fc90aa34d7a6bca515e5620049858c576..3557e97646b9c3c24dc5925d9af7b5f46ebd9a01 100644 --- a/tasks/0064_173_64173346_qa_2/task.toml +++ b/tasks/0064_173_64173346_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_224_64224650_qa_5/environment/bootstrap.sh b/tasks/0064_224_64224650_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_224_64224650_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_224_64224650_qa_5/environment/pull_bucket.py b/tasks/0064_224_64224650_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_224_64224650_qa_5/environment/pull_bucket.py +++ b/tasks/0064_224_64224650_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_224_64224650_qa_5/task.toml b/tasks/0064_224_64224650_qa_5/task.toml index bbddd20e23beb560ada27572e68fccdc17065f38..f366832611868bd77d1a4b76e4bae13535ed4762 100644 --- a/tasks/0064_224_64224650_qa_5/task.toml +++ b/tasks/0064_224_64224650_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_232_64232136_qa_1/environment/bootstrap.sh b/tasks/0064_232_64232136_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_232_64232136_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_232_64232136_qa_1/environment/pull_bucket.py b/tasks/0064_232_64232136_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_232_64232136_qa_1/environment/pull_bucket.py +++ b/tasks/0064_232_64232136_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_232_64232136_qa_1/task.toml b/tasks/0064_232_64232136_qa_1/task.toml index 4c89df22699487c5e9b1481f671d932ef5d77e44..3a74360f288ff8602884e56eeb425a099292fa26 100644 --- a/tasks/0064_232_64232136_qa_1/task.toml +++ b/tasks/0064_232_64232136_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_267_64267004_qa_3/environment/bootstrap.sh b/tasks/0064_267_64267004_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_267_64267004_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_267_64267004_qa_3/environment/pull_bucket.py b/tasks/0064_267_64267004_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_267_64267004_qa_3/environment/pull_bucket.py +++ b/tasks/0064_267_64267004_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_267_64267004_qa_3/task.toml b/tasks/0064_267_64267004_qa_3/task.toml index 66cbdb852352a9d334d0292d9ea06922f03451a2..91fec3648be46aa93b6d753864669b0fdd2ce335 100644 --- a/tasks/0064_267_64267004_qa_3/task.toml +++ b/tasks/0064_267_64267004_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_267_64267004_qa_5/environment/bootstrap.sh b/tasks/0064_267_64267004_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_267_64267004_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_267_64267004_qa_5/environment/pull_bucket.py b/tasks/0064_267_64267004_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_267_64267004_qa_5/environment/pull_bucket.py +++ b/tasks/0064_267_64267004_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_267_64267004_qa_5/task.toml b/tasks/0064_267_64267004_qa_5/task.toml index d1be5c9c420134c2d0212adba4390d26cde037ae..88b7a73565473844a6f8750721b12a13a7178ef8 100644 --- a/tasks/0064_267_64267004_qa_5/task.toml +++ b/tasks/0064_267_64267004_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_330_64330026_qa_1/environment/bootstrap.sh b/tasks/0064_330_64330026_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_330_64330026_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_330_64330026_qa_1/environment/pull_bucket.py b/tasks/0064_330_64330026_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_330_64330026_qa_1/environment/pull_bucket.py +++ b/tasks/0064_330_64330026_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_330_64330026_qa_1/task.toml b/tasks/0064_330_64330026_qa_1/task.toml index 042eeb2dbb0811ed34bd40e5f4cdac6d810ff04e..e77d32de2fb4a7f71f686b149696746a0a8d5b84 100644 --- a/tasks/0064_330_64330026_qa_1/task.toml +++ b/tasks/0064_330_64330026_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_330_64330026_qa_5/environment/bootstrap.sh b/tasks/0064_330_64330026_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_330_64330026_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_330_64330026_qa_5/environment/pull_bucket.py b/tasks/0064_330_64330026_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_330_64330026_qa_5/environment/pull_bucket.py +++ b/tasks/0064_330_64330026_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_330_64330026_qa_5/task.toml b/tasks/0064_330_64330026_qa_5/task.toml index d660c246f3cd78ef66d960d7bea46c8e54879b59..1793967810c129322eb56c123c8e0036ac0f51e7 100644 --- a/tasks/0064_330_64330026_qa_5/task.toml +++ b/tasks/0064_330_64330026_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_383_64383055_qa_5/environment/bootstrap.sh b/tasks/0064_383_64383055_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_383_64383055_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_383_64383055_qa_5/environment/pull_bucket.py b/tasks/0064_383_64383055_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_383_64383055_qa_5/environment/pull_bucket.py +++ b/tasks/0064_383_64383055_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_383_64383055_qa_5/task.toml b/tasks/0064_383_64383055_qa_5/task.toml index 338de1a9c2ffdc751732f61b35c47bfe7542c042..0793f93faff4b5c2ea7f60054adb0a7390641e8d 100644 --- a/tasks/0064_383_64383055_qa_5/task.toml +++ b/tasks/0064_383_64383055_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_397_64397098_qa_3/environment/bootstrap.sh b/tasks/0064_397_64397098_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_397_64397098_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_397_64397098_qa_3/environment/pull_bucket.py b/tasks/0064_397_64397098_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_397_64397098_qa_3/environment/pull_bucket.py +++ b/tasks/0064_397_64397098_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_397_64397098_qa_3/task.toml b/tasks/0064_397_64397098_qa_3/task.toml index 5c7e2649b6c4e332a6534cfe4f403ffcc3b8af91..97a6a2093667ffbb9a88d975a0bcc8d3a028c052 100644 --- a/tasks/0064_397_64397098_qa_3/task.toml +++ b/tasks/0064_397_64397098_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_402_64402852_qa_1/environment/bootstrap.sh b/tasks/0064_402_64402852_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_402_64402852_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_402_64402852_qa_1/environment/pull_bucket.py b/tasks/0064_402_64402852_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_402_64402852_qa_1/environment/pull_bucket.py +++ b/tasks/0064_402_64402852_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_402_64402852_qa_1/task.toml b/tasks/0064_402_64402852_qa_1/task.toml index 343caad86026606a13cd1a8e4f7e549d9846c2ab..30fc50c0412777a404a48b7f3245bebb5e3f91f4 100644 --- a/tasks/0064_402_64402852_qa_1/task.toml +++ b/tasks/0064_402_64402852_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_448_64448402_qa_1/environment/bootstrap.sh b/tasks/0064_448_64448402_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_448_64448402_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_448_64448402_qa_1/environment/pull_bucket.py b/tasks/0064_448_64448402_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_448_64448402_qa_1/environment/pull_bucket.py +++ b/tasks/0064_448_64448402_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_448_64448402_qa_1/task.toml b/tasks/0064_448_64448402_qa_1/task.toml index 77c939621f76c1f451c008ed153fd162eb7ff9a5..e9cc3f12b245454e9b34e0898d35146f9428f2f1 100644 --- a/tasks/0064_448_64448402_qa_1/task.toml +++ b/tasks/0064_448_64448402_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_469_64469829_qa_4/environment/bootstrap.sh b/tasks/0064_469_64469829_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_469_64469829_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_469_64469829_qa_4/environment/pull_bucket.py b/tasks/0064_469_64469829_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_469_64469829_qa_4/environment/pull_bucket.py +++ b/tasks/0064_469_64469829_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_469_64469829_qa_4/task.toml b/tasks/0064_469_64469829_qa_4/task.toml index 190756bc59f2392db5e14bfd9abb55fbf0a20dbf..5e74c6826aa89b14ba80cb3e673db2140f3a3143 100644 --- a/tasks/0064_469_64469829_qa_4/task.toml +++ b/tasks/0064_469_64469829_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_494_64494124_qa_2/environment/bootstrap.sh b/tasks/0064_494_64494124_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_494_64494124_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_494_64494124_qa_2/environment/pull_bucket.py b/tasks/0064_494_64494124_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_494_64494124_qa_2/environment/pull_bucket.py +++ b/tasks/0064_494_64494124_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_494_64494124_qa_2/task.toml b/tasks/0064_494_64494124_qa_2/task.toml index bd2f336e279c0e67d971c82bfdc7239499bad19d..9709f32e9290ee4ffd23ef0b6507421656a812df 100644 --- a/tasks/0064_494_64494124_qa_2/task.toml +++ b/tasks/0064_494_64494124_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_496_64496303_qa_3/environment/bootstrap.sh b/tasks/0064_496_64496303_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_496_64496303_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_496_64496303_qa_3/environment/pull_bucket.py b/tasks/0064_496_64496303_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_496_64496303_qa_3/environment/pull_bucket.py +++ b/tasks/0064_496_64496303_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_496_64496303_qa_3/task.toml b/tasks/0064_496_64496303_qa_3/task.toml index bdaecb5724bf8e928c6dc502c84bce325218c0c6..88168a48399419d4a4e3959ea98b453447ac0598 100644 --- a/tasks/0064_496_64496303_qa_3/task.toml +++ b/tasks/0064_496_64496303_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_551_64551026_qa_3/environment/bootstrap.sh b/tasks/0064_551_64551026_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_551_64551026_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_551_64551026_qa_3/environment/pull_bucket.py b/tasks/0064_551_64551026_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_551_64551026_qa_3/environment/pull_bucket.py +++ b/tasks/0064_551_64551026_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_551_64551026_qa_3/task.toml b/tasks/0064_551_64551026_qa_3/task.toml index 018c2a2140bfe65827da1f653cca0611a1b762f5..476eeed470fb7d4268dbcc404c3a905015799b5e 100644 --- a/tasks/0064_551_64551026_qa_3/task.toml +++ b/tasks/0064_551_64551026_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_551_64551026_qa_4/environment/bootstrap.sh b/tasks/0064_551_64551026_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_551_64551026_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_551_64551026_qa_4/environment/pull_bucket.py b/tasks/0064_551_64551026_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_551_64551026_qa_4/environment/pull_bucket.py +++ b/tasks/0064_551_64551026_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_551_64551026_qa_4/task.toml b/tasks/0064_551_64551026_qa_4/task.toml index d4dc338329215c1729540e50844c376934be5fcb..1308393d0632ee1d6493394aabbb6a5eff17fa8f 100644 --- a/tasks/0064_551_64551026_qa_4/task.toml +++ b/tasks/0064_551_64551026_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_580_64580067_qa_2/environment/bootstrap.sh b/tasks/0064_580_64580067_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_580_64580067_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_580_64580067_qa_2/environment/pull_bucket.py b/tasks/0064_580_64580067_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_580_64580067_qa_2/environment/pull_bucket.py +++ b/tasks/0064_580_64580067_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_580_64580067_qa_2/task.toml b/tasks/0064_580_64580067_qa_2/task.toml index cd59e0714c62294c814a319e52aa39d246fa391a..d6b6f9142c693bc4ce83388e87448880f6bc795b 100644 --- a/tasks/0064_580_64580067_qa_2/task.toml +++ b/tasks/0064_580_64580067_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_661_64661976_qa_2/environment/bootstrap.sh b/tasks/0064_661_64661976_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_661_64661976_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_661_64661976_qa_2/environment/pull_bucket.py b/tasks/0064_661_64661976_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_661_64661976_qa_2/environment/pull_bucket.py +++ b/tasks/0064_661_64661976_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_661_64661976_qa_2/task.toml b/tasks/0064_661_64661976_qa_2/task.toml index 019acc8bead50de5382e59f282c3fe704d819961..0ed90f15dc020c754fc06e21697adeca469d9948 100644 --- a/tasks/0064_661_64661976_qa_2/task.toml +++ b/tasks/0064_661_64661976_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_661_64661976_qa_3/environment/bootstrap.sh b/tasks/0064_661_64661976_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_661_64661976_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_661_64661976_qa_3/environment/pull_bucket.py b/tasks/0064_661_64661976_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_661_64661976_qa_3/environment/pull_bucket.py +++ b/tasks/0064_661_64661976_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_661_64661976_qa_3/task.toml b/tasks/0064_661_64661976_qa_3/task.toml index d0994e2d0f265b70d44747e16790faca368ffe3d..9b2658d9c8ebd50841a32d61fd16b5182b7c2e5d 100644 --- a/tasks/0064_661_64661976_qa_3/task.toml +++ b/tasks/0064_661_64661976_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_664_64664569_qa_4/environment/bootstrap.sh b/tasks/0064_664_64664569_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_664_64664569_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_664_64664569_qa_4/environment/pull_bucket.py b/tasks/0064_664_64664569_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_664_64664569_qa_4/environment/pull_bucket.py +++ b/tasks/0064_664_64664569_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_664_64664569_qa_4/task.toml b/tasks/0064_664_64664569_qa_4/task.toml index aa476e0c775fe477c317679fd197031d9d41fdf2..c6784d2d058659ab26db5d71976f49c24d4174ac 100644 --- a/tasks/0064_664_64664569_qa_4/task.toml +++ b/tasks/0064_664_64664569_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_682_64682826_qa_2/environment/bootstrap.sh b/tasks/0064_682_64682826_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_682_64682826_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_682_64682826_qa_2/environment/pull_bucket.py b/tasks/0064_682_64682826_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_682_64682826_qa_2/environment/pull_bucket.py +++ b/tasks/0064_682_64682826_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_682_64682826_qa_2/task.toml b/tasks/0064_682_64682826_qa_2/task.toml index 8c340fe3bc8c9bb3b6b3595f5713bd25411842d2..8e7e3abc9b7423083a53ceef8be4c33b3efe1f37 100644 --- a/tasks/0064_682_64682826_qa_2/task.toml +++ b/tasks/0064_682_64682826_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_691_64691450_qa_2/environment/bootstrap.sh b/tasks/0064_691_64691450_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_691_64691450_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_691_64691450_qa_2/environment/pull_bucket.py b/tasks/0064_691_64691450_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_691_64691450_qa_2/environment/pull_bucket.py +++ b/tasks/0064_691_64691450_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_691_64691450_qa_2/task.toml b/tasks/0064_691_64691450_qa_2/task.toml index cbc685bf81ee1f3093fb0884db3c5486377091d8..3121b91deeface47ace618666c8566f80aceff80 100644 --- a/tasks/0064_691_64691450_qa_2/task.toml +++ b/tasks/0064_691_64691450_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_698_64698192_qa_1/environment/bootstrap.sh b/tasks/0064_698_64698192_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_698_64698192_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_698_64698192_qa_1/environment/pull_bucket.py b/tasks/0064_698_64698192_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_698_64698192_qa_1/environment/pull_bucket.py +++ b/tasks/0064_698_64698192_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_698_64698192_qa_1/task.toml b/tasks/0064_698_64698192_qa_1/task.toml index d14d8076e21328f5d4a1b9fcecc3b6a852845b14..9accdf187095e09d1a29c2eac2be0cb0e2b00641 100644 --- a/tasks/0064_698_64698192_qa_1/task.toml +++ b/tasks/0064_698_64698192_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_698_64698192_qa_4/environment/bootstrap.sh b/tasks/0064_698_64698192_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_698_64698192_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_698_64698192_qa_4/environment/pull_bucket.py b/tasks/0064_698_64698192_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_698_64698192_qa_4/environment/pull_bucket.py +++ b/tasks/0064_698_64698192_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_698_64698192_qa_4/task.toml b/tasks/0064_698_64698192_qa_4/task.toml index a4c962193babac9ccde906f8a061638c76df2f18..aaf29d46aed95e512dcdb5cef019e19cb91745fe 100644 --- a/tasks/0064_698_64698192_qa_4/task.toml +++ b/tasks/0064_698_64698192_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_698_64698192_qa_5/environment/bootstrap.sh b/tasks/0064_698_64698192_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_698_64698192_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_698_64698192_qa_5/environment/pull_bucket.py b/tasks/0064_698_64698192_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_698_64698192_qa_5/environment/pull_bucket.py +++ b/tasks/0064_698_64698192_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_698_64698192_qa_5/task.toml b/tasks/0064_698_64698192_qa_5/task.toml index 60fd44e3b30459b8d66469000ed0db28aeec1848..3db714b707bc6a81902662b09f9e363ce6c41139 100644 --- a/tasks/0064_698_64698192_qa_5/task.toml +++ b/tasks/0064_698_64698192_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_727_64727238_qa_4/environment/bootstrap.sh b/tasks/0064_727_64727238_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_727_64727238_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_727_64727238_qa_4/environment/pull_bucket.py b/tasks/0064_727_64727238_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_727_64727238_qa_4/environment/pull_bucket.py +++ b/tasks/0064_727_64727238_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_727_64727238_qa_4/task.toml b/tasks/0064_727_64727238_qa_4/task.toml index 0261370be3fd737ad4cca4cd238b8b812a8ab1df..e781b4b28e0509249e35ccb0d23325f826fa9154 100644 --- a/tasks/0064_727_64727238_qa_4/task.toml +++ b/tasks/0064_727_64727238_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_762_64762975_qa_2/environment/bootstrap.sh b/tasks/0064_762_64762975_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_762_64762975_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_762_64762975_qa_2/environment/pull_bucket.py b/tasks/0064_762_64762975_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_762_64762975_qa_2/environment/pull_bucket.py +++ b/tasks/0064_762_64762975_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_762_64762975_qa_2/task.toml b/tasks/0064_762_64762975_qa_2/task.toml index eb9398ff1168e5902495ce0e885c39fe2a31b05b..f2a7ea4ef1bcae8a21df526c0cfc741c91dab073 100644 --- a/tasks/0064_762_64762975_qa_2/task.toml +++ b/tasks/0064_762_64762975_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_766_64766227_qa_2/environment/bootstrap.sh b/tasks/0064_766_64766227_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_766_64766227_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_766_64766227_qa_2/environment/pull_bucket.py b/tasks/0064_766_64766227_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_766_64766227_qa_2/environment/pull_bucket.py +++ b/tasks/0064_766_64766227_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_766_64766227_qa_2/task.toml b/tasks/0064_766_64766227_qa_2/task.toml index d42b54059d1dc916a1edb066821710a8e2e2efe5..fa64fa467fd566e84636b29da65004d1944675aa 100644 --- a/tasks/0064_766_64766227_qa_2/task.toml +++ b/tasks/0064_766_64766227_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_766_64766227_qa_3/environment/bootstrap.sh b/tasks/0064_766_64766227_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_766_64766227_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_766_64766227_qa_3/environment/pull_bucket.py b/tasks/0064_766_64766227_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_766_64766227_qa_3/environment/pull_bucket.py +++ b/tasks/0064_766_64766227_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_766_64766227_qa_3/task.toml b/tasks/0064_766_64766227_qa_3/task.toml index a1a83691d023bf1137d58eeebe0761cc2d899eb7..f104175758e32f615d1869a07da9ce83486c2a9d 100644 --- a/tasks/0064_766_64766227_qa_3/task.toml +++ b/tasks/0064_766_64766227_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_778_64778762_qa_5/environment/bootstrap.sh b/tasks/0064_778_64778762_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_778_64778762_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_778_64778762_qa_5/environment/pull_bucket.py b/tasks/0064_778_64778762_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_778_64778762_qa_5/environment/pull_bucket.py +++ b/tasks/0064_778_64778762_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_778_64778762_qa_5/task.toml b/tasks/0064_778_64778762_qa_5/task.toml index d7ff1c332c89142ca20f987c805d1d3cb23ae215..84d3ae0ee5b2047137038b27f29472fbc9bccf65 100644 --- a/tasks/0064_778_64778762_qa_5/task.toml +++ b/tasks/0064_778_64778762_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_783_64783285_qa_2/environment/bootstrap.sh b/tasks/0064_783_64783285_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_783_64783285_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_783_64783285_qa_2/environment/pull_bucket.py b/tasks/0064_783_64783285_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_783_64783285_qa_2/environment/pull_bucket.py +++ b/tasks/0064_783_64783285_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_783_64783285_qa_2/task.toml b/tasks/0064_783_64783285_qa_2/task.toml index 7a68d52d26f40273b0e1972c5e007a1d69b87a1f..21b936e2cd0c8eab070e79d2b9e649d8dcaa14ac 100644 --- a/tasks/0064_783_64783285_qa_2/task.toml +++ b/tasks/0064_783_64783285_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_808_64808166_qa_5/environment/bootstrap.sh b/tasks/0064_808_64808166_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_808_64808166_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_808_64808166_qa_5/environment/pull_bucket.py b/tasks/0064_808_64808166_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_808_64808166_qa_5/environment/pull_bucket.py +++ b/tasks/0064_808_64808166_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_808_64808166_qa_5/task.toml b/tasks/0064_808_64808166_qa_5/task.toml index 644dd97dff49ed9eeed70815f2f45e39508f007d..003e5e81d0132d4e9e8d0825fe5c1d5104a54e27 100644 --- a/tasks/0064_808_64808166_qa_5/task.toml +++ b/tasks/0064_808_64808166_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_828_64828278_qa_5/environment/bootstrap.sh b/tasks/0064_828_64828278_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_828_64828278_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_828_64828278_qa_5/environment/pull_bucket.py b/tasks/0064_828_64828278_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_828_64828278_qa_5/environment/pull_bucket.py +++ b/tasks/0064_828_64828278_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_828_64828278_qa_5/task.toml b/tasks/0064_828_64828278_qa_5/task.toml index b47d8e76689a02d1f64ac799591ed37b3727e281..232bf656850c52ab9a597509d9c270a963b778a2 100644 --- a/tasks/0064_828_64828278_qa_5/task.toml +++ b/tasks/0064_828_64828278_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_851_64851380_qa_2/environment/bootstrap.sh b/tasks/0064_851_64851380_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_851_64851380_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_851_64851380_qa_2/environment/pull_bucket.py b/tasks/0064_851_64851380_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_851_64851380_qa_2/environment/pull_bucket.py +++ b/tasks/0064_851_64851380_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_851_64851380_qa_2/task.toml b/tasks/0064_851_64851380_qa_2/task.toml index c73b04f6b7bdcadc8532c9b138325335b68461b2..19459adeaad81a2b7fa43183bc407d607c8cf9bc 100644 --- a/tasks/0064_851_64851380_qa_2/task.toml +++ b/tasks/0064_851_64851380_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_907_64907248_qa_1/environment/bootstrap.sh b/tasks/0064_907_64907248_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_907_64907248_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_907_64907248_qa_1/environment/pull_bucket.py b/tasks/0064_907_64907248_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_907_64907248_qa_1/environment/pull_bucket.py +++ b/tasks/0064_907_64907248_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_907_64907248_qa_1/task.toml b/tasks/0064_907_64907248_qa_1/task.toml index 8aa69a3ac90bfe31cb673ffddbabe26836d6544c..02ec1231ad72676de69e5737ba67d74b07f8e017 100644 --- a/tasks/0064_907_64907248_qa_1/task.toml +++ b/tasks/0064_907_64907248_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_907_64907248_qa_2/environment/bootstrap.sh b/tasks/0064_907_64907248_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_907_64907248_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_907_64907248_qa_2/environment/pull_bucket.py b/tasks/0064_907_64907248_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_907_64907248_qa_2/environment/pull_bucket.py +++ b/tasks/0064_907_64907248_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_907_64907248_qa_2/task.toml b/tasks/0064_907_64907248_qa_2/task.toml index c0d7e947583b760d5267e98532eecd60d919292f..b1ebd53f8d4fee377ee9e2e1e67df6b4461bb0b4 100644 --- a/tasks/0064_907_64907248_qa_2/task.toml +++ b/tasks/0064_907_64907248_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_907_64907248_qa_3/environment/bootstrap.sh b/tasks/0064_907_64907248_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_907_64907248_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_907_64907248_qa_3/environment/pull_bucket.py b/tasks/0064_907_64907248_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_907_64907248_qa_3/environment/pull_bucket.py +++ b/tasks/0064_907_64907248_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_907_64907248_qa_3/task.toml b/tasks/0064_907_64907248_qa_3/task.toml index 473c178d39ac665334eb0c636eaa26b6be7e3197..95e3fec5fbf9cfb97e7767c343a96c9014b60e2e 100644 --- a/tasks/0064_907_64907248_qa_3/task.toml +++ b/tasks/0064_907_64907248_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_908_64908177_qa_2/environment/bootstrap.sh b/tasks/0064_908_64908177_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_908_64908177_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_908_64908177_qa_2/environment/pull_bucket.py b/tasks/0064_908_64908177_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_908_64908177_qa_2/environment/pull_bucket.py +++ b/tasks/0064_908_64908177_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_908_64908177_qa_2/task.toml b/tasks/0064_908_64908177_qa_2/task.toml index 9b6c8149faf5d47b2ad6ea700213910a49cc1c09..a167b696fa3711c205725220f3653178cadee774 100644 --- a/tasks/0064_908_64908177_qa_2/task.toml +++ b/tasks/0064_908_64908177_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0064_983_64983007_qa_2/environment/bootstrap.sh b/tasks/0064_983_64983007_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0064_983_64983007_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0064_983_64983007_qa_2/environment/pull_bucket.py b/tasks/0064_983_64983007_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0064_983_64983007_qa_2/environment/pull_bucket.py +++ b/tasks/0064_983_64983007_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0064_983_64983007_qa_2/task.toml b/tasks/0064_983_64983007_qa_2/task.toml index d3672531342d1c054696eea6687ad23c59e1cb91..790c050c1ac3d6aaf32a8e738564b3907cc645db 100644 --- a/tasks/0064_983_64983007_qa_2/task.toml +++ b/tasks/0064_983_64983007_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_008_65008815_qa_4/environment/bootstrap.sh b/tasks/0065_008_65008815_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_008_65008815_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_008_65008815_qa_4/environment/pull_bucket.py b/tasks/0065_008_65008815_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_008_65008815_qa_4/environment/pull_bucket.py +++ b/tasks/0065_008_65008815_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_008_65008815_qa_4/task.toml b/tasks/0065_008_65008815_qa_4/task.toml index d3571cf86d3baeae0ee4460d732b548bad608c30..c4d65187235cbe4ff2edb74b4c5fc5298f79aec7 100644 --- a/tasks/0065_008_65008815_qa_4/task.toml +++ b/tasks/0065_008_65008815_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_018_65018782_qa_3/environment/bootstrap.sh b/tasks/0065_018_65018782_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_018_65018782_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_018_65018782_qa_3/environment/pull_bucket.py b/tasks/0065_018_65018782_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_018_65018782_qa_3/environment/pull_bucket.py +++ b/tasks/0065_018_65018782_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_018_65018782_qa_3/task.toml b/tasks/0065_018_65018782_qa_3/task.toml index 92e34ec7a018c34290ded31b3de448da420b67e8..80781c8d57018d915edcf457f611d4ad0b235f11 100644 --- a/tasks/0065_018_65018782_qa_3/task.toml +++ b/tasks/0065_018_65018782_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_069_65069276_qa_1/environment/bootstrap.sh b/tasks/0065_069_65069276_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_069_65069276_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_069_65069276_qa_1/environment/pull_bucket.py b/tasks/0065_069_65069276_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_069_65069276_qa_1/environment/pull_bucket.py +++ b/tasks/0065_069_65069276_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_069_65069276_qa_1/task.toml b/tasks/0065_069_65069276_qa_1/task.toml index a812dc7770d16897afd754bac4e6b1c1d6a2165b..e653959ffb390dd0566812e8fce7058448a00801 100644 --- a/tasks/0065_069_65069276_qa_1/task.toml +++ b/tasks/0065_069_65069276_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_069_65069276_qa_4/environment/bootstrap.sh b/tasks/0065_069_65069276_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_069_65069276_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_069_65069276_qa_4/environment/pull_bucket.py b/tasks/0065_069_65069276_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_069_65069276_qa_4/environment/pull_bucket.py +++ b/tasks/0065_069_65069276_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_069_65069276_qa_4/task.toml b/tasks/0065_069_65069276_qa_4/task.toml index 2097a81b5325b02bccb7d9f6dc6aa70a92c94972..6df334de1b17fd613566d8ce0d611360ac2c5488 100644 --- a/tasks/0065_069_65069276_qa_4/task.toml +++ b/tasks/0065_069_65069276_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_069_65069276_qa_5/environment/bootstrap.sh b/tasks/0065_069_65069276_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_069_65069276_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_069_65069276_qa_5/environment/pull_bucket.py b/tasks/0065_069_65069276_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_069_65069276_qa_5/environment/pull_bucket.py +++ b/tasks/0065_069_65069276_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_069_65069276_qa_5/task.toml b/tasks/0065_069_65069276_qa_5/task.toml index 73671633ccf9134f3ef1ce8295ce2d6fd6e0dd3f..a346a21e9f37eca5f7eedee056106206c4938a15 100644 --- a/tasks/0065_069_65069276_qa_5/task.toml +++ b/tasks/0065_069_65069276_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_074_65074869_qa_2/environment/bootstrap.sh b/tasks/0065_074_65074869_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_074_65074869_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_074_65074869_qa_2/environment/pull_bucket.py b/tasks/0065_074_65074869_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_074_65074869_qa_2/environment/pull_bucket.py +++ b/tasks/0065_074_65074869_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_074_65074869_qa_2/task.toml b/tasks/0065_074_65074869_qa_2/task.toml index 5009a114d0c21fa95c469380987638cd8f17e0e8..dc43f7dfbbc2a7eed1847c8b0140c0951af81f5b 100644 --- a/tasks/0065_074_65074869_qa_2/task.toml +++ b/tasks/0065_074_65074869_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_074_65074869_qa_4/environment/bootstrap.sh b/tasks/0065_074_65074869_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_074_65074869_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_074_65074869_qa_4/environment/pull_bucket.py b/tasks/0065_074_65074869_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_074_65074869_qa_4/environment/pull_bucket.py +++ b/tasks/0065_074_65074869_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_074_65074869_qa_4/task.toml b/tasks/0065_074_65074869_qa_4/task.toml index 1cab9b4cea365ed87baef9db0bffa7e745fbdcac..5d9e6fa4b12adfdaf9697660764adcf5ef6458d8 100644 --- a/tasks/0065_074_65074869_qa_4/task.toml +++ b/tasks/0065_074_65074869_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_109_65109957_qa_3/environment/bootstrap.sh b/tasks/0065_109_65109957_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_109_65109957_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_109_65109957_qa_3/environment/pull_bucket.py b/tasks/0065_109_65109957_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_109_65109957_qa_3/environment/pull_bucket.py +++ b/tasks/0065_109_65109957_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_109_65109957_qa_3/task.toml b/tasks/0065_109_65109957_qa_3/task.toml index 039265414d94307075766c76c1720f2345524a8f..8b0e653c7c42b2706d853bb95b05f5da7d79a9b1 100644 --- a/tasks/0065_109_65109957_qa_3/task.toml +++ b/tasks/0065_109_65109957_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_150_65150655_qa_3/environment/bootstrap.sh b/tasks/0065_150_65150655_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_150_65150655_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_150_65150655_qa_3/environment/pull_bucket.py b/tasks/0065_150_65150655_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_150_65150655_qa_3/environment/pull_bucket.py +++ b/tasks/0065_150_65150655_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_150_65150655_qa_3/task.toml b/tasks/0065_150_65150655_qa_3/task.toml index 5a29bfac084d1681f1f39f438c85c8f774d4a9e9..7d81e558fc82b1a3c105fdc37ad70feec73bcb01 100644 --- a/tasks/0065_150_65150655_qa_3/task.toml +++ b/tasks/0065_150_65150655_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_162_65162734_qa_1/environment/bootstrap.sh b/tasks/0065_162_65162734_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_162_65162734_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_162_65162734_qa_1/environment/pull_bucket.py b/tasks/0065_162_65162734_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_162_65162734_qa_1/environment/pull_bucket.py +++ b/tasks/0065_162_65162734_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_162_65162734_qa_1/task.toml b/tasks/0065_162_65162734_qa_1/task.toml index 7ea46489266668e6983cc189500ec4f00d0c7452..ad6449e65022318dbf58385f27822ac03aa87fd1 100644 --- a/tasks/0065_162_65162734_qa_1/task.toml +++ b/tasks/0065_162_65162734_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_162_65162734_qa_3/environment/bootstrap.sh b/tasks/0065_162_65162734_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_162_65162734_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_162_65162734_qa_3/environment/pull_bucket.py b/tasks/0065_162_65162734_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_162_65162734_qa_3/environment/pull_bucket.py +++ b/tasks/0065_162_65162734_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_162_65162734_qa_3/task.toml b/tasks/0065_162_65162734_qa_3/task.toml index 473a3d1b62b5c9ebcecf24fdac504cf86e232b45..d216019b75ab358cc21c560e0f885452f7f50b7c 100644 --- a/tasks/0065_162_65162734_qa_3/task.toml +++ b/tasks/0065_162_65162734_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_162_65162734_qa_5/environment/bootstrap.sh b/tasks/0065_162_65162734_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_162_65162734_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_162_65162734_qa_5/environment/pull_bucket.py b/tasks/0065_162_65162734_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_162_65162734_qa_5/environment/pull_bucket.py +++ b/tasks/0065_162_65162734_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_162_65162734_qa_5/task.toml b/tasks/0065_162_65162734_qa_5/task.toml index 6ed47fa01fea45554c0334b5a9cac58fc4826648..a5b35cb46e6cc8fc852a24529677916da54877b8 100644 --- a/tasks/0065_162_65162734_qa_5/task.toml +++ b/tasks/0065_162_65162734_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_166_65166426_qa_3/environment/bootstrap.sh b/tasks/0065_166_65166426_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_166_65166426_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_166_65166426_qa_3/environment/pull_bucket.py b/tasks/0065_166_65166426_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_166_65166426_qa_3/environment/pull_bucket.py +++ b/tasks/0065_166_65166426_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_166_65166426_qa_3/task.toml b/tasks/0065_166_65166426_qa_3/task.toml index 8bc087aee9fab573e0debefaa928b0769a72326b..cced52b78bb1f6c17c689072a865581605c82c3a 100644 --- a/tasks/0065_166_65166426_qa_3/task.toml +++ b/tasks/0065_166_65166426_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_166_65166426_qa_4/environment/bootstrap.sh b/tasks/0065_166_65166426_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_166_65166426_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_166_65166426_qa_4/environment/pull_bucket.py b/tasks/0065_166_65166426_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_166_65166426_qa_4/environment/pull_bucket.py +++ b/tasks/0065_166_65166426_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_166_65166426_qa_4/task.toml b/tasks/0065_166_65166426_qa_4/task.toml index 12243a01cad5e793c9f12db44200a00cd93a0c86..1b2fbe382d8d754699f85be1c3155d71c08cc819 100644 --- a/tasks/0065_166_65166426_qa_4/task.toml +++ b/tasks/0065_166_65166426_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_166_65166426_qa_5/environment/bootstrap.sh b/tasks/0065_166_65166426_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_166_65166426_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_166_65166426_qa_5/environment/pull_bucket.py b/tasks/0065_166_65166426_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_166_65166426_qa_5/environment/pull_bucket.py +++ b/tasks/0065_166_65166426_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_166_65166426_qa_5/task.toml b/tasks/0065_166_65166426_qa_5/task.toml index b3e6439018b9de12587760a474bb5fca4ce8a6f5..c821af2866fe172274f671a7871a97ff46ea27f0 100644 --- a/tasks/0065_166_65166426_qa_5/task.toml +++ b/tasks/0065_166_65166426_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_262_65262139_qa_4/environment/bootstrap.sh b/tasks/0065_262_65262139_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_262_65262139_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_262_65262139_qa_4/environment/pull_bucket.py b/tasks/0065_262_65262139_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_262_65262139_qa_4/environment/pull_bucket.py +++ b/tasks/0065_262_65262139_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_262_65262139_qa_4/task.toml b/tasks/0065_262_65262139_qa_4/task.toml index d25d48ab05e9e62b3437c8bf4990e722d6fa7d28..7f5efaafd232a81f205a6477d297dc29bac167a3 100644 --- a/tasks/0065_262_65262139_qa_4/task.toml +++ b/tasks/0065_262_65262139_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_282_65282332_qa_1/environment/bootstrap.sh b/tasks/0065_282_65282332_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_282_65282332_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_282_65282332_qa_1/environment/pull_bucket.py b/tasks/0065_282_65282332_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_282_65282332_qa_1/environment/pull_bucket.py +++ b/tasks/0065_282_65282332_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_282_65282332_qa_1/task.toml b/tasks/0065_282_65282332_qa_1/task.toml index 69b66efbaadea4475dd46a30e3d59c0f29220d47..74d87d359822577f9c63aa87f128dbf0721e7d14 100644 --- a/tasks/0065_282_65282332_qa_1/task.toml +++ b/tasks/0065_282_65282332_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_282_65282332_qa_2/environment/bootstrap.sh b/tasks/0065_282_65282332_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_282_65282332_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_282_65282332_qa_2/environment/pull_bucket.py b/tasks/0065_282_65282332_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_282_65282332_qa_2/environment/pull_bucket.py +++ b/tasks/0065_282_65282332_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_282_65282332_qa_2/task.toml b/tasks/0065_282_65282332_qa_2/task.toml index 8e68f266dcb6ff89819fd6c20e8c09a5ffba8a7d..d419ff8b5040c88070265e033966f6eb4410d823 100644 --- a/tasks/0065_282_65282332_qa_2/task.toml +++ b/tasks/0065_282_65282332_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_282_65282332_qa_5/environment/bootstrap.sh b/tasks/0065_282_65282332_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_282_65282332_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_282_65282332_qa_5/environment/pull_bucket.py b/tasks/0065_282_65282332_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_282_65282332_qa_5/environment/pull_bucket.py +++ b/tasks/0065_282_65282332_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_282_65282332_qa_5/task.toml b/tasks/0065_282_65282332_qa_5/task.toml index 6c03aa802b079bc5b5726159236e55bfbb189626..611b403a95bfd66eeb2c51373c6a1e4e0262e1b9 100644 --- a/tasks/0065_282_65282332_qa_5/task.toml +++ b/tasks/0065_282_65282332_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_337_65337674_qa_4/environment/bootstrap.sh b/tasks/0065_337_65337674_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_337_65337674_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_337_65337674_qa_4/environment/pull_bucket.py b/tasks/0065_337_65337674_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_337_65337674_qa_4/environment/pull_bucket.py +++ b/tasks/0065_337_65337674_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_337_65337674_qa_4/task.toml b/tasks/0065_337_65337674_qa_4/task.toml index 3c897ae4dd13f29e6e17432c43e8c6f30fdd3e64..6e0e3e6993fe1dbc98b788405790a8a4ae0d6943 100644 --- a/tasks/0065_337_65337674_qa_4/task.toml +++ b/tasks/0065_337_65337674_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_360_65360161_qa_1/environment/bootstrap.sh b/tasks/0065_360_65360161_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_360_65360161_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_360_65360161_qa_1/environment/pull_bucket.py b/tasks/0065_360_65360161_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_360_65360161_qa_1/environment/pull_bucket.py +++ b/tasks/0065_360_65360161_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_360_65360161_qa_1/task.toml b/tasks/0065_360_65360161_qa_1/task.toml index acd7b933d65e8a54d6bff5ed87aa13c33c335531..140e5498d985a3a50f3e34653e550f0014a7fd93 100644 --- a/tasks/0065_360_65360161_qa_1/task.toml +++ b/tasks/0065_360_65360161_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_366_65366007_qa_1/environment/bootstrap.sh b/tasks/0065_366_65366007_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_366_65366007_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_366_65366007_qa_1/environment/pull_bucket.py b/tasks/0065_366_65366007_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_366_65366007_qa_1/environment/pull_bucket.py +++ b/tasks/0065_366_65366007_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_366_65366007_qa_1/task.toml b/tasks/0065_366_65366007_qa_1/task.toml index aa0534c5ad707eea29e2eaa01fb468d3760010d7..e29057d527b8ef9f7c382a921dc725c423762ad6 100644 --- a/tasks/0065_366_65366007_qa_1/task.toml +++ b/tasks/0065_366_65366007_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_396_65396447_qa_1/environment/bootstrap.sh b/tasks/0065_396_65396447_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_396_65396447_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_396_65396447_qa_1/environment/pull_bucket.py b/tasks/0065_396_65396447_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_396_65396447_qa_1/environment/pull_bucket.py +++ b/tasks/0065_396_65396447_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_396_65396447_qa_1/task.toml b/tasks/0065_396_65396447_qa_1/task.toml index e42ad876a6451653ff5652415e245ee1fd2a2b92..9c8650207dc116b82cd0d74c5ee163e5909b5134 100644 --- a/tasks/0065_396_65396447_qa_1/task.toml +++ b/tasks/0065_396_65396447_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_396_65396447_qa_5/environment/bootstrap.sh b/tasks/0065_396_65396447_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_396_65396447_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_396_65396447_qa_5/environment/pull_bucket.py b/tasks/0065_396_65396447_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_396_65396447_qa_5/environment/pull_bucket.py +++ b/tasks/0065_396_65396447_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_396_65396447_qa_5/task.toml b/tasks/0065_396_65396447_qa_5/task.toml index 23c7728caf5fa1efca6bb264d678e5e4bb27738d..e2a01456684d70fbd64847d7d50f1c817a0be5d7 100644 --- a/tasks/0065_396_65396447_qa_5/task.toml +++ b/tasks/0065_396_65396447_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_495_65495142_qa_3/environment/bootstrap.sh b/tasks/0065_495_65495142_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_495_65495142_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_495_65495142_qa_3/environment/pull_bucket.py b/tasks/0065_495_65495142_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_495_65495142_qa_3/environment/pull_bucket.py +++ b/tasks/0065_495_65495142_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_495_65495142_qa_3/task.toml b/tasks/0065_495_65495142_qa_3/task.toml index 63087dffe30011a88230b807e413e04d1c77eedb..67db4031c3cabaf56e120bc425a2988138457076 100644 --- a/tasks/0065_495_65495142_qa_3/task.toml +++ b/tasks/0065_495_65495142_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_499_65499556_qa_2/environment/bootstrap.sh b/tasks/0065_499_65499556_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_499_65499556_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_499_65499556_qa_2/environment/pull_bucket.py b/tasks/0065_499_65499556_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_499_65499556_qa_2/environment/pull_bucket.py +++ b/tasks/0065_499_65499556_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_499_65499556_qa_2/task.toml b/tasks/0065_499_65499556_qa_2/task.toml index 6aba70329a0a47250215c0be224605af3aad2986..f97e15e628c9e06ceb48c0fb123e4f600f0b9e55 100644 --- a/tasks/0065_499_65499556_qa_2/task.toml +++ b/tasks/0065_499_65499556_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_499_65499556_qa_3/environment/bootstrap.sh b/tasks/0065_499_65499556_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_499_65499556_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_499_65499556_qa_3/environment/pull_bucket.py b/tasks/0065_499_65499556_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_499_65499556_qa_3/environment/pull_bucket.py +++ b/tasks/0065_499_65499556_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_499_65499556_qa_3/task.toml b/tasks/0065_499_65499556_qa_3/task.toml index 8a3cae90fae4b09499d3dec0b0567791fa74eb86..770ce6c5d43708a144afbacec7adab9c2c6a52a2 100644 --- a/tasks/0065_499_65499556_qa_3/task.toml +++ b/tasks/0065_499_65499556_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_504_65504512_qa_1/environment/bootstrap.sh b/tasks/0065_504_65504512_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_504_65504512_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_504_65504512_qa_1/environment/pull_bucket.py b/tasks/0065_504_65504512_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_504_65504512_qa_1/environment/pull_bucket.py +++ b/tasks/0065_504_65504512_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_504_65504512_qa_1/task.toml b/tasks/0065_504_65504512_qa_1/task.toml index c05fc97b3faff0a3e7a1cffa2ec8e428d4a65879..ac0ce1c471211e3a20e86d7ab1c4dc14c32132e3 100644 --- a/tasks/0065_504_65504512_qa_1/task.toml +++ b/tasks/0065_504_65504512_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_504_65504512_qa_3/environment/bootstrap.sh b/tasks/0065_504_65504512_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_504_65504512_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_504_65504512_qa_3/environment/pull_bucket.py b/tasks/0065_504_65504512_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_504_65504512_qa_3/environment/pull_bucket.py +++ b/tasks/0065_504_65504512_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_504_65504512_qa_3/task.toml b/tasks/0065_504_65504512_qa_3/task.toml index 52a0a1dbf5ab0c5d4b5f2567b5373a63eb264cbe..6c98fb56934d15b7a1a75453100bb31e2c575482 100644 --- a/tasks/0065_504_65504512_qa_3/task.toml +++ b/tasks/0065_504_65504512_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_504_65504512_qa_4/environment/bootstrap.sh b/tasks/0065_504_65504512_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_504_65504512_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_504_65504512_qa_4/environment/pull_bucket.py b/tasks/0065_504_65504512_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_504_65504512_qa_4/environment/pull_bucket.py +++ b/tasks/0065_504_65504512_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_504_65504512_qa_4/task.toml b/tasks/0065_504_65504512_qa_4/task.toml index 075cbe61949febc9bfd7d931d2feb34c0d263836..5e45f94f5e2b77876343126515f093aa0e15df56 100644 --- a/tasks/0065_504_65504512_qa_4/task.toml +++ b/tasks/0065_504_65504512_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_504_65504512_qa_5/environment/bootstrap.sh b/tasks/0065_504_65504512_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_504_65504512_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_504_65504512_qa_5/environment/pull_bucket.py b/tasks/0065_504_65504512_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_504_65504512_qa_5/environment/pull_bucket.py +++ b/tasks/0065_504_65504512_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_504_65504512_qa_5/task.toml b/tasks/0065_504_65504512_qa_5/task.toml index 348cb347ec912aab091ecae82f37a7dcbe6300e5..c518820fac25b039adc0fc2914ba77e87226517c 100644 --- a/tasks/0065_504_65504512_qa_5/task.toml +++ b/tasks/0065_504_65504512_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_535_65535638_qa_1/environment/bootstrap.sh b/tasks/0065_535_65535638_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_535_65535638_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_535_65535638_qa_1/environment/pull_bucket.py b/tasks/0065_535_65535638_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_535_65535638_qa_1/environment/pull_bucket.py +++ b/tasks/0065_535_65535638_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_535_65535638_qa_1/task.toml b/tasks/0065_535_65535638_qa_1/task.toml index 33867e65e4d019836f8e1bdfe3062a1a9c10b96b..571d709b7dd1697478b3d99b1b5e7ff341e83ec0 100644 --- a/tasks/0065_535_65535638_qa_1/task.toml +++ b/tasks/0065_535_65535638_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_547_65547031_qa_1/environment/bootstrap.sh b/tasks/0065_547_65547031_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_547_65547031_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_547_65547031_qa_1/environment/pull_bucket.py b/tasks/0065_547_65547031_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_547_65547031_qa_1/environment/pull_bucket.py +++ b/tasks/0065_547_65547031_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_547_65547031_qa_1/task.toml b/tasks/0065_547_65547031_qa_1/task.toml index f7f37a4cb7e2043446837c590c19cf05f7f705bd..507c19230f63ace432978376c378cae61f80254c 100644 --- a/tasks/0065_547_65547031_qa_1/task.toml +++ b/tasks/0065_547_65547031_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_560_65560280_qa_3/environment/bootstrap.sh b/tasks/0065_560_65560280_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_560_65560280_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_560_65560280_qa_3/environment/pull_bucket.py b/tasks/0065_560_65560280_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_560_65560280_qa_3/environment/pull_bucket.py +++ b/tasks/0065_560_65560280_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_560_65560280_qa_3/task.toml b/tasks/0065_560_65560280_qa_3/task.toml index ff9b1a5ea903fba7109b8273566234779afe825b..18d6e425b1901a846392c6b5343e8dca41c9ca35 100644 --- a/tasks/0065_560_65560280_qa_3/task.toml +++ b/tasks/0065_560_65560280_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_563_65563185_qa_4/environment/bootstrap.sh b/tasks/0065_563_65563185_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_563_65563185_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_563_65563185_qa_4/environment/pull_bucket.py b/tasks/0065_563_65563185_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_563_65563185_qa_4/environment/pull_bucket.py +++ b/tasks/0065_563_65563185_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_563_65563185_qa_4/task.toml b/tasks/0065_563_65563185_qa_4/task.toml index ef3262debbbf03ab09e2dc521c0b14e0d6217491..2179b2c2c719cee0624ddb723b717463ff218c8e 100644 --- a/tasks/0065_563_65563185_qa_4/task.toml +++ b/tasks/0065_563_65563185_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_573_65573990_qa_5/environment/bootstrap.sh b/tasks/0065_573_65573990_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_573_65573990_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_573_65573990_qa_5/environment/pull_bucket.py b/tasks/0065_573_65573990_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_573_65573990_qa_5/environment/pull_bucket.py +++ b/tasks/0065_573_65573990_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_573_65573990_qa_5/task.toml b/tasks/0065_573_65573990_qa_5/task.toml index c4387c23015f2d7c01e7d963c6db49e46eb23cd0..e6fdb35ad0238b0b4a4d7ab23d82bd30afd686c1 100644 --- a/tasks/0065_573_65573990_qa_5/task.toml +++ b/tasks/0065_573_65573990_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_668_65668933_qa_2/environment/bootstrap.sh b/tasks/0065_668_65668933_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_668_65668933_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_668_65668933_qa_2/environment/pull_bucket.py b/tasks/0065_668_65668933_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_668_65668933_qa_2/environment/pull_bucket.py +++ b/tasks/0065_668_65668933_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_668_65668933_qa_2/task.toml b/tasks/0065_668_65668933_qa_2/task.toml index 38d04b00b80e995ac363586bb5250b46b9e3d10e..26221bd1aa3795f0599e9ce1cedf5d2ca38f2a77 100644 --- a/tasks/0065_668_65668933_qa_2/task.toml +++ b/tasks/0065_668_65668933_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_679_65679925_qa_1/environment/bootstrap.sh b/tasks/0065_679_65679925_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_679_65679925_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_679_65679925_qa_1/environment/pull_bucket.py b/tasks/0065_679_65679925_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_679_65679925_qa_1/environment/pull_bucket.py +++ b/tasks/0065_679_65679925_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_679_65679925_qa_1/task.toml b/tasks/0065_679_65679925_qa_1/task.toml index 51d1bda6910459764601e550c3ea75733500bc73..177aea3b8a94bab44c8144b3bb5ba53f90922757 100644 --- a/tasks/0065_679_65679925_qa_1/task.toml +++ b/tasks/0065_679_65679925_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_716_65716976_qa_1/environment/bootstrap.sh b/tasks/0065_716_65716976_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_716_65716976_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_716_65716976_qa_1/environment/pull_bucket.py b/tasks/0065_716_65716976_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_716_65716976_qa_1/environment/pull_bucket.py +++ b/tasks/0065_716_65716976_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_716_65716976_qa_1/task.toml b/tasks/0065_716_65716976_qa_1/task.toml index ebf1fef5792f41ab7cc0e873d539aba7f64419ae..78a0dff102f092b5e1bc54c3b7627b1747bd854a 100644 --- a/tasks/0065_716_65716976_qa_1/task.toml +++ b/tasks/0065_716_65716976_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_735_65735171_qa_4/environment/bootstrap.sh b/tasks/0065_735_65735171_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_735_65735171_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_735_65735171_qa_4/environment/pull_bucket.py b/tasks/0065_735_65735171_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_735_65735171_qa_4/environment/pull_bucket.py +++ b/tasks/0065_735_65735171_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_735_65735171_qa_4/task.toml b/tasks/0065_735_65735171_qa_4/task.toml index 8268a3248ea1f6ec84e83781a811e68890b4aad0..d5621ba2d877d45d1e4d432c59de1a8821bb3d48 100644 --- a/tasks/0065_735_65735171_qa_4/task.toml +++ b/tasks/0065_735_65735171_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_745_65745045_qa_1/environment/bootstrap.sh b/tasks/0065_745_65745045_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_745_65745045_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_745_65745045_qa_1/environment/pull_bucket.py b/tasks/0065_745_65745045_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_745_65745045_qa_1/environment/pull_bucket.py +++ b/tasks/0065_745_65745045_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_745_65745045_qa_1/task.toml b/tasks/0065_745_65745045_qa_1/task.toml index e9ce76d757467f611b6c36b63f44f604186dd4ca..ae20810be35bb2926b9c6fd56f66dc9aefc7dc8d 100644 --- a/tasks/0065_745_65745045_qa_1/task.toml +++ b/tasks/0065_745_65745045_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_745_65745045_qa_3/environment/bootstrap.sh b/tasks/0065_745_65745045_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_745_65745045_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_745_65745045_qa_3/environment/pull_bucket.py b/tasks/0065_745_65745045_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_745_65745045_qa_3/environment/pull_bucket.py +++ b/tasks/0065_745_65745045_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_745_65745045_qa_3/task.toml b/tasks/0065_745_65745045_qa_3/task.toml index 088bf0670abf16b499744104de2c928b8c9eb152..f2f5d22f5da579bb2e43a0bd64fee8231d54ce01 100644 --- a/tasks/0065_745_65745045_qa_3/task.toml +++ b/tasks/0065_745_65745045_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_756_65756425_qa_1/environment/bootstrap.sh b/tasks/0065_756_65756425_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_756_65756425_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_756_65756425_qa_1/environment/pull_bucket.py b/tasks/0065_756_65756425_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_756_65756425_qa_1/environment/pull_bucket.py +++ b/tasks/0065_756_65756425_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_756_65756425_qa_1/task.toml b/tasks/0065_756_65756425_qa_1/task.toml index 70a536c5e522e282a6edc8833725a4adad93cd12..b708e0db9384919eb30ccab60efee4ae9e65c5b4 100644 --- a/tasks/0065_756_65756425_qa_1/task.toml +++ b/tasks/0065_756_65756425_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_789_65789409_qa_2/environment/bootstrap.sh b/tasks/0065_789_65789409_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_789_65789409_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_789_65789409_qa_2/environment/pull_bucket.py b/tasks/0065_789_65789409_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_789_65789409_qa_2/environment/pull_bucket.py +++ b/tasks/0065_789_65789409_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_789_65789409_qa_2/task.toml b/tasks/0065_789_65789409_qa_2/task.toml index b8b7c040b9e1f744b524919be8cec75c3c6cc7b4..2442c92d314d74b5f874b2cb2ae7b23ab14b25a6 100644 --- a/tasks/0065_789_65789409_qa_2/task.toml +++ b/tasks/0065_789_65789409_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_794_65794937_qa_3/environment/bootstrap.sh b/tasks/0065_794_65794937_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_794_65794937_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_794_65794937_qa_3/environment/pull_bucket.py b/tasks/0065_794_65794937_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_794_65794937_qa_3/environment/pull_bucket.py +++ b/tasks/0065_794_65794937_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_794_65794937_qa_3/task.toml b/tasks/0065_794_65794937_qa_3/task.toml index 847654337ade7a1602f788b572e3c37b0734b1fb..78daf1915261bcf26e7c2734b6aad3a767569495 100644 --- a/tasks/0065_794_65794937_qa_3/task.toml +++ b/tasks/0065_794_65794937_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_794_65794937_qa_5/environment/bootstrap.sh b/tasks/0065_794_65794937_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_794_65794937_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_794_65794937_qa_5/environment/pull_bucket.py b/tasks/0065_794_65794937_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_794_65794937_qa_5/environment/pull_bucket.py +++ b/tasks/0065_794_65794937_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_794_65794937_qa_5/task.toml b/tasks/0065_794_65794937_qa_5/task.toml index 2f680082034bdb27ebc8629f2f37fb16b5413eed..68afc9e72f97487c3aed23bccd067dd7efb01167 100644 --- a/tasks/0065_794_65794937_qa_5/task.toml +++ b/tasks/0065_794_65794937_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_850_65850570_qa_3/environment/bootstrap.sh b/tasks/0065_850_65850570_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_850_65850570_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_850_65850570_qa_3/environment/pull_bucket.py b/tasks/0065_850_65850570_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_850_65850570_qa_3/environment/pull_bucket.py +++ b/tasks/0065_850_65850570_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_850_65850570_qa_3/task.toml b/tasks/0065_850_65850570_qa_3/task.toml index 3f1a95b848b9b56dd20139a37a52220cbbea0a7c..4e0f2ff24d7f289e1905f0f72a32953e71821293 100644 --- a/tasks/0065_850_65850570_qa_3/task.toml +++ b/tasks/0065_850_65850570_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_850_65850570_qa_4/environment/bootstrap.sh b/tasks/0065_850_65850570_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_850_65850570_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_850_65850570_qa_4/environment/pull_bucket.py b/tasks/0065_850_65850570_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_850_65850570_qa_4/environment/pull_bucket.py +++ b/tasks/0065_850_65850570_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_850_65850570_qa_4/task.toml b/tasks/0065_850_65850570_qa_4/task.toml index bb0dca0657f9d33ebeb1afbfeee7e63bae121185..9305398b3fad9fea62733cdf2d5b0de258c9a9f3 100644 --- a/tasks/0065_850_65850570_qa_4/task.toml +++ b/tasks/0065_850_65850570_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_929_65929308_qa_1/environment/bootstrap.sh b/tasks/0065_929_65929308_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_929_65929308_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_929_65929308_qa_1/environment/pull_bucket.py b/tasks/0065_929_65929308_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_929_65929308_qa_1/environment/pull_bucket.py +++ b/tasks/0065_929_65929308_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_929_65929308_qa_1/task.toml b/tasks/0065_929_65929308_qa_1/task.toml index 661cdd45cb5854b5b9a13a6e754c67684cdb8b1a..44c0100da4057a90fe0ae7ff828413acd0c7c123 100644 --- a/tasks/0065_929_65929308_qa_1/task.toml +++ b/tasks/0065_929_65929308_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_929_65929308_qa_5/environment/bootstrap.sh b/tasks/0065_929_65929308_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_929_65929308_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_929_65929308_qa_5/environment/pull_bucket.py b/tasks/0065_929_65929308_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_929_65929308_qa_5/environment/pull_bucket.py +++ b/tasks/0065_929_65929308_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_929_65929308_qa_5/task.toml b/tasks/0065_929_65929308_qa_5/task.toml index 922cbb0acf172e17017a2355c029d702b7c63ed8..d669968779595e502df438e9fbb6d57c39b6efbb 100644 --- a/tasks/0065_929_65929308_qa_5/task.toml +++ b/tasks/0065_929_65929308_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_935_65935179_qa_2/environment/bootstrap.sh b/tasks/0065_935_65935179_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_935_65935179_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_935_65935179_qa_2/environment/pull_bucket.py b/tasks/0065_935_65935179_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_935_65935179_qa_2/environment/pull_bucket.py +++ b/tasks/0065_935_65935179_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_935_65935179_qa_2/task.toml b/tasks/0065_935_65935179_qa_2/task.toml index f7d6cea35da30e6b67ace470ada7392869c882ff..1cc5e6b5aad3d9c6948c332c84db36d753b2790d 100644 --- a/tasks/0065_935_65935179_qa_2/task.toml +++ b/tasks/0065_935_65935179_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_951_65951065_qa_1/environment/bootstrap.sh b/tasks/0065_951_65951065_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_951_65951065_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_951_65951065_qa_1/environment/pull_bucket.py b/tasks/0065_951_65951065_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_951_65951065_qa_1/environment/pull_bucket.py +++ b/tasks/0065_951_65951065_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_951_65951065_qa_1/task.toml b/tasks/0065_951_65951065_qa_1/task.toml index 11120e169e4eda475759de8a470cd1900ed122da..9273fb9c9a8bfd1977dc6abd237e123c272160ca 100644 --- a/tasks/0065_951_65951065_qa_1/task.toml +++ b/tasks/0065_951_65951065_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_988_65988202_qa_2/environment/bootstrap.sh b/tasks/0065_988_65988202_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_988_65988202_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_988_65988202_qa_2/environment/pull_bucket.py b/tasks/0065_988_65988202_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_988_65988202_qa_2/environment/pull_bucket.py +++ b/tasks/0065_988_65988202_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_988_65988202_qa_2/task.toml b/tasks/0065_988_65988202_qa_2/task.toml index 50048f5b701ccf66143b642eca00b9ee5b2d458d..a724cbc47d5ad9e0c35262b23f67a3d3e9d6a736 100644 --- a/tasks/0065_988_65988202_qa_2/task.toml +++ b/tasks/0065_988_65988202_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0065_989_65989824_qa_2/environment/bootstrap.sh b/tasks/0065_989_65989824_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0065_989_65989824_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0065_989_65989824_qa_2/environment/pull_bucket.py b/tasks/0065_989_65989824_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0065_989_65989824_qa_2/environment/pull_bucket.py +++ b/tasks/0065_989_65989824_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0065_989_65989824_qa_2/task.toml b/tasks/0065_989_65989824_qa_2/task.toml index ba96f88d41395c9ba75731a89c9cc7d1b47b0fed..2e43b509430119014e36a1c71100c24fff06b42f 100644 --- a/tasks/0065_989_65989824_qa_2/task.toml +++ b/tasks/0065_989_65989824_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_030_66030315_qa_4/environment/bootstrap.sh b/tasks/0066_030_66030315_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_030_66030315_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_030_66030315_qa_4/environment/pull_bucket.py b/tasks/0066_030_66030315_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_030_66030315_qa_4/environment/pull_bucket.py +++ b/tasks/0066_030_66030315_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_030_66030315_qa_4/task.toml b/tasks/0066_030_66030315_qa_4/task.toml index ae234a4bb410400dcec21b3a51059942187ef40e..df6db38946a4f8c8e8d60dbb5150d67928581633 100644 --- a/tasks/0066_030_66030315_qa_4/task.toml +++ b/tasks/0066_030_66030315_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_039_66039698_qa_2/environment/bootstrap.sh b/tasks/0066_039_66039698_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_039_66039698_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_039_66039698_qa_2/environment/pull_bucket.py b/tasks/0066_039_66039698_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_039_66039698_qa_2/environment/pull_bucket.py +++ b/tasks/0066_039_66039698_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_039_66039698_qa_2/task.toml b/tasks/0066_039_66039698_qa_2/task.toml index 74d68a9298eb6974e1b9888f96bd77eab9c3bcca..a95df1c913c0ce1705fc8c87b9c7a3a8d4494b35 100644 --- a/tasks/0066_039_66039698_qa_2/task.toml +++ b/tasks/0066_039_66039698_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_039_66039698_qa_4/environment/bootstrap.sh b/tasks/0066_039_66039698_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_039_66039698_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_039_66039698_qa_4/environment/pull_bucket.py b/tasks/0066_039_66039698_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_039_66039698_qa_4/environment/pull_bucket.py +++ b/tasks/0066_039_66039698_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_039_66039698_qa_4/task.toml b/tasks/0066_039_66039698_qa_4/task.toml index 24ee0839a732695877a72bd41e4e96ade703d448..8b8acc6a604ad0e20d489498ce181e91167475e2 100644 --- a/tasks/0066_039_66039698_qa_4/task.toml +++ b/tasks/0066_039_66039698_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_107_66107048_qa_1/environment/bootstrap.sh b/tasks/0066_107_66107048_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_107_66107048_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_107_66107048_qa_1/environment/pull_bucket.py b/tasks/0066_107_66107048_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_107_66107048_qa_1/environment/pull_bucket.py +++ b/tasks/0066_107_66107048_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_107_66107048_qa_1/task.toml b/tasks/0066_107_66107048_qa_1/task.toml index 6b00a666fbe4ab8289f21d024ec41885bc656590..5a14750915b675b78f1e44b6856f38d7e540675e 100644 --- a/tasks/0066_107_66107048_qa_1/task.toml +++ b/tasks/0066_107_66107048_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_107_66107048_qa_2/environment/bootstrap.sh b/tasks/0066_107_66107048_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_107_66107048_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_107_66107048_qa_2/environment/pull_bucket.py b/tasks/0066_107_66107048_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_107_66107048_qa_2/environment/pull_bucket.py +++ b/tasks/0066_107_66107048_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_107_66107048_qa_2/task.toml b/tasks/0066_107_66107048_qa_2/task.toml index 7b15361cc2112aee0c592364f0d1de2b2b404bfc..17d63b0bb38c4f9440a0d95facbf9a6f354f2733 100644 --- a/tasks/0066_107_66107048_qa_2/task.toml +++ b/tasks/0066_107_66107048_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_107_66107048_qa_4/environment/bootstrap.sh b/tasks/0066_107_66107048_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_107_66107048_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_107_66107048_qa_4/environment/pull_bucket.py b/tasks/0066_107_66107048_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_107_66107048_qa_4/environment/pull_bucket.py +++ b/tasks/0066_107_66107048_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_107_66107048_qa_4/task.toml b/tasks/0066_107_66107048_qa_4/task.toml index fc974584a68e4458d2b64b06f225dda0d278d180..d1293cc08ca65fd2c97162bf672e7cbf0cac5ec6 100644 --- a/tasks/0066_107_66107048_qa_4/task.toml +++ b/tasks/0066_107_66107048_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_134_66134404_qa_1/environment/bootstrap.sh b/tasks/0066_134_66134404_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_134_66134404_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_134_66134404_qa_1/environment/pull_bucket.py b/tasks/0066_134_66134404_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_134_66134404_qa_1/environment/pull_bucket.py +++ b/tasks/0066_134_66134404_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_134_66134404_qa_1/task.toml b/tasks/0066_134_66134404_qa_1/task.toml index e239fffe8b8db215a1b0709fa257fd2ae48cc611..d8e986024c7da12ba572958e65e05f3e73dcf197 100644 --- a/tasks/0066_134_66134404_qa_1/task.toml +++ b/tasks/0066_134_66134404_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_134_66134404_qa_4/environment/bootstrap.sh b/tasks/0066_134_66134404_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_134_66134404_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_134_66134404_qa_4/environment/pull_bucket.py b/tasks/0066_134_66134404_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_134_66134404_qa_4/environment/pull_bucket.py +++ b/tasks/0066_134_66134404_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_134_66134404_qa_4/task.toml b/tasks/0066_134_66134404_qa_4/task.toml index 77cbcb76166c5842e172cd1bc30d867068ebc6ad..930e0f1e091f9ce5963a405bdcf0cf67dce56f4a 100644 --- a/tasks/0066_134_66134404_qa_4/task.toml +++ b/tasks/0066_134_66134404_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_186_66186009_qa_2/environment/bootstrap.sh b/tasks/0066_186_66186009_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_186_66186009_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_186_66186009_qa_2/environment/pull_bucket.py b/tasks/0066_186_66186009_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_186_66186009_qa_2/environment/pull_bucket.py +++ b/tasks/0066_186_66186009_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_186_66186009_qa_2/task.toml b/tasks/0066_186_66186009_qa_2/task.toml index 7231c2855c14275d3bbdcb97a3827ac2f35120f3..049f0aef255f24c50fe547d79fffd140a9f6ae41 100644 --- a/tasks/0066_186_66186009_qa_2/task.toml +++ b/tasks/0066_186_66186009_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_186_66186009_qa_3/environment/bootstrap.sh b/tasks/0066_186_66186009_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_186_66186009_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_186_66186009_qa_3/environment/pull_bucket.py b/tasks/0066_186_66186009_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_186_66186009_qa_3/environment/pull_bucket.py +++ b/tasks/0066_186_66186009_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_186_66186009_qa_3/task.toml b/tasks/0066_186_66186009_qa_3/task.toml index 07014770fc4e26f7fd4f69dac141b2ed35902e7d..643b7b835b67421839943ac9b55e6c66b267002b 100644 --- a/tasks/0066_186_66186009_qa_3/task.toml +++ b/tasks/0066_186_66186009_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_186_66186009_qa_4/environment/bootstrap.sh b/tasks/0066_186_66186009_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_186_66186009_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_186_66186009_qa_4/environment/pull_bucket.py b/tasks/0066_186_66186009_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_186_66186009_qa_4/environment/pull_bucket.py +++ b/tasks/0066_186_66186009_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_186_66186009_qa_4/task.toml b/tasks/0066_186_66186009_qa_4/task.toml index 995cb367db978b5d20fcb922ea15253fac901e6a..e90489bde141a8971641d71a106782270f6de1bb 100644 --- a/tasks/0066_186_66186009_qa_4/task.toml +++ b/tasks/0066_186_66186009_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_372_66372058_qa_2/environment/bootstrap.sh b/tasks/0066_372_66372058_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_372_66372058_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_372_66372058_qa_2/environment/pull_bucket.py b/tasks/0066_372_66372058_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_372_66372058_qa_2/environment/pull_bucket.py +++ b/tasks/0066_372_66372058_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_372_66372058_qa_2/task.toml b/tasks/0066_372_66372058_qa_2/task.toml index cc96e567bb33bdbed680b396d9d1a685c79faf6c..bcde9fb4668c5117b2d48caa2e53a269b79655ac 100644 --- a/tasks/0066_372_66372058_qa_2/task.toml +++ b/tasks/0066_372_66372058_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_372_66372058_qa_4/environment/bootstrap.sh b/tasks/0066_372_66372058_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_372_66372058_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_372_66372058_qa_4/environment/pull_bucket.py b/tasks/0066_372_66372058_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_372_66372058_qa_4/environment/pull_bucket.py +++ b/tasks/0066_372_66372058_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_372_66372058_qa_4/task.toml b/tasks/0066_372_66372058_qa_4/task.toml index eac23b8ec6c71fb02a3f6ecd66f210f910bbb763..d5ec9acb06283eea1e97d2f57398b20c56add8a4 100644 --- a/tasks/0066_372_66372058_qa_4/task.toml +++ b/tasks/0066_372_66372058_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_374_66374046_qa_3/environment/bootstrap.sh b/tasks/0066_374_66374046_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_374_66374046_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_374_66374046_qa_3/environment/pull_bucket.py b/tasks/0066_374_66374046_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_374_66374046_qa_3/environment/pull_bucket.py +++ b/tasks/0066_374_66374046_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_374_66374046_qa_3/task.toml b/tasks/0066_374_66374046_qa_3/task.toml index 78f61f2413524d8d26ed71ea9a2bc85eae1ba087..62db7371bde51d46ffcbc5b956df7ebc9dd4e415 100644 --- a/tasks/0066_374_66374046_qa_3/task.toml +++ b/tasks/0066_374_66374046_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_392_66392992_qa_3/environment/bootstrap.sh b/tasks/0066_392_66392992_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_392_66392992_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_392_66392992_qa_3/environment/pull_bucket.py b/tasks/0066_392_66392992_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_392_66392992_qa_3/environment/pull_bucket.py +++ b/tasks/0066_392_66392992_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_392_66392992_qa_3/task.toml b/tasks/0066_392_66392992_qa_3/task.toml index cc5092b73d724efad49c9c6d6cc833c3da857bfa..c62594bf3c03e5652e46202386c679f3c6d770c7 100644 --- a/tasks/0066_392_66392992_qa_3/task.toml +++ b/tasks/0066_392_66392992_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_429_66429634_qa_1/environment/bootstrap.sh b/tasks/0066_429_66429634_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_429_66429634_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_429_66429634_qa_1/environment/pull_bucket.py b/tasks/0066_429_66429634_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_429_66429634_qa_1/environment/pull_bucket.py +++ b/tasks/0066_429_66429634_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_429_66429634_qa_1/task.toml b/tasks/0066_429_66429634_qa_1/task.toml index dcaff359cc8b3dc32b0cb2ceeeaaa16cf7ba7b2d..0650b566cb81a1e2d42d8a642da089bd78d0e64d 100644 --- a/tasks/0066_429_66429634_qa_1/task.toml +++ b/tasks/0066_429_66429634_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_429_66429634_qa_5/environment/bootstrap.sh b/tasks/0066_429_66429634_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_429_66429634_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_429_66429634_qa_5/environment/pull_bucket.py b/tasks/0066_429_66429634_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_429_66429634_qa_5/environment/pull_bucket.py +++ b/tasks/0066_429_66429634_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_429_66429634_qa_5/task.toml b/tasks/0066_429_66429634_qa_5/task.toml index c55bee0e890a645f40b21a65c356fa7d8cebbb1d..8840bb9026787608327227501bfd7753bf3127eb 100644 --- a/tasks/0066_429_66429634_qa_5/task.toml +++ b/tasks/0066_429_66429634_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_435_66435240_qa_4/environment/bootstrap.sh b/tasks/0066_435_66435240_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_435_66435240_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_435_66435240_qa_4/environment/pull_bucket.py b/tasks/0066_435_66435240_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_435_66435240_qa_4/environment/pull_bucket.py +++ b/tasks/0066_435_66435240_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_435_66435240_qa_4/task.toml b/tasks/0066_435_66435240_qa_4/task.toml index ff7338067093ff030d9785ec8dfb1eae8da3ce11..89cb2edbe7033ce3aadef3f306c7e6aba1258cbf 100644 --- a/tasks/0066_435_66435240_qa_4/task.toml +++ b/tasks/0066_435_66435240_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_447_66447966_qa_4/environment/bootstrap.sh b/tasks/0066_447_66447966_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_447_66447966_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_447_66447966_qa_4/environment/pull_bucket.py b/tasks/0066_447_66447966_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_447_66447966_qa_4/environment/pull_bucket.py +++ b/tasks/0066_447_66447966_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_447_66447966_qa_4/task.toml b/tasks/0066_447_66447966_qa_4/task.toml index 467717976c39192973e090e9b370a35cc5bda378..852b8e3f13bd3cbbc4318a570d98d1251021174a 100644 --- a/tasks/0066_447_66447966_qa_4/task.toml +++ b/tasks/0066_447_66447966_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_479_66479571_qa_2/environment/bootstrap.sh b/tasks/0066_479_66479571_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_479_66479571_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_479_66479571_qa_2/environment/pull_bucket.py b/tasks/0066_479_66479571_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_479_66479571_qa_2/environment/pull_bucket.py +++ b/tasks/0066_479_66479571_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_479_66479571_qa_2/task.toml b/tasks/0066_479_66479571_qa_2/task.toml index 2df22812da596df73e5393e329d7c75862f54668..1e571cdfe7f65a72af348698ad5415c8dffb63e4 100644 --- a/tasks/0066_479_66479571_qa_2/task.toml +++ b/tasks/0066_479_66479571_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_515_66515711_qa_3/environment/bootstrap.sh b/tasks/0066_515_66515711_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_515_66515711_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_515_66515711_qa_3/environment/pull_bucket.py b/tasks/0066_515_66515711_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_515_66515711_qa_3/environment/pull_bucket.py +++ b/tasks/0066_515_66515711_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_515_66515711_qa_3/task.toml b/tasks/0066_515_66515711_qa_3/task.toml index 8e5374c491a145f004727527586840744e29aa0b..75a2014ac575034d815afb9da2381d885e174e27 100644 --- a/tasks/0066_515_66515711_qa_3/task.toml +++ b/tasks/0066_515_66515711_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_515_66515711_qa_4/environment/bootstrap.sh b/tasks/0066_515_66515711_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_515_66515711_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_515_66515711_qa_4/environment/pull_bucket.py b/tasks/0066_515_66515711_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_515_66515711_qa_4/environment/pull_bucket.py +++ b/tasks/0066_515_66515711_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_515_66515711_qa_4/task.toml b/tasks/0066_515_66515711_qa_4/task.toml index 4a81c53ae845ab1b0feb5f587ffb65b752680efe..d1caf598609920e95ea3407cddf1b0e7a68b1634 100644 --- a/tasks/0066_515_66515711_qa_4/task.toml +++ b/tasks/0066_515_66515711_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_515_66515711_qa_5/environment/bootstrap.sh b/tasks/0066_515_66515711_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_515_66515711_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_515_66515711_qa_5/environment/pull_bucket.py b/tasks/0066_515_66515711_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_515_66515711_qa_5/environment/pull_bucket.py +++ b/tasks/0066_515_66515711_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_515_66515711_qa_5/task.toml b/tasks/0066_515_66515711_qa_5/task.toml index 939873c83b70ffa93d141e004b879a878fbb81ce..eacee07e830fe6244a72bdc1afdd3cdb887b2211 100644 --- a/tasks/0066_515_66515711_qa_5/task.toml +++ b/tasks/0066_515_66515711_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_527_66527542_qa_2/environment/bootstrap.sh b/tasks/0066_527_66527542_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_527_66527542_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_527_66527542_qa_2/environment/pull_bucket.py b/tasks/0066_527_66527542_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_527_66527542_qa_2/environment/pull_bucket.py +++ b/tasks/0066_527_66527542_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_527_66527542_qa_2/task.toml b/tasks/0066_527_66527542_qa_2/task.toml index a5cb3ecd5395f67ed91ffaef634f8c954f2860a6..7d4fe80b3bb1f11aa6431ae5b439da5a02e10b78 100644 --- a/tasks/0066_527_66527542_qa_2/task.toml +++ b/tasks/0066_527_66527542_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_599_66599381_qa_2/environment/bootstrap.sh b/tasks/0066_599_66599381_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_599_66599381_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_599_66599381_qa_2/environment/pull_bucket.py b/tasks/0066_599_66599381_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_599_66599381_qa_2/environment/pull_bucket.py +++ b/tasks/0066_599_66599381_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_599_66599381_qa_2/task.toml b/tasks/0066_599_66599381_qa_2/task.toml index ba18731e653aa35892bf3732e59aba62a631eba3..9e011bb3f9a9ce3419775191a935821475e504a3 100644 --- a/tasks/0066_599_66599381_qa_2/task.toml +++ b/tasks/0066_599_66599381_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_634_66634848_qa_3/environment/bootstrap.sh b/tasks/0066_634_66634848_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_634_66634848_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_634_66634848_qa_3/environment/pull_bucket.py b/tasks/0066_634_66634848_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_634_66634848_qa_3/environment/pull_bucket.py +++ b/tasks/0066_634_66634848_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_634_66634848_qa_3/task.toml b/tasks/0066_634_66634848_qa_3/task.toml index 8c68620d31ca0fc40863ecec52364241a0ca51fd..2aaaa3884c787d2aab0b40a0792eb27323c3eb13 100644 --- a/tasks/0066_634_66634848_qa_3/task.toml +++ b/tasks/0066_634_66634848_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_715_66715498_qa_1/environment/bootstrap.sh b/tasks/0066_715_66715498_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_715_66715498_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_715_66715498_qa_1/environment/pull_bucket.py b/tasks/0066_715_66715498_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_715_66715498_qa_1/environment/pull_bucket.py +++ b/tasks/0066_715_66715498_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_715_66715498_qa_1/task.toml b/tasks/0066_715_66715498_qa_1/task.toml index 3b07ea907798cb19dc5ba431da960a20d70a9e34..876c0683574afb7a3384f1f59e820cf6b373b900 100644 --- a/tasks/0066_715_66715498_qa_1/task.toml +++ b/tasks/0066_715_66715498_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_730_66730048_qa_2/environment/bootstrap.sh b/tasks/0066_730_66730048_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_730_66730048_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_730_66730048_qa_2/environment/pull_bucket.py b/tasks/0066_730_66730048_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_730_66730048_qa_2/environment/pull_bucket.py +++ b/tasks/0066_730_66730048_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_730_66730048_qa_2/task.toml b/tasks/0066_730_66730048_qa_2/task.toml index 720702db75740e2cdde43157d782572c4bbf19eb..1363c69c25209c8c0e8b2e3d6c64f8e080bc6fa8 100644 --- a/tasks/0066_730_66730048_qa_2/task.toml +++ b/tasks/0066_730_66730048_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_778_66778213_qa_2/environment/bootstrap.sh b/tasks/0066_778_66778213_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_778_66778213_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_778_66778213_qa_2/environment/pull_bucket.py b/tasks/0066_778_66778213_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_778_66778213_qa_2/environment/pull_bucket.py +++ b/tasks/0066_778_66778213_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_778_66778213_qa_2/task.toml b/tasks/0066_778_66778213_qa_2/task.toml index 70a66cb6a466b95875a9ddb3e076eeae25401037..9e1fc628debd14a792dcf60d6d3f6862143ca96f 100644 --- a/tasks/0066_778_66778213_qa_2/task.toml +++ b/tasks/0066_778_66778213_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_778_66778213_qa_4/environment/bootstrap.sh b/tasks/0066_778_66778213_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_778_66778213_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_778_66778213_qa_4/environment/pull_bucket.py b/tasks/0066_778_66778213_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_778_66778213_qa_4/environment/pull_bucket.py +++ b/tasks/0066_778_66778213_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_778_66778213_qa_4/task.toml b/tasks/0066_778_66778213_qa_4/task.toml index 3db7bdd73e75f1985e3e2170bb17ee0e966da228..992bf830c171bbe43b0ad01f19623e35ad4f5275 100644 --- a/tasks/0066_778_66778213_qa_4/task.toml +++ b/tasks/0066_778_66778213_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_819_66819249_qa_2/environment/bootstrap.sh b/tasks/0066_819_66819249_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_819_66819249_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_819_66819249_qa_2/environment/pull_bucket.py b/tasks/0066_819_66819249_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_819_66819249_qa_2/environment/pull_bucket.py +++ b/tasks/0066_819_66819249_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_819_66819249_qa_2/task.toml b/tasks/0066_819_66819249_qa_2/task.toml index 77ac7c4dcd98185c0a0f291f0d94bf3032cbdf2d..1c1bc491165d859ab417ef7ef9a597f538f9a581 100644 --- a/tasks/0066_819_66819249_qa_2/task.toml +++ b/tasks/0066_819_66819249_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_820_66820736_qa_3/environment/bootstrap.sh b/tasks/0066_820_66820736_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_820_66820736_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_820_66820736_qa_3/environment/pull_bucket.py b/tasks/0066_820_66820736_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_820_66820736_qa_3/environment/pull_bucket.py +++ b/tasks/0066_820_66820736_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_820_66820736_qa_3/task.toml b/tasks/0066_820_66820736_qa_3/task.toml index e21c80a3e803fdef55675e4f0646b2055df17d29..48c807e55acebf686120c6dfb2090dcb0f7c3663 100644 --- a/tasks/0066_820_66820736_qa_3/task.toml +++ b/tasks/0066_820_66820736_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0066_890_66890335_qa_4/environment/bootstrap.sh b/tasks/0066_890_66890335_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0066_890_66890335_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0066_890_66890335_qa_4/environment/pull_bucket.py b/tasks/0066_890_66890335_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0066_890_66890335_qa_4/environment/pull_bucket.py +++ b/tasks/0066_890_66890335_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0066_890_66890335_qa_4/task.toml b/tasks/0066_890_66890335_qa_4/task.toml index 2ece1074dd989b00c77bd726bc018a9455897809..b1f2dcfef6b8d6e84c494e0866797367de89a06a 100644 --- a/tasks/0066_890_66890335_qa_4/task.toml +++ b/tasks/0066_890_66890335_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_061_67061270_qa_3/environment/bootstrap.sh b/tasks/0067_061_67061270_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_061_67061270_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_061_67061270_qa_3/environment/pull_bucket.py b/tasks/0067_061_67061270_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_061_67061270_qa_3/environment/pull_bucket.py +++ b/tasks/0067_061_67061270_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_061_67061270_qa_3/task.toml b/tasks/0067_061_67061270_qa_3/task.toml index b3767c726f03e465790915cc1bfc2e99f0e2e61a..1f2ef413a5133f520ff867de7df594fc3e455828 100644 --- a/tasks/0067_061_67061270_qa_3/task.toml +++ b/tasks/0067_061_67061270_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_061_67061270_qa_5/environment/bootstrap.sh b/tasks/0067_061_67061270_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_061_67061270_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_061_67061270_qa_5/environment/pull_bucket.py b/tasks/0067_061_67061270_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_061_67061270_qa_5/environment/pull_bucket.py +++ b/tasks/0067_061_67061270_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_061_67061270_qa_5/task.toml b/tasks/0067_061_67061270_qa_5/task.toml index 45eb0164c6d19f3bac001988a8217f9071a7ba44..a04d716565d509dd1ed5be8f892fe231e902e20b 100644 --- a/tasks/0067_061_67061270_qa_5/task.toml +++ b/tasks/0067_061_67061270_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_062_67062935_qa_2/environment/bootstrap.sh b/tasks/0067_062_67062935_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_062_67062935_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_062_67062935_qa_2/environment/pull_bucket.py b/tasks/0067_062_67062935_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_062_67062935_qa_2/environment/pull_bucket.py +++ b/tasks/0067_062_67062935_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_062_67062935_qa_2/task.toml b/tasks/0067_062_67062935_qa_2/task.toml index 989ddd3a59b4151de29128572f12c8a0ca2c910c..eaa93272bf6996e018e5a0f24c3df07079993768 100644 --- a/tasks/0067_062_67062935_qa_2/task.toml +++ b/tasks/0067_062_67062935_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_076_67076892_qa_3/environment/bootstrap.sh b/tasks/0067_076_67076892_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_076_67076892_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_076_67076892_qa_3/environment/pull_bucket.py b/tasks/0067_076_67076892_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_076_67076892_qa_3/environment/pull_bucket.py +++ b/tasks/0067_076_67076892_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_076_67076892_qa_3/task.toml b/tasks/0067_076_67076892_qa_3/task.toml index 0a3616504b0b820157daaed11c28d901f7613271..3c8ecef04d106779b4937a5df3cbc98b1a6a8e19 100644 --- a/tasks/0067_076_67076892_qa_3/task.toml +++ b/tasks/0067_076_67076892_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_113_67113701_qa_3/environment/bootstrap.sh b/tasks/0067_113_67113701_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_113_67113701_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_113_67113701_qa_3/environment/pull_bucket.py b/tasks/0067_113_67113701_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_113_67113701_qa_3/environment/pull_bucket.py +++ b/tasks/0067_113_67113701_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_113_67113701_qa_3/task.toml b/tasks/0067_113_67113701_qa_3/task.toml index 69b769a75b3128852bd0052fd8389bde1fa597ad..0d616d7d244fbb6be9be6abd6abd90525dc8619e 100644 --- a/tasks/0067_113_67113701_qa_3/task.toml +++ b/tasks/0067_113_67113701_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_113_67113701_qa_4/environment/bootstrap.sh b/tasks/0067_113_67113701_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_113_67113701_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_113_67113701_qa_4/environment/pull_bucket.py b/tasks/0067_113_67113701_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_113_67113701_qa_4/environment/pull_bucket.py +++ b/tasks/0067_113_67113701_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_113_67113701_qa_4/task.toml b/tasks/0067_113_67113701_qa_4/task.toml index 23ef8e8315536507b347aa36b6a2b59c622a64c7..0c9830e5b466f0f0b3b2285871765840b51ddd58 100644 --- a/tasks/0067_113_67113701_qa_4/task.toml +++ b/tasks/0067_113_67113701_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_118_67118977_qa_5/environment/bootstrap.sh b/tasks/0067_118_67118977_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_118_67118977_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_118_67118977_qa_5/environment/pull_bucket.py b/tasks/0067_118_67118977_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_118_67118977_qa_5/environment/pull_bucket.py +++ b/tasks/0067_118_67118977_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_118_67118977_qa_5/task.toml b/tasks/0067_118_67118977_qa_5/task.toml index 28fde426d6a5c13f5538ed90cb13363d46a62860..29159d8ccef6363aaa84826c572b33172bd6d27d 100644 --- a/tasks/0067_118_67118977_qa_5/task.toml +++ b/tasks/0067_118_67118977_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_225_67225548_qa_5/environment/bootstrap.sh b/tasks/0067_225_67225548_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_225_67225548_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_225_67225548_qa_5/environment/pull_bucket.py b/tasks/0067_225_67225548_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_225_67225548_qa_5/environment/pull_bucket.py +++ b/tasks/0067_225_67225548_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_225_67225548_qa_5/task.toml b/tasks/0067_225_67225548_qa_5/task.toml index cee9b9a94bf1ae8ca6b3b893238f6ad7f3aa0507..0a2385eb271ed3e5f70c4f2a1e08537af23f3a33 100644 --- a/tasks/0067_225_67225548_qa_5/task.toml +++ b/tasks/0067_225_67225548_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_241_67241146_qa_2/environment/bootstrap.sh b/tasks/0067_241_67241146_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_241_67241146_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_241_67241146_qa_2/environment/pull_bucket.py b/tasks/0067_241_67241146_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_241_67241146_qa_2/environment/pull_bucket.py +++ b/tasks/0067_241_67241146_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_241_67241146_qa_2/task.toml b/tasks/0067_241_67241146_qa_2/task.toml index 5037c4724082de8fdc5e73f766ec1f9863ebe96c..f6df10bbff7f43161148d47ce839519fa02ae413 100644 --- a/tasks/0067_241_67241146_qa_2/task.toml +++ b/tasks/0067_241_67241146_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_247_67247951_qa_2/environment/bootstrap.sh b/tasks/0067_247_67247951_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_247_67247951_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_247_67247951_qa_2/environment/pull_bucket.py b/tasks/0067_247_67247951_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_247_67247951_qa_2/environment/pull_bucket.py +++ b/tasks/0067_247_67247951_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_247_67247951_qa_2/task.toml b/tasks/0067_247_67247951_qa_2/task.toml index e0ea7be6e40d55d354b19575dece562d7f8da495..7690548e17c0eebc05eb40ce8f15d739a6422900 100644 --- a/tasks/0067_247_67247951_qa_2/task.toml +++ b/tasks/0067_247_67247951_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_290_67290658_qa_1/environment/bootstrap.sh b/tasks/0067_290_67290658_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_290_67290658_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_290_67290658_qa_1/environment/pull_bucket.py b/tasks/0067_290_67290658_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_290_67290658_qa_1/environment/pull_bucket.py +++ b/tasks/0067_290_67290658_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_290_67290658_qa_1/task.toml b/tasks/0067_290_67290658_qa_1/task.toml index bc595352fe3c541b6a1125e141382197fcdf6962..8f857ecf473c077e882b7c920129ace4e93b0b2b 100644 --- a/tasks/0067_290_67290658_qa_1/task.toml +++ b/tasks/0067_290_67290658_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_414_67414974_qa_3/environment/bootstrap.sh b/tasks/0067_414_67414974_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_414_67414974_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_414_67414974_qa_3/environment/pull_bucket.py b/tasks/0067_414_67414974_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_414_67414974_qa_3/environment/pull_bucket.py +++ b/tasks/0067_414_67414974_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_414_67414974_qa_3/task.toml b/tasks/0067_414_67414974_qa_3/task.toml index c5d9dfbcc600d56515ebde9e9c4a6351b7379430..241c2a1e09cea690684b7abef42fe5e31cd1bead 100644 --- a/tasks/0067_414_67414974_qa_3/task.toml +++ b/tasks/0067_414_67414974_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_414_67414974_qa_5/environment/bootstrap.sh b/tasks/0067_414_67414974_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_414_67414974_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_414_67414974_qa_5/environment/pull_bucket.py b/tasks/0067_414_67414974_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_414_67414974_qa_5/environment/pull_bucket.py +++ b/tasks/0067_414_67414974_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_414_67414974_qa_5/task.toml b/tasks/0067_414_67414974_qa_5/task.toml index 9eab74b117a58ed3a7497bd1d18744555880dde8..3636669227fb49646a1f42cb477fd3532b21e4d9 100644 --- a/tasks/0067_414_67414974_qa_5/task.toml +++ b/tasks/0067_414_67414974_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_446_67446851_qa_1/environment/bootstrap.sh b/tasks/0067_446_67446851_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_446_67446851_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_446_67446851_qa_1/environment/pull_bucket.py b/tasks/0067_446_67446851_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_446_67446851_qa_1/environment/pull_bucket.py +++ b/tasks/0067_446_67446851_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_446_67446851_qa_1/task.toml b/tasks/0067_446_67446851_qa_1/task.toml index df511b832a170a92093dcc66014628a496d3205d..caa3bfba7b5819ec4ab62eb9c996b1a0311b0cf0 100644 --- a/tasks/0067_446_67446851_qa_1/task.toml +++ b/tasks/0067_446_67446851_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_450_67450009_qa_1/environment/bootstrap.sh b/tasks/0067_450_67450009_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_450_67450009_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_450_67450009_qa_1/environment/pull_bucket.py b/tasks/0067_450_67450009_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_450_67450009_qa_1/environment/pull_bucket.py +++ b/tasks/0067_450_67450009_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_450_67450009_qa_1/task.toml b/tasks/0067_450_67450009_qa_1/task.toml index cc5dea6a4ff4eb3d985fc9060fa9b136a227fed0..e630b9fb3555609a235236e724450a9005af5811 100644 --- a/tasks/0067_450_67450009_qa_1/task.toml +++ b/tasks/0067_450_67450009_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_454_67454343_qa_5/environment/bootstrap.sh b/tasks/0067_454_67454343_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_454_67454343_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_454_67454343_qa_5/environment/pull_bucket.py b/tasks/0067_454_67454343_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_454_67454343_qa_5/environment/pull_bucket.py +++ b/tasks/0067_454_67454343_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_454_67454343_qa_5/task.toml b/tasks/0067_454_67454343_qa_5/task.toml index 1b1afefde87f26523267f86ff418b006478bf762..e9aa300978074f7569d2300fff04e34cb55cdcca 100644 --- a/tasks/0067_454_67454343_qa_5/task.toml +++ b/tasks/0067_454_67454343_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_485_67485254_qa_4/environment/bootstrap.sh b/tasks/0067_485_67485254_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_485_67485254_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_485_67485254_qa_4/environment/pull_bucket.py b/tasks/0067_485_67485254_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_485_67485254_qa_4/environment/pull_bucket.py +++ b/tasks/0067_485_67485254_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_485_67485254_qa_4/task.toml b/tasks/0067_485_67485254_qa_4/task.toml index 9f3c0a9a2d628e2943205595761bebf04087caae..0fb52a683a6f6c6f774091acacf9d47ac6f86206 100644 --- a/tasks/0067_485_67485254_qa_4/task.toml +++ b/tasks/0067_485_67485254_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_487_67487894_qa_4/environment/bootstrap.sh b/tasks/0067_487_67487894_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_487_67487894_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_487_67487894_qa_4/environment/pull_bucket.py b/tasks/0067_487_67487894_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_487_67487894_qa_4/environment/pull_bucket.py +++ b/tasks/0067_487_67487894_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_487_67487894_qa_4/task.toml b/tasks/0067_487_67487894_qa_4/task.toml index 07681fcd8eba9e3964e8a2f521ae2e876a8903c6..5c62853c77505b333384e9389431e18783f77d82 100644 --- a/tasks/0067_487_67487894_qa_4/task.toml +++ b/tasks/0067_487_67487894_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_489_67489322_qa_4/environment/bootstrap.sh b/tasks/0067_489_67489322_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_489_67489322_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_489_67489322_qa_4/environment/pull_bucket.py b/tasks/0067_489_67489322_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_489_67489322_qa_4/environment/pull_bucket.py +++ b/tasks/0067_489_67489322_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_489_67489322_qa_4/task.toml b/tasks/0067_489_67489322_qa_4/task.toml index 96b4aaef998de0a08dd7457faaf56a96699aa3be..b5bde5dd93fd4d48fc44a1825447d4f3f09644a6 100644 --- a/tasks/0067_489_67489322_qa_4/task.toml +++ b/tasks/0067_489_67489322_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_492_67492049_qa_2/environment/bootstrap.sh b/tasks/0067_492_67492049_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_492_67492049_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_492_67492049_qa_2/environment/pull_bucket.py b/tasks/0067_492_67492049_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_492_67492049_qa_2/environment/pull_bucket.py +++ b/tasks/0067_492_67492049_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_492_67492049_qa_2/task.toml b/tasks/0067_492_67492049_qa_2/task.toml index 448a6fba2db72ec31bfabb71758849355aa1f39c..120c2b9fd2d4a8baac606e1291dffa5cba2850e2 100644 --- a/tasks/0067_492_67492049_qa_2/task.toml +++ b/tasks/0067_492_67492049_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_492_67492049_qa_4/environment/bootstrap.sh b/tasks/0067_492_67492049_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_492_67492049_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_492_67492049_qa_4/environment/pull_bucket.py b/tasks/0067_492_67492049_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_492_67492049_qa_4/environment/pull_bucket.py +++ b/tasks/0067_492_67492049_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_492_67492049_qa_4/task.toml b/tasks/0067_492_67492049_qa_4/task.toml index 5b0ad6e2f3868cadcd335d4daacefab718d792ff..f0846e5322c853f2b8d3cd7e5dff01500f77a9bf 100644 --- a/tasks/0067_492_67492049_qa_4/task.toml +++ b/tasks/0067_492_67492049_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_511_67511593_qa_2/environment/bootstrap.sh b/tasks/0067_511_67511593_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_511_67511593_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_511_67511593_qa_2/environment/pull_bucket.py b/tasks/0067_511_67511593_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_511_67511593_qa_2/environment/pull_bucket.py +++ b/tasks/0067_511_67511593_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_511_67511593_qa_2/task.toml b/tasks/0067_511_67511593_qa_2/task.toml index 87795daefd2a9cbc41f6cd7a24d69a5b595b6cca..98ab5d7120313e676065aa925485e060a51f66b8 100644 --- a/tasks/0067_511_67511593_qa_2/task.toml +++ b/tasks/0067_511_67511593_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_522_67522470_qa_4/environment/bootstrap.sh b/tasks/0067_522_67522470_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_522_67522470_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_522_67522470_qa_4/environment/pull_bucket.py b/tasks/0067_522_67522470_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_522_67522470_qa_4/environment/pull_bucket.py +++ b/tasks/0067_522_67522470_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_522_67522470_qa_4/task.toml b/tasks/0067_522_67522470_qa_4/task.toml index 53f7aae68fbbb48d19ed5347950a026cc23fc15d..39edb4b557c185dd7c6b11db0fa51a987ae5df54 100644 --- a/tasks/0067_522_67522470_qa_4/task.toml +++ b/tasks/0067_522_67522470_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_551_67551965_qa_4/environment/bootstrap.sh b/tasks/0067_551_67551965_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_551_67551965_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_551_67551965_qa_4/environment/pull_bucket.py b/tasks/0067_551_67551965_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_551_67551965_qa_4/environment/pull_bucket.py +++ b/tasks/0067_551_67551965_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_551_67551965_qa_4/task.toml b/tasks/0067_551_67551965_qa_4/task.toml index cc27d11e37f0f35bb05add5086a848c7466d9496..533dbb96b5ca95c32470e4c58d38cca3131179d0 100644 --- a/tasks/0067_551_67551965_qa_4/task.toml +++ b/tasks/0067_551_67551965_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_607_67607384_qa_1/environment/bootstrap.sh b/tasks/0067_607_67607384_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_607_67607384_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_607_67607384_qa_1/environment/pull_bucket.py b/tasks/0067_607_67607384_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_607_67607384_qa_1/environment/pull_bucket.py +++ b/tasks/0067_607_67607384_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_607_67607384_qa_1/task.toml b/tasks/0067_607_67607384_qa_1/task.toml index 992034efc43d04f4769a79ebc27813944a135692..d27353acc1bbc4b3cd3dd025327fb0f4911d2a5c 100644 --- a/tasks/0067_607_67607384_qa_1/task.toml +++ b/tasks/0067_607_67607384_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_607_67607384_qa_3/environment/bootstrap.sh b/tasks/0067_607_67607384_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_607_67607384_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_607_67607384_qa_3/environment/pull_bucket.py b/tasks/0067_607_67607384_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_607_67607384_qa_3/environment/pull_bucket.py +++ b/tasks/0067_607_67607384_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_607_67607384_qa_3/task.toml b/tasks/0067_607_67607384_qa_3/task.toml index 37da5db1304107559909482454a3ba6fe8a84ce1..0be5db68f47968bd38b132fbd784d3c8f188efe4 100644 --- a/tasks/0067_607_67607384_qa_3/task.toml +++ b/tasks/0067_607_67607384_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_607_67607384_qa_4/environment/bootstrap.sh b/tasks/0067_607_67607384_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_607_67607384_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_607_67607384_qa_4/environment/pull_bucket.py b/tasks/0067_607_67607384_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_607_67607384_qa_4/environment/pull_bucket.py +++ b/tasks/0067_607_67607384_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_607_67607384_qa_4/task.toml b/tasks/0067_607_67607384_qa_4/task.toml index 045a9c5172577363bffc27e8473ba5c9546a0883..2a40b4f6b611b9cdc1fb158e5677eee94268a007 100644 --- a/tasks/0067_607_67607384_qa_4/task.toml +++ b/tasks/0067_607_67607384_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_633_67633156_qa_3/environment/bootstrap.sh b/tasks/0067_633_67633156_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_633_67633156_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_633_67633156_qa_3/environment/pull_bucket.py b/tasks/0067_633_67633156_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_633_67633156_qa_3/environment/pull_bucket.py +++ b/tasks/0067_633_67633156_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_633_67633156_qa_3/task.toml b/tasks/0067_633_67633156_qa_3/task.toml index d84ab46b8b98d54666efc65ce084151f11f711c5..04b8addc0af0ef63a12b739773a1ca72a36cd12b 100644 --- a/tasks/0067_633_67633156_qa_3/task.toml +++ b/tasks/0067_633_67633156_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_644_67644328_qa_4/environment/bootstrap.sh b/tasks/0067_644_67644328_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_644_67644328_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_644_67644328_qa_4/environment/pull_bucket.py b/tasks/0067_644_67644328_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_644_67644328_qa_4/environment/pull_bucket.py +++ b/tasks/0067_644_67644328_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_644_67644328_qa_4/task.toml b/tasks/0067_644_67644328_qa_4/task.toml index ffac21714b8d8770c632ade42e0dcd5b73105540..679552722282ce45f3681e94e80c11dbdde36070 100644 --- a/tasks/0067_644_67644328_qa_4/task.toml +++ b/tasks/0067_644_67644328_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_657_67657879_qa_3/environment/bootstrap.sh b/tasks/0067_657_67657879_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_657_67657879_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_657_67657879_qa_3/environment/pull_bucket.py b/tasks/0067_657_67657879_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_657_67657879_qa_3/environment/pull_bucket.py +++ b/tasks/0067_657_67657879_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_657_67657879_qa_3/task.toml b/tasks/0067_657_67657879_qa_3/task.toml index b0b4edee05fdf099fb2cfe786375f94bcb0834a0..2c866e8bfa06e5e13ae1036b915017a0e6f9087a 100644 --- a/tasks/0067_657_67657879_qa_3/task.toml +++ b/tasks/0067_657_67657879_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_657_67657879_qa_5/environment/bootstrap.sh b/tasks/0067_657_67657879_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_657_67657879_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_657_67657879_qa_5/environment/pull_bucket.py b/tasks/0067_657_67657879_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_657_67657879_qa_5/environment/pull_bucket.py +++ b/tasks/0067_657_67657879_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_657_67657879_qa_5/task.toml b/tasks/0067_657_67657879_qa_5/task.toml index 91e0cbd8ebaa1f08aa2c82d8b2d30de11bd67717..67bd47999fa08398903fb61b88e257ea8ab60b31 100644 --- a/tasks/0067_657_67657879_qa_5/task.toml +++ b/tasks/0067_657_67657879_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_675_67675814_qa_2/environment/bootstrap.sh b/tasks/0067_675_67675814_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_675_67675814_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_675_67675814_qa_2/environment/pull_bucket.py b/tasks/0067_675_67675814_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_675_67675814_qa_2/environment/pull_bucket.py +++ b/tasks/0067_675_67675814_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_675_67675814_qa_2/task.toml b/tasks/0067_675_67675814_qa_2/task.toml index e5b424efcbb78c36fa8bb11548590f697f5a6dda..36ea6091b18c9c46077a422c7919c198bef23d54 100644 --- a/tasks/0067_675_67675814_qa_2/task.toml +++ b/tasks/0067_675_67675814_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_675_67675814_qa_5/environment/bootstrap.sh b/tasks/0067_675_67675814_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_675_67675814_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_675_67675814_qa_5/environment/pull_bucket.py b/tasks/0067_675_67675814_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_675_67675814_qa_5/environment/pull_bucket.py +++ b/tasks/0067_675_67675814_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_675_67675814_qa_5/task.toml b/tasks/0067_675_67675814_qa_5/task.toml index 969fda950963c3aae5d83bfd26f811345149cb5e..3eb66c8cc53cf5d81b0efb14b1479106fe30026c 100644 --- a/tasks/0067_675_67675814_qa_5/task.toml +++ b/tasks/0067_675_67675814_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_729_67729269_qa_3/environment/bootstrap.sh b/tasks/0067_729_67729269_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_729_67729269_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_729_67729269_qa_3/environment/pull_bucket.py b/tasks/0067_729_67729269_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_729_67729269_qa_3/environment/pull_bucket.py +++ b/tasks/0067_729_67729269_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_729_67729269_qa_3/task.toml b/tasks/0067_729_67729269_qa_3/task.toml index 8751f5e0de214eb12b3542455147666f0ee82c77..1b3aaffdae592ddc9b4422c34a8ed8d58c8ce1d4 100644 --- a/tasks/0067_729_67729269_qa_3/task.toml +++ b/tasks/0067_729_67729269_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_729_67729269_qa_4/environment/bootstrap.sh b/tasks/0067_729_67729269_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_729_67729269_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_729_67729269_qa_4/environment/pull_bucket.py b/tasks/0067_729_67729269_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_729_67729269_qa_4/environment/pull_bucket.py +++ b/tasks/0067_729_67729269_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_729_67729269_qa_4/task.toml b/tasks/0067_729_67729269_qa_4/task.toml index 7a53ae18ae65709e18fce49f0281e95cba0b79e6..217c96779a8d8837ab366ef9582b60259417ab8c 100644 --- a/tasks/0067_729_67729269_qa_4/task.toml +++ b/tasks/0067_729_67729269_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_734_67734656_qa_3/environment/bootstrap.sh b/tasks/0067_734_67734656_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_734_67734656_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_734_67734656_qa_3/environment/pull_bucket.py b/tasks/0067_734_67734656_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_734_67734656_qa_3/environment/pull_bucket.py +++ b/tasks/0067_734_67734656_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_734_67734656_qa_3/task.toml b/tasks/0067_734_67734656_qa_3/task.toml index 37b678fe02482f4d28bd895717dd4e378b8a358e..699b40be16590cb7519c96e711865f9dac16dcdb 100644 --- a/tasks/0067_734_67734656_qa_3/task.toml +++ b/tasks/0067_734_67734656_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_744_67744711_qa_4/environment/bootstrap.sh b/tasks/0067_744_67744711_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_744_67744711_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_744_67744711_qa_4/environment/pull_bucket.py b/tasks/0067_744_67744711_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_744_67744711_qa_4/environment/pull_bucket.py +++ b/tasks/0067_744_67744711_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_744_67744711_qa_4/task.toml b/tasks/0067_744_67744711_qa_4/task.toml index acfbf49b85db1d072770a462a08f839bc0d07e3d..e04b6440d437516fc18d0fde38b66ffd25582403 100644 --- a/tasks/0067_744_67744711_qa_4/task.toml +++ b/tasks/0067_744_67744711_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_804_67804108_qa_5/environment/bootstrap.sh b/tasks/0067_804_67804108_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_804_67804108_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_804_67804108_qa_5/environment/pull_bucket.py b/tasks/0067_804_67804108_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_804_67804108_qa_5/environment/pull_bucket.py +++ b/tasks/0067_804_67804108_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_804_67804108_qa_5/task.toml b/tasks/0067_804_67804108_qa_5/task.toml index 575bf1acfe8667fa723195a9440a806a4568dc2a..4e392d9fafeea3715bc3be07ceb77f8e1600f64d 100644 --- a/tasks/0067_804_67804108_qa_5/task.toml +++ b/tasks/0067_804_67804108_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_856_67856541_qa_2/environment/bootstrap.sh b/tasks/0067_856_67856541_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_856_67856541_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_856_67856541_qa_2/environment/pull_bucket.py b/tasks/0067_856_67856541_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_856_67856541_qa_2/environment/pull_bucket.py +++ b/tasks/0067_856_67856541_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_856_67856541_qa_2/task.toml b/tasks/0067_856_67856541_qa_2/task.toml index 5ae204a0dc584b2d63fa9bd99d6460fd3efe453d..abc94884ed885d7f34d7a77650b22eb8b077b5ad 100644 --- a/tasks/0067_856_67856541_qa_2/task.toml +++ b/tasks/0067_856_67856541_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_857_67857075_qa_4/environment/bootstrap.sh b/tasks/0067_857_67857075_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_857_67857075_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_857_67857075_qa_4/environment/pull_bucket.py b/tasks/0067_857_67857075_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_857_67857075_qa_4/environment/pull_bucket.py +++ b/tasks/0067_857_67857075_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_857_67857075_qa_4/task.toml b/tasks/0067_857_67857075_qa_4/task.toml index e6827ba83f11a681ac225be6cc74902b3b6d44d6..bdfd86b4267fd8b1e5be1d33f572b0de80809ce4 100644 --- a/tasks/0067_857_67857075_qa_4/task.toml +++ b/tasks/0067_857_67857075_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_857_67857075_qa_5/environment/bootstrap.sh b/tasks/0067_857_67857075_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_857_67857075_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_857_67857075_qa_5/environment/pull_bucket.py b/tasks/0067_857_67857075_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_857_67857075_qa_5/environment/pull_bucket.py +++ b/tasks/0067_857_67857075_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_857_67857075_qa_5/task.toml b/tasks/0067_857_67857075_qa_5/task.toml index f586f57a15cf1e2f5a44abcac6d5457e7813b593..14a4c7b678189008beaca76918be54492885fa6b 100644 --- a/tasks/0067_857_67857075_qa_5/task.toml +++ b/tasks/0067_857_67857075_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_871_67871105_qa_2/environment/bootstrap.sh b/tasks/0067_871_67871105_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_871_67871105_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_871_67871105_qa_2/environment/pull_bucket.py b/tasks/0067_871_67871105_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_871_67871105_qa_2/environment/pull_bucket.py +++ b/tasks/0067_871_67871105_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_871_67871105_qa_2/task.toml b/tasks/0067_871_67871105_qa_2/task.toml index dd67fa0bf5de88c571ec97d009540529a8eef698..ec6ab6ec40e6a3f9c6c3b443adc2bcfd0416bf91 100644 --- a/tasks/0067_871_67871105_qa_2/task.toml +++ b/tasks/0067_871_67871105_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_871_67871105_qa_4/environment/bootstrap.sh b/tasks/0067_871_67871105_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_871_67871105_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_871_67871105_qa_4/environment/pull_bucket.py b/tasks/0067_871_67871105_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_871_67871105_qa_4/environment/pull_bucket.py +++ b/tasks/0067_871_67871105_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_871_67871105_qa_4/task.toml b/tasks/0067_871_67871105_qa_4/task.toml index 9f6e86c10cc3a1a0201f7528568a80364579fdbf..15e068883658dd2eca9f87bcc66fba07914a519f 100644 --- a/tasks/0067_871_67871105_qa_4/task.toml +++ b/tasks/0067_871_67871105_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_871_67871105_qa_5/environment/bootstrap.sh b/tasks/0067_871_67871105_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_871_67871105_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_871_67871105_qa_5/environment/pull_bucket.py b/tasks/0067_871_67871105_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_871_67871105_qa_5/environment/pull_bucket.py +++ b/tasks/0067_871_67871105_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_871_67871105_qa_5/task.toml b/tasks/0067_871_67871105_qa_5/task.toml index 9fd3ce47d4b2dc205f3f72672be8052acc880ca0..6f40428ff2752675716918f2ed25dc53eb877e7b 100644 --- a/tasks/0067_871_67871105_qa_5/task.toml +++ b/tasks/0067_871_67871105_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_912_67912130_qa_1/environment/bootstrap.sh b/tasks/0067_912_67912130_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_912_67912130_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_912_67912130_qa_1/environment/pull_bucket.py b/tasks/0067_912_67912130_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_912_67912130_qa_1/environment/pull_bucket.py +++ b/tasks/0067_912_67912130_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_912_67912130_qa_1/task.toml b/tasks/0067_912_67912130_qa_1/task.toml index 27bbf1841f72c631968fece4ce01750b32108e2f..b8db1bc623f5c626f5287355b79cfe2dfe37540e 100644 --- a/tasks/0067_912_67912130_qa_1/task.toml +++ b/tasks/0067_912_67912130_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_912_67912130_qa_4/environment/bootstrap.sh b/tasks/0067_912_67912130_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_912_67912130_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_912_67912130_qa_4/environment/pull_bucket.py b/tasks/0067_912_67912130_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_912_67912130_qa_4/environment/pull_bucket.py +++ b/tasks/0067_912_67912130_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_912_67912130_qa_4/task.toml b/tasks/0067_912_67912130_qa_4/task.toml index 8e2059a4d17d9ca9c5f0534bf566777dfa5d2714..b8b268582e9077c5f0fd4ae9d7503a8566f787ad 100644 --- a/tasks/0067_912_67912130_qa_4/task.toml +++ b/tasks/0067_912_67912130_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_933_67933757_qa_4/environment/bootstrap.sh b/tasks/0067_933_67933757_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_933_67933757_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_933_67933757_qa_4/environment/pull_bucket.py b/tasks/0067_933_67933757_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_933_67933757_qa_4/environment/pull_bucket.py +++ b/tasks/0067_933_67933757_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_933_67933757_qa_4/task.toml b/tasks/0067_933_67933757_qa_4/task.toml index d7129af44d1231b6f42b71b2bb39ee4ff69ae7a7..eaa93c7c3c7ee181650fa92056b7649b62538dcd 100644 --- a/tasks/0067_933_67933757_qa_4/task.toml +++ b/tasks/0067_933_67933757_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_958_67958597_qa_5/environment/bootstrap.sh b/tasks/0067_958_67958597_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_958_67958597_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_958_67958597_qa_5/environment/pull_bucket.py b/tasks/0067_958_67958597_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_958_67958597_qa_5/environment/pull_bucket.py +++ b/tasks/0067_958_67958597_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_958_67958597_qa_5/task.toml b/tasks/0067_958_67958597_qa_5/task.toml index 36bafd6183ab9385f09b6f18fd77bcd694382f1e..b8913521af7d9e9ade8bfceec1e33d2d918bf517 100644 --- a/tasks/0067_958_67958597_qa_5/task.toml +++ b/tasks/0067_958_67958597_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_963_67963469_qa_3/environment/bootstrap.sh b/tasks/0067_963_67963469_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_963_67963469_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_963_67963469_qa_3/environment/pull_bucket.py b/tasks/0067_963_67963469_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_963_67963469_qa_3/environment/pull_bucket.py +++ b/tasks/0067_963_67963469_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_963_67963469_qa_3/task.toml b/tasks/0067_963_67963469_qa_3/task.toml index ec454f0e26c6e67808cac3585d5d1022b88dcbf9..19a092f09609e5a1255425c1b21ceafab1e7dee8 100644 --- a/tasks/0067_963_67963469_qa_3/task.toml +++ b/tasks/0067_963_67963469_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_990_67990197_qa_1/environment/bootstrap.sh b/tasks/0067_990_67990197_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_990_67990197_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_990_67990197_qa_1/environment/pull_bucket.py b/tasks/0067_990_67990197_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_990_67990197_qa_1/environment/pull_bucket.py +++ b/tasks/0067_990_67990197_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_990_67990197_qa_1/task.toml b/tasks/0067_990_67990197_qa_1/task.toml index ca83acb3c5c00fc7c4fba9e8852b0995b157c3f2..cab1161e3896ab439d2bddda0ec7739d09ad744d 100644 --- a/tasks/0067_990_67990197_qa_1/task.toml +++ b/tasks/0067_990_67990197_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_990_67990197_qa_2/environment/bootstrap.sh b/tasks/0067_990_67990197_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_990_67990197_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_990_67990197_qa_2/environment/pull_bucket.py b/tasks/0067_990_67990197_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_990_67990197_qa_2/environment/pull_bucket.py +++ b/tasks/0067_990_67990197_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_990_67990197_qa_2/task.toml b/tasks/0067_990_67990197_qa_2/task.toml index 5d38757740ef444b0d2a3fa81c0466d15955c14a..7c9e04da34ecaeca87f787434577d5dcf50ce60e 100644 --- a/tasks/0067_990_67990197_qa_2/task.toml +++ b/tasks/0067_990_67990197_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_990_67990197_qa_3/environment/bootstrap.sh b/tasks/0067_990_67990197_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_990_67990197_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_990_67990197_qa_3/environment/pull_bucket.py b/tasks/0067_990_67990197_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_990_67990197_qa_3/environment/pull_bucket.py +++ b/tasks/0067_990_67990197_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_990_67990197_qa_3/task.toml b/tasks/0067_990_67990197_qa_3/task.toml index e70ee5f9d73027b7850e5f01733d96847def0f24..eb01dd30ffc39adba99b702f7f20abf149d7f507 100644 --- a/tasks/0067_990_67990197_qa_3/task.toml +++ b/tasks/0067_990_67990197_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0067_990_67990197_qa_4/environment/bootstrap.sh b/tasks/0067_990_67990197_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0067_990_67990197_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0067_990_67990197_qa_4/environment/pull_bucket.py b/tasks/0067_990_67990197_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0067_990_67990197_qa_4/environment/pull_bucket.py +++ b/tasks/0067_990_67990197_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0067_990_67990197_qa_4/task.toml b/tasks/0067_990_67990197_qa_4/task.toml index e3ea4004b462b3610a7838cbbe422c799ea25d21..2e8c6ffc3177daea9f3c336027fedd54891d84a6 100644 --- a/tasks/0067_990_67990197_qa_4/task.toml +++ b/tasks/0067_990_67990197_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_009_68009679_qa_1/environment/bootstrap.sh b/tasks/0068_009_68009679_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_009_68009679_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_009_68009679_qa_1/environment/pull_bucket.py b/tasks/0068_009_68009679_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_009_68009679_qa_1/environment/pull_bucket.py +++ b/tasks/0068_009_68009679_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_009_68009679_qa_1/task.toml b/tasks/0068_009_68009679_qa_1/task.toml index 2e9ca73b2b0561b2b72672f013484b9ff8d85106..13e08ce17e1be8a1e31b3db7550944cabb286f1d 100644 --- a/tasks/0068_009_68009679_qa_1/task.toml +++ b/tasks/0068_009_68009679_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_009_68009679_qa_2/environment/bootstrap.sh b/tasks/0068_009_68009679_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_009_68009679_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_009_68009679_qa_2/environment/pull_bucket.py b/tasks/0068_009_68009679_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_009_68009679_qa_2/environment/pull_bucket.py +++ b/tasks/0068_009_68009679_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_009_68009679_qa_2/task.toml b/tasks/0068_009_68009679_qa_2/task.toml index 60815c4b09dc178cc6dbde4d411390bb40253340..5042b175de603e30773af9c1c3f76e2d5426670d 100644 --- a/tasks/0068_009_68009679_qa_2/task.toml +++ b/tasks/0068_009_68009679_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_022_68022478_qa_1/environment/bootstrap.sh b/tasks/0068_022_68022478_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_022_68022478_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_022_68022478_qa_1/environment/pull_bucket.py b/tasks/0068_022_68022478_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_022_68022478_qa_1/environment/pull_bucket.py +++ b/tasks/0068_022_68022478_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_022_68022478_qa_1/task.toml b/tasks/0068_022_68022478_qa_1/task.toml index 18ca8bdf380847ca7b6364d01db45d7c274f824f..77517e3b6eccc4f568c19b2f2611dfbd82ca9a7e 100644 --- a/tasks/0068_022_68022478_qa_1/task.toml +++ b/tasks/0068_022_68022478_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_022_68022478_qa_2/environment/bootstrap.sh b/tasks/0068_022_68022478_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_022_68022478_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_022_68022478_qa_2/environment/pull_bucket.py b/tasks/0068_022_68022478_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_022_68022478_qa_2/environment/pull_bucket.py +++ b/tasks/0068_022_68022478_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_022_68022478_qa_2/task.toml b/tasks/0068_022_68022478_qa_2/task.toml index 88ea7cb2e663b40df34f5587989bbd6e30b12341..e45df2f9ff854a7555dc558be8b0df467b823ffb 100644 --- a/tasks/0068_022_68022478_qa_2/task.toml +++ b/tasks/0068_022_68022478_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_041_68041367_qa_2/environment/bootstrap.sh b/tasks/0068_041_68041367_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_041_68041367_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_041_68041367_qa_2/environment/pull_bucket.py b/tasks/0068_041_68041367_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_041_68041367_qa_2/environment/pull_bucket.py +++ b/tasks/0068_041_68041367_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_041_68041367_qa_2/task.toml b/tasks/0068_041_68041367_qa_2/task.toml index d4f85074350864748ab08855b78449a0f7a4595f..88ec22af28cbd0223e16698e2e2aec725d3d55de 100644 --- a/tasks/0068_041_68041367_qa_2/task.toml +++ b/tasks/0068_041_68041367_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_041_68041367_qa_5/environment/bootstrap.sh b/tasks/0068_041_68041367_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_041_68041367_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_041_68041367_qa_5/environment/pull_bucket.py b/tasks/0068_041_68041367_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_041_68041367_qa_5/environment/pull_bucket.py +++ b/tasks/0068_041_68041367_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_041_68041367_qa_5/task.toml b/tasks/0068_041_68041367_qa_5/task.toml index 3afc3d6aee1e60a5cbda1f428cbecb1096b8e056..cc51570c372397f249506cddd1c090f88da03c26 100644 --- a/tasks/0068_041_68041367_qa_5/task.toml +++ b/tasks/0068_041_68041367_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_060_68060356_qa_4/environment/bootstrap.sh b/tasks/0068_060_68060356_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_060_68060356_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_060_68060356_qa_4/environment/pull_bucket.py b/tasks/0068_060_68060356_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_060_68060356_qa_4/environment/pull_bucket.py +++ b/tasks/0068_060_68060356_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_060_68060356_qa_4/task.toml b/tasks/0068_060_68060356_qa_4/task.toml index b8d3691a381c2a13c05c13a2901e151a623c5b53..4237dbcc5952e7fc518fdeeebafba51e0e5bbae7 100644 --- a/tasks/0068_060_68060356_qa_4/task.toml +++ b/tasks/0068_060_68060356_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_069_68069772_qa_5/environment/bootstrap.sh b/tasks/0068_069_68069772_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_069_68069772_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_069_68069772_qa_5/environment/pull_bucket.py b/tasks/0068_069_68069772_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_069_68069772_qa_5/environment/pull_bucket.py +++ b/tasks/0068_069_68069772_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_069_68069772_qa_5/task.toml b/tasks/0068_069_68069772_qa_5/task.toml index 755b0404fe714cc26350272d4fe49c1587ab6a5b..9005530d69624fd4d83b653215efa378a21ba694 100644 --- a/tasks/0068_069_68069772_qa_5/task.toml +++ b/tasks/0068_069_68069772_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_074_68074529_qa_4/environment/bootstrap.sh b/tasks/0068_074_68074529_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_074_68074529_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_074_68074529_qa_4/environment/pull_bucket.py b/tasks/0068_074_68074529_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_074_68074529_qa_4/environment/pull_bucket.py +++ b/tasks/0068_074_68074529_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_074_68074529_qa_4/task.toml b/tasks/0068_074_68074529_qa_4/task.toml index 11d2a3f567aad31996afc453af3f438c1c270393..3042213027a5f816cad558388798071104544f5e 100644 --- a/tasks/0068_074_68074529_qa_4/task.toml +++ b/tasks/0068_074_68074529_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_074_68074529_qa_5/environment/bootstrap.sh b/tasks/0068_074_68074529_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_074_68074529_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_074_68074529_qa_5/environment/pull_bucket.py b/tasks/0068_074_68074529_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_074_68074529_qa_5/environment/pull_bucket.py +++ b/tasks/0068_074_68074529_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_074_68074529_qa_5/task.toml b/tasks/0068_074_68074529_qa_5/task.toml index 56a633773a7b7879ec6f0a85fb9fa2b22349ec03..4852650402da5ff2d873bbea7ee7f99cb2da851f 100644 --- a/tasks/0068_074_68074529_qa_5/task.toml +++ b/tasks/0068_074_68074529_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_079_68079868_qa_1/environment/bootstrap.sh b/tasks/0068_079_68079868_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_079_68079868_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_079_68079868_qa_1/environment/pull_bucket.py b/tasks/0068_079_68079868_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_079_68079868_qa_1/environment/pull_bucket.py +++ b/tasks/0068_079_68079868_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_079_68079868_qa_1/task.toml b/tasks/0068_079_68079868_qa_1/task.toml index e67428b0717aa6355829b7eead59bfe01732b057..8c5b4845b07c2f4d68a927e0197c2ff9ee283d64 100644 --- a/tasks/0068_079_68079868_qa_1/task.toml +++ b/tasks/0068_079_68079868_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_111_68111995_qa_1/environment/bootstrap.sh b/tasks/0068_111_68111995_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_111_68111995_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_111_68111995_qa_1/environment/pull_bucket.py b/tasks/0068_111_68111995_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_111_68111995_qa_1/environment/pull_bucket.py +++ b/tasks/0068_111_68111995_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_111_68111995_qa_1/task.toml b/tasks/0068_111_68111995_qa_1/task.toml index 01ce80eb34dad2593126ee420b14eedfbdf65570..708ce96aabfb92263ca6e7484cbda3ee30d9f802 100644 --- a/tasks/0068_111_68111995_qa_1/task.toml +++ b/tasks/0068_111_68111995_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_119_68119558_qa_4/environment/bootstrap.sh b/tasks/0068_119_68119558_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_119_68119558_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_119_68119558_qa_4/environment/pull_bucket.py b/tasks/0068_119_68119558_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_119_68119558_qa_4/environment/pull_bucket.py +++ b/tasks/0068_119_68119558_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_119_68119558_qa_4/task.toml b/tasks/0068_119_68119558_qa_4/task.toml index e883af7a8f138b8b48e324b11f09b411610217dc..a903c5b3c19a483d0903eb5bf8b272271342e6f3 100644 --- a/tasks/0068_119_68119558_qa_4/task.toml +++ b/tasks/0068_119_68119558_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_119_68119558_qa_5/environment/bootstrap.sh b/tasks/0068_119_68119558_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_119_68119558_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_119_68119558_qa_5/environment/pull_bucket.py b/tasks/0068_119_68119558_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_119_68119558_qa_5/environment/pull_bucket.py +++ b/tasks/0068_119_68119558_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_119_68119558_qa_5/task.toml b/tasks/0068_119_68119558_qa_5/task.toml index 5f5a167689c92eb998d0e03c05207b38b1e1acaf..6239f6cfc662a610e1680ac8bae6e740765010d5 100644 --- a/tasks/0068_119_68119558_qa_5/task.toml +++ b/tasks/0068_119_68119558_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_127_68127229_qa_4/environment/bootstrap.sh b/tasks/0068_127_68127229_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_127_68127229_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_127_68127229_qa_4/environment/pull_bucket.py b/tasks/0068_127_68127229_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_127_68127229_qa_4/environment/pull_bucket.py +++ b/tasks/0068_127_68127229_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_127_68127229_qa_4/task.toml b/tasks/0068_127_68127229_qa_4/task.toml index 72ffed50f9793d7d0eff3e180f3fbb3dbba2945d..e58213b45fb60990de6f38f439659e5392f7a034 100644 --- a/tasks/0068_127_68127229_qa_4/task.toml +++ b/tasks/0068_127_68127229_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_152_68152590_qa_2/environment/bootstrap.sh b/tasks/0068_152_68152590_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_152_68152590_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_152_68152590_qa_2/environment/pull_bucket.py b/tasks/0068_152_68152590_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_152_68152590_qa_2/environment/pull_bucket.py +++ b/tasks/0068_152_68152590_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_152_68152590_qa_2/task.toml b/tasks/0068_152_68152590_qa_2/task.toml index 3768efa1a5ef2e5e928b011fe01f16aee0d73076..a49b16cd739d12710f19695bcc2f2eb0f661b46c 100644 --- a/tasks/0068_152_68152590_qa_2/task.toml +++ b/tasks/0068_152_68152590_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_152_68152590_qa_3/environment/bootstrap.sh b/tasks/0068_152_68152590_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_152_68152590_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_152_68152590_qa_3/environment/pull_bucket.py b/tasks/0068_152_68152590_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_152_68152590_qa_3/environment/pull_bucket.py +++ b/tasks/0068_152_68152590_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_152_68152590_qa_3/task.toml b/tasks/0068_152_68152590_qa_3/task.toml index 5c1641086a60382552076e92c8351872edd5fe13..27716e0dfd707237c06d45fc05cd4c10b2068d10 100644 --- a/tasks/0068_152_68152590_qa_3/task.toml +++ b/tasks/0068_152_68152590_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_152_68152590_qa_4/environment/bootstrap.sh b/tasks/0068_152_68152590_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_152_68152590_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_152_68152590_qa_4/environment/pull_bucket.py b/tasks/0068_152_68152590_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_152_68152590_qa_4/environment/pull_bucket.py +++ b/tasks/0068_152_68152590_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_152_68152590_qa_4/task.toml b/tasks/0068_152_68152590_qa_4/task.toml index 68b5a1578c531458dcba159a3e0ba370f2eee33b..1e3fd1aec5df4890d7ef3ba4856bb3519b5227db 100644 --- a/tasks/0068_152_68152590_qa_4/task.toml +++ b/tasks/0068_152_68152590_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_164_68164064_qa_1/environment/bootstrap.sh b/tasks/0068_164_68164064_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_164_68164064_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_164_68164064_qa_1/environment/pull_bucket.py b/tasks/0068_164_68164064_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_164_68164064_qa_1/environment/pull_bucket.py +++ b/tasks/0068_164_68164064_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_164_68164064_qa_1/task.toml b/tasks/0068_164_68164064_qa_1/task.toml index f0fb49cf105e15430cb56d03be89b9279c679429..236d69e8949bc5c1e7ae4ca52f8eb2b6a7f11d6e 100644 --- a/tasks/0068_164_68164064_qa_1/task.toml +++ b/tasks/0068_164_68164064_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_405_68405460_qa_1/environment/bootstrap.sh b/tasks/0068_405_68405460_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_405_68405460_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_405_68405460_qa_1/environment/pull_bucket.py b/tasks/0068_405_68405460_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_405_68405460_qa_1/environment/pull_bucket.py +++ b/tasks/0068_405_68405460_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_405_68405460_qa_1/task.toml b/tasks/0068_405_68405460_qa_1/task.toml index 65819b770d1d077c18f9647c9b218e9eb23b1d73..92533b06f186e5efa60915807e27ee83f07c314e 100644 --- a/tasks/0068_405_68405460_qa_1/task.toml +++ b/tasks/0068_405_68405460_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_405_68405460_qa_4/environment/bootstrap.sh b/tasks/0068_405_68405460_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_405_68405460_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_405_68405460_qa_4/environment/pull_bucket.py b/tasks/0068_405_68405460_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_405_68405460_qa_4/environment/pull_bucket.py +++ b/tasks/0068_405_68405460_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_405_68405460_qa_4/task.toml b/tasks/0068_405_68405460_qa_4/task.toml index 22e7fb29c38845c462167d1c6e65f782dc3e69c6..70bb1cd20f57f5c937d77acba788d0ce57f6463b 100644 --- a/tasks/0068_405_68405460_qa_4/task.toml +++ b/tasks/0068_405_68405460_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_463_68463534_qa_5/environment/bootstrap.sh b/tasks/0068_463_68463534_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_463_68463534_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_463_68463534_qa_5/environment/pull_bucket.py b/tasks/0068_463_68463534_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_463_68463534_qa_5/environment/pull_bucket.py +++ b/tasks/0068_463_68463534_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_463_68463534_qa_5/task.toml b/tasks/0068_463_68463534_qa_5/task.toml index f248751fd3c4bde4afc20597116ed0d5145964e2..44adc5ad925d593bf8f44e5b99adfb864f70c871 100644 --- a/tasks/0068_463_68463534_qa_5/task.toml +++ b/tasks/0068_463_68463534_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_476_68476011_qa_1/environment/bootstrap.sh b/tasks/0068_476_68476011_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_476_68476011_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_476_68476011_qa_1/environment/pull_bucket.py b/tasks/0068_476_68476011_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_476_68476011_qa_1/environment/pull_bucket.py +++ b/tasks/0068_476_68476011_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_476_68476011_qa_1/task.toml b/tasks/0068_476_68476011_qa_1/task.toml index 3e22cf9c0447b8be05507f348695ff76318034d2..decc88b75238f70df0c9350d86572339b7601da7 100644 --- a/tasks/0068_476_68476011_qa_1/task.toml +++ b/tasks/0068_476_68476011_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_518_68518330_qa_1/environment/bootstrap.sh b/tasks/0068_518_68518330_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_518_68518330_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_518_68518330_qa_1/environment/pull_bucket.py b/tasks/0068_518_68518330_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_518_68518330_qa_1/environment/pull_bucket.py +++ b/tasks/0068_518_68518330_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_518_68518330_qa_1/task.toml b/tasks/0068_518_68518330_qa_1/task.toml index 157f42b7c6ef6be1f8de4ba23c5954e0eef0f73e..f9eca4e457d71ea8e01bf64b3808efcf0e8b80de 100644 --- a/tasks/0068_518_68518330_qa_1/task.toml +++ b/tasks/0068_518_68518330_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_518_68518330_qa_2/environment/bootstrap.sh b/tasks/0068_518_68518330_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_518_68518330_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_518_68518330_qa_2/environment/pull_bucket.py b/tasks/0068_518_68518330_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_518_68518330_qa_2/environment/pull_bucket.py +++ b/tasks/0068_518_68518330_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_518_68518330_qa_2/task.toml b/tasks/0068_518_68518330_qa_2/task.toml index 8cb3dee3730fa118071263a1baec10d57c7e0237..e4150bd16692e1edcb06337aa655b1d0a3a0891f 100644 --- a/tasks/0068_518_68518330_qa_2/task.toml +++ b/tasks/0068_518_68518330_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_714_68714318_qa_1/environment/bootstrap.sh b/tasks/0068_714_68714318_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_714_68714318_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_714_68714318_qa_1/environment/pull_bucket.py b/tasks/0068_714_68714318_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_714_68714318_qa_1/environment/pull_bucket.py +++ b/tasks/0068_714_68714318_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_714_68714318_qa_1/task.toml b/tasks/0068_714_68714318_qa_1/task.toml index 54a3d1dbe03002099721616330be97ebff92bf46..a43c190fc0748b1c2ccf5fc3a1c68140bbca148e 100644 --- a/tasks/0068_714_68714318_qa_1/task.toml +++ b/tasks/0068_714_68714318_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_724_68724527_qa_2/environment/bootstrap.sh b/tasks/0068_724_68724527_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_724_68724527_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_724_68724527_qa_2/environment/pull_bucket.py b/tasks/0068_724_68724527_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_724_68724527_qa_2/environment/pull_bucket.py +++ b/tasks/0068_724_68724527_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_724_68724527_qa_2/task.toml b/tasks/0068_724_68724527_qa_2/task.toml index 100bedc1998c4a736d63e850b88ea3651bc64344..38ea5d01fba13ec2f25f5fae39798dc2e19724fd 100644 --- a/tasks/0068_724_68724527_qa_2/task.toml +++ b/tasks/0068_724_68724527_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_754_68754620_qa_1/environment/bootstrap.sh b/tasks/0068_754_68754620_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_754_68754620_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_754_68754620_qa_1/environment/pull_bucket.py b/tasks/0068_754_68754620_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_754_68754620_qa_1/environment/pull_bucket.py +++ b/tasks/0068_754_68754620_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_754_68754620_qa_1/task.toml b/tasks/0068_754_68754620_qa_1/task.toml index 6cb3ed22a2822842e0e43a193d51896b16aad450..b72967609f81e508baae0216af652732cc6d0578 100644 --- a/tasks/0068_754_68754620_qa_1/task.toml +++ b/tasks/0068_754_68754620_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_864_68864400_qa_1/environment/bootstrap.sh b/tasks/0068_864_68864400_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_864_68864400_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_864_68864400_qa_1/environment/pull_bucket.py b/tasks/0068_864_68864400_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_864_68864400_qa_1/environment/pull_bucket.py +++ b/tasks/0068_864_68864400_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_864_68864400_qa_1/task.toml b/tasks/0068_864_68864400_qa_1/task.toml index dae04b38ebf48382275d3e1bccc09ca57f8c84d9..b793d41307bf4ce38d317e273c7f7a5720099e7a 100644 --- a/tasks/0068_864_68864400_qa_1/task.toml +++ b/tasks/0068_864_68864400_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_960_68960212_qa_3/environment/bootstrap.sh b/tasks/0068_960_68960212_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_960_68960212_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_960_68960212_qa_3/environment/pull_bucket.py b/tasks/0068_960_68960212_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_960_68960212_qa_3/environment/pull_bucket.py +++ b/tasks/0068_960_68960212_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_960_68960212_qa_3/task.toml b/tasks/0068_960_68960212_qa_3/task.toml index 823ff9a06d68f8bac837788b8353d785fbc6f0ed..33849799b8d6c50430781ac272e57a9c8a6c81e8 100644 --- a/tasks/0068_960_68960212_qa_3/task.toml +++ b/tasks/0068_960_68960212_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_960_68960212_qa_4/environment/bootstrap.sh b/tasks/0068_960_68960212_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_960_68960212_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_960_68960212_qa_4/environment/pull_bucket.py b/tasks/0068_960_68960212_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_960_68960212_qa_4/environment/pull_bucket.py +++ b/tasks/0068_960_68960212_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_960_68960212_qa_4/task.toml b/tasks/0068_960_68960212_qa_4/task.toml index b6b538ff81909606e476ac734cc8da70d80f7c58..2216d2c0d2199b52cac386969dda62644bedcf42 100644 --- a/tasks/0068_960_68960212_qa_4/task.toml +++ b/tasks/0068_960_68960212_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_964_68964852_qa_2/environment/bootstrap.sh b/tasks/0068_964_68964852_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_964_68964852_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_964_68964852_qa_2/environment/pull_bucket.py b/tasks/0068_964_68964852_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_964_68964852_qa_2/environment/pull_bucket.py +++ b/tasks/0068_964_68964852_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_964_68964852_qa_2/task.toml b/tasks/0068_964_68964852_qa_2/task.toml index 7f539ee465fb433f4b28d47b1af1b177abeafa52..5db0ad52fcc13dc4db015c0e933dc35a0bca99c0 100644 --- a/tasks/0068_964_68964852_qa_2/task.toml +++ b/tasks/0068_964_68964852_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0068_984_68984398_qa_4/environment/bootstrap.sh b/tasks/0068_984_68984398_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0068_984_68984398_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0068_984_68984398_qa_4/environment/pull_bucket.py b/tasks/0068_984_68984398_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0068_984_68984398_qa_4/environment/pull_bucket.py +++ b/tasks/0068_984_68984398_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0068_984_68984398_qa_4/task.toml b/tasks/0068_984_68984398_qa_4/task.toml index d5bdb4d2cb2fabf4a13c01ac5207c7eea9262bef..3f311c26fe9e512c083e7cf049aa9baba2d6aa1e 100644 --- a/tasks/0068_984_68984398_qa_4/task.toml +++ b/tasks/0068_984_68984398_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_000_69000693_qa_1/environment/bootstrap.sh b/tasks/0069_000_69000693_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_000_69000693_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_000_69000693_qa_1/environment/pull_bucket.py b/tasks/0069_000_69000693_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_000_69000693_qa_1/environment/pull_bucket.py +++ b/tasks/0069_000_69000693_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_000_69000693_qa_1/task.toml b/tasks/0069_000_69000693_qa_1/task.toml index b4a06c87699174caa2cb3bc9d4b6b6bb486784cd..d48b575aa6239c049e056e623ebb13127263e419 100644 --- a/tasks/0069_000_69000693_qa_1/task.toml +++ b/tasks/0069_000_69000693_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_000_69000693_qa_5/environment/bootstrap.sh b/tasks/0069_000_69000693_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_000_69000693_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_000_69000693_qa_5/environment/pull_bucket.py b/tasks/0069_000_69000693_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_000_69000693_qa_5/environment/pull_bucket.py +++ b/tasks/0069_000_69000693_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_000_69000693_qa_5/task.toml b/tasks/0069_000_69000693_qa_5/task.toml index ce04d288ca2753cca7102c3cd54c28d4578687b0..60550225806d008b3a6ad2bd5b28f1625c55906c 100644 --- a/tasks/0069_000_69000693_qa_5/task.toml +++ b/tasks/0069_000_69000693_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_002_69002629_qa_2/environment/bootstrap.sh b/tasks/0069_002_69002629_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_002_69002629_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_002_69002629_qa_2/environment/pull_bucket.py b/tasks/0069_002_69002629_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_002_69002629_qa_2/environment/pull_bucket.py +++ b/tasks/0069_002_69002629_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_002_69002629_qa_2/task.toml b/tasks/0069_002_69002629_qa_2/task.toml index 41abc2aab5a865af3ae7d26a4d4b59b21a007ccd..b1e2dac218012ac4a9270d31b3dda2a47aa6e7db 100644 --- a/tasks/0069_002_69002629_qa_2/task.toml +++ b/tasks/0069_002_69002629_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_002_69002629_qa_3/environment/bootstrap.sh b/tasks/0069_002_69002629_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_002_69002629_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_002_69002629_qa_3/environment/pull_bucket.py b/tasks/0069_002_69002629_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_002_69002629_qa_3/environment/pull_bucket.py +++ b/tasks/0069_002_69002629_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_002_69002629_qa_3/task.toml b/tasks/0069_002_69002629_qa_3/task.toml index 9b9382afbd709ecd990bee42ef9241e5e1e2ef2e..a2ec0cfc6c8fe78b09903d76e4dc97abf418e2f1 100644 --- a/tasks/0069_002_69002629_qa_3/task.toml +++ b/tasks/0069_002_69002629_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_007_69007333_qa_2/environment/bootstrap.sh b/tasks/0069_007_69007333_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_007_69007333_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_007_69007333_qa_2/environment/pull_bucket.py b/tasks/0069_007_69007333_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_007_69007333_qa_2/environment/pull_bucket.py +++ b/tasks/0069_007_69007333_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_007_69007333_qa_2/task.toml b/tasks/0069_007_69007333_qa_2/task.toml index 176c5ab1d762c7fc5e43071694aa3fdfeec23d2f..b63f0426e4241eaa6145ffd8aa2898b1024c84ce 100644 --- a/tasks/0069_007_69007333_qa_2/task.toml +++ b/tasks/0069_007_69007333_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_042_69042020_qa_1/environment/bootstrap.sh b/tasks/0069_042_69042020_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_042_69042020_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_042_69042020_qa_1/environment/pull_bucket.py b/tasks/0069_042_69042020_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_042_69042020_qa_1/environment/pull_bucket.py +++ b/tasks/0069_042_69042020_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_042_69042020_qa_1/task.toml b/tasks/0069_042_69042020_qa_1/task.toml index 7a1445c72b86df0c76e9b3b8ef968644897cbe17..7bfa704d8912c64fcb01eec138892bf36f44bf5b 100644 --- a/tasks/0069_042_69042020_qa_1/task.toml +++ b/tasks/0069_042_69042020_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_047_69047990_qa_1/environment/bootstrap.sh b/tasks/0069_047_69047990_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_047_69047990_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_047_69047990_qa_1/environment/pull_bucket.py b/tasks/0069_047_69047990_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_047_69047990_qa_1/environment/pull_bucket.py +++ b/tasks/0069_047_69047990_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_047_69047990_qa_1/task.toml b/tasks/0069_047_69047990_qa_1/task.toml index 32e32d7e1ab3eaf94b7a4937fc3f96f72042ad01..69d9e4a41f3ade86694ecd3d0bb9992342bf5672 100644 --- a/tasks/0069_047_69047990_qa_1/task.toml +++ b/tasks/0069_047_69047990_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_054_69054524_qa_1/environment/bootstrap.sh b/tasks/0069_054_69054524_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_054_69054524_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_054_69054524_qa_1/environment/pull_bucket.py b/tasks/0069_054_69054524_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_054_69054524_qa_1/environment/pull_bucket.py +++ b/tasks/0069_054_69054524_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_054_69054524_qa_1/task.toml b/tasks/0069_054_69054524_qa_1/task.toml index 57af0f0259ee1880e4cb1307946fc76821ec602c..1d4c5d8a0b7d956687c8e47b8ce4caa410a0b5cb 100644 --- a/tasks/0069_054_69054524_qa_1/task.toml +++ b/tasks/0069_054_69054524_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_054_69054524_qa_2/environment/bootstrap.sh b/tasks/0069_054_69054524_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_054_69054524_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_054_69054524_qa_2/environment/pull_bucket.py b/tasks/0069_054_69054524_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_054_69054524_qa_2/environment/pull_bucket.py +++ b/tasks/0069_054_69054524_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_054_69054524_qa_2/task.toml b/tasks/0069_054_69054524_qa_2/task.toml index 3a3705a45e8321abba59ce99f3afd134159690e7..6c87aced63bb37f4a778e9a581e21b4da95f8e4f 100644 --- a/tasks/0069_054_69054524_qa_2/task.toml +++ b/tasks/0069_054_69054524_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_075_69075979_qa_5/environment/bootstrap.sh b/tasks/0069_075_69075979_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_075_69075979_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_075_69075979_qa_5/environment/pull_bucket.py b/tasks/0069_075_69075979_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_075_69075979_qa_5/environment/pull_bucket.py +++ b/tasks/0069_075_69075979_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_075_69075979_qa_5/task.toml b/tasks/0069_075_69075979_qa_5/task.toml index bba20497607d840258b6db89cbd10b7db65a48cc..b5fabde0dc127f6f3872f6a942ae95dd84c2101c 100644 --- a/tasks/0069_075_69075979_qa_5/task.toml +++ b/tasks/0069_075_69075979_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_094_69094334_qa_4/environment/bootstrap.sh b/tasks/0069_094_69094334_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_094_69094334_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_094_69094334_qa_4/environment/pull_bucket.py b/tasks/0069_094_69094334_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_094_69094334_qa_4/environment/pull_bucket.py +++ b/tasks/0069_094_69094334_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_094_69094334_qa_4/task.toml b/tasks/0069_094_69094334_qa_4/task.toml index 9ab8c70ca38c597021a7df793bcf22068bde6d15..a780a5cd107ca6c714923081ad2ecc99f5aa18ff 100644 --- a/tasks/0069_094_69094334_qa_4/task.toml +++ b/tasks/0069_094_69094334_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_119_69119898_qa_1/environment/bootstrap.sh b/tasks/0069_119_69119898_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_119_69119898_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_119_69119898_qa_1/environment/pull_bucket.py b/tasks/0069_119_69119898_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_119_69119898_qa_1/environment/pull_bucket.py +++ b/tasks/0069_119_69119898_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_119_69119898_qa_1/task.toml b/tasks/0069_119_69119898_qa_1/task.toml index 07d97f48fa54348b85c9c56ccabebf839adb113a..d562902fb1ec0da2d9bf7b2a60e55759f96155ce 100644 --- a/tasks/0069_119_69119898_qa_1/task.toml +++ b/tasks/0069_119_69119898_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_120_69120864_qa_4/environment/bootstrap.sh b/tasks/0069_120_69120864_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_120_69120864_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_120_69120864_qa_4/environment/pull_bucket.py b/tasks/0069_120_69120864_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_120_69120864_qa_4/environment/pull_bucket.py +++ b/tasks/0069_120_69120864_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_120_69120864_qa_4/task.toml b/tasks/0069_120_69120864_qa_4/task.toml index c6e194eca9e30b9a0e258ef993281c69e23f08b8..b5a76c8520289ffe138e59020e0b249f6653478c 100644 --- a/tasks/0069_120_69120864_qa_4/task.toml +++ b/tasks/0069_120_69120864_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_139_69139185_qa_4/environment/bootstrap.sh b/tasks/0069_139_69139185_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_139_69139185_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_139_69139185_qa_4/environment/pull_bucket.py b/tasks/0069_139_69139185_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_139_69139185_qa_4/environment/pull_bucket.py +++ b/tasks/0069_139_69139185_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_139_69139185_qa_4/task.toml b/tasks/0069_139_69139185_qa_4/task.toml index 917b29010c47d2bcc50c69a7ce9ccef9e52fae1d..12e225341b01aaf9c28849233ae8cf8f13474601 100644 --- a/tasks/0069_139_69139185_qa_4/task.toml +++ b/tasks/0069_139_69139185_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_142_69142112_qa_4/environment/bootstrap.sh b/tasks/0069_142_69142112_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_142_69142112_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_142_69142112_qa_4/environment/pull_bucket.py b/tasks/0069_142_69142112_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_142_69142112_qa_4/environment/pull_bucket.py +++ b/tasks/0069_142_69142112_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_142_69142112_qa_4/task.toml b/tasks/0069_142_69142112_qa_4/task.toml index 6cecbe156d37ba30a244e48ccab92be187c49f77..9c5c55c168e3c62b75d3c8104ee7cb17db99d22c 100644 --- a/tasks/0069_142_69142112_qa_4/task.toml +++ b/tasks/0069_142_69142112_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_205_69205815_qa_3/environment/bootstrap.sh b/tasks/0069_205_69205815_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_205_69205815_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_205_69205815_qa_3/environment/pull_bucket.py b/tasks/0069_205_69205815_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_205_69205815_qa_3/environment/pull_bucket.py +++ b/tasks/0069_205_69205815_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_205_69205815_qa_3/task.toml b/tasks/0069_205_69205815_qa_3/task.toml index 43bd384248721771e3ade1fe5b8d3db01847bdc6..1b8c752704e733444715756bd2c9fd1b8260b435 100644 --- a/tasks/0069_205_69205815_qa_3/task.toml +++ b/tasks/0069_205_69205815_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_205_69205815_qa_5/environment/bootstrap.sh b/tasks/0069_205_69205815_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_205_69205815_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_205_69205815_qa_5/environment/pull_bucket.py b/tasks/0069_205_69205815_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_205_69205815_qa_5/environment/pull_bucket.py +++ b/tasks/0069_205_69205815_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_205_69205815_qa_5/task.toml b/tasks/0069_205_69205815_qa_5/task.toml index 99f6e4f893c00d380795e86a77b34b01b4b0e703..168cf7de0de0221599c585668a49cc1091c71649 100644 --- a/tasks/0069_205_69205815_qa_5/task.toml +++ b/tasks/0069_205_69205815_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_266_69266451_qa_5/environment/bootstrap.sh b/tasks/0069_266_69266451_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_266_69266451_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_266_69266451_qa_5/environment/pull_bucket.py b/tasks/0069_266_69266451_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_266_69266451_qa_5/environment/pull_bucket.py +++ b/tasks/0069_266_69266451_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_266_69266451_qa_5/task.toml b/tasks/0069_266_69266451_qa_5/task.toml index c7120f340947dfa19c6891f719a5c0e41868a59a..c80bd977757f9c2b102ee6678d0c3c10c6cdec87 100644 --- a/tasks/0069_266_69266451_qa_5/task.toml +++ b/tasks/0069_266_69266451_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_293_69293349_qa_2/environment/bootstrap.sh b/tasks/0069_293_69293349_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_293_69293349_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_293_69293349_qa_2/environment/pull_bucket.py b/tasks/0069_293_69293349_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_293_69293349_qa_2/environment/pull_bucket.py +++ b/tasks/0069_293_69293349_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_293_69293349_qa_2/task.toml b/tasks/0069_293_69293349_qa_2/task.toml index dfe1a3b521e80fdcccadeae479e1a7c579715307..0780162f7dbc8a08c00248172d6982c7d90b1bb5 100644 --- a/tasks/0069_293_69293349_qa_2/task.toml +++ b/tasks/0069_293_69293349_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_294_69294198_qa_5/environment/bootstrap.sh b/tasks/0069_294_69294198_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_294_69294198_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_294_69294198_qa_5/environment/pull_bucket.py b/tasks/0069_294_69294198_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_294_69294198_qa_5/environment/pull_bucket.py +++ b/tasks/0069_294_69294198_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_294_69294198_qa_5/task.toml b/tasks/0069_294_69294198_qa_5/task.toml index 0fdddeef4308033fff47369f4f9d3b499d92a374..58bb46481f7026fc1630ce67b4b01b5af9c65b73 100644 --- a/tasks/0069_294_69294198_qa_5/task.toml +++ b/tasks/0069_294_69294198_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_338_69338582_qa_2/environment/bootstrap.sh b/tasks/0069_338_69338582_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_338_69338582_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_338_69338582_qa_2/environment/pull_bucket.py b/tasks/0069_338_69338582_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_338_69338582_qa_2/environment/pull_bucket.py +++ b/tasks/0069_338_69338582_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_338_69338582_qa_2/task.toml b/tasks/0069_338_69338582_qa_2/task.toml index 6c715ccdcbfc092b1223f72d4aad6e518133ae81..c606b8d85e2dfd59297335e9f5d292d2c6dc0d84 100644 --- a/tasks/0069_338_69338582_qa_2/task.toml +++ b/tasks/0069_338_69338582_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_366_69366991_qa_2/environment/bootstrap.sh b/tasks/0069_366_69366991_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_366_69366991_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_366_69366991_qa_2/environment/pull_bucket.py b/tasks/0069_366_69366991_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_366_69366991_qa_2/environment/pull_bucket.py +++ b/tasks/0069_366_69366991_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_366_69366991_qa_2/task.toml b/tasks/0069_366_69366991_qa_2/task.toml index 9492ca809cfba8c69e44abf31822da0827b7015d..956b4da9f9f725d2a0a7a6de5b8ac35c5f3b3085 100644 --- a/tasks/0069_366_69366991_qa_2/task.toml +++ b/tasks/0069_366_69366991_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_366_69366991_qa_4/environment/bootstrap.sh b/tasks/0069_366_69366991_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_366_69366991_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_366_69366991_qa_4/environment/pull_bucket.py b/tasks/0069_366_69366991_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_366_69366991_qa_4/environment/pull_bucket.py +++ b/tasks/0069_366_69366991_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_366_69366991_qa_4/task.toml b/tasks/0069_366_69366991_qa_4/task.toml index ebdd3baf858a765c9b07cf754432535ad2e46264..4ae4dd0041e0140a18f50e71c1c5934fd6a91db3 100644 --- a/tasks/0069_366_69366991_qa_4/task.toml +++ b/tasks/0069_366_69366991_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_397_69397859_qa_5/environment/bootstrap.sh b/tasks/0069_397_69397859_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_397_69397859_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_397_69397859_qa_5/environment/pull_bucket.py b/tasks/0069_397_69397859_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_397_69397859_qa_5/environment/pull_bucket.py +++ b/tasks/0069_397_69397859_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_397_69397859_qa_5/task.toml b/tasks/0069_397_69397859_qa_5/task.toml index 5fde17b7b22c94ac8f05aacef3075d276e51e333..60e50d6e9561b69ad9f4627cf5c20b1d70c2d087 100644 --- a/tasks/0069_397_69397859_qa_5/task.toml +++ b/tasks/0069_397_69397859_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_399_69399288_qa_4/environment/bootstrap.sh b/tasks/0069_399_69399288_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_399_69399288_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_399_69399288_qa_4/environment/pull_bucket.py b/tasks/0069_399_69399288_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_399_69399288_qa_4/environment/pull_bucket.py +++ b/tasks/0069_399_69399288_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_399_69399288_qa_4/task.toml b/tasks/0069_399_69399288_qa_4/task.toml index 65b3533961585b13fb998549e1789301d23f69cb..00eb603db1d6f6f3653fa9d7e8b2974898f1da41 100644 --- a/tasks/0069_399_69399288_qa_4/task.toml +++ b/tasks/0069_399_69399288_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_401_69401499_qa_5/environment/bootstrap.sh b/tasks/0069_401_69401499_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_401_69401499_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_401_69401499_qa_5/environment/pull_bucket.py b/tasks/0069_401_69401499_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_401_69401499_qa_5/environment/pull_bucket.py +++ b/tasks/0069_401_69401499_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_401_69401499_qa_5/task.toml b/tasks/0069_401_69401499_qa_5/task.toml index d31f7390475dc40e8a1cbde9ddf09c97e20332d3..e04d0b926fceb0fdb97707f5532e49eb4f982b11 100644 --- a/tasks/0069_401_69401499_qa_5/task.toml +++ b/tasks/0069_401_69401499_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_427_69427691_qa_5/environment/bootstrap.sh b/tasks/0069_427_69427691_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_427_69427691_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_427_69427691_qa_5/environment/pull_bucket.py b/tasks/0069_427_69427691_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_427_69427691_qa_5/environment/pull_bucket.py +++ b/tasks/0069_427_69427691_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_427_69427691_qa_5/task.toml b/tasks/0069_427_69427691_qa_5/task.toml index 95773651a26f21cf12562c80c2410b2e4ec2395f..b2591e4a12570c2f6d3555bf17eeff90667a1c49 100644 --- a/tasks/0069_427_69427691_qa_5/task.toml +++ b/tasks/0069_427_69427691_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_437_69437327_qa_3/environment/bootstrap.sh b/tasks/0069_437_69437327_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_437_69437327_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_437_69437327_qa_3/environment/pull_bucket.py b/tasks/0069_437_69437327_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_437_69437327_qa_3/environment/pull_bucket.py +++ b/tasks/0069_437_69437327_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_437_69437327_qa_3/task.toml b/tasks/0069_437_69437327_qa_3/task.toml index 883a877bdbba11841e02a01042da4914251047c3..e40675e76d71fb212e2c96d73f044404a522e5f8 100644 --- a/tasks/0069_437_69437327_qa_3/task.toml +++ b/tasks/0069_437_69437327_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_485_69485814_qa_2/environment/bootstrap.sh b/tasks/0069_485_69485814_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_485_69485814_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_485_69485814_qa_2/environment/pull_bucket.py b/tasks/0069_485_69485814_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_485_69485814_qa_2/environment/pull_bucket.py +++ b/tasks/0069_485_69485814_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_485_69485814_qa_2/task.toml b/tasks/0069_485_69485814_qa_2/task.toml index 93db59595f19c64462721b88fde11cb6e74b671c..8659e0980e6ecbc96e6d17874765c4d80a037e6e 100644 --- a/tasks/0069_485_69485814_qa_2/task.toml +++ b/tasks/0069_485_69485814_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_496_69496308_qa_1/environment/bootstrap.sh b/tasks/0069_496_69496308_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_496_69496308_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_496_69496308_qa_1/environment/pull_bucket.py b/tasks/0069_496_69496308_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_496_69496308_qa_1/environment/pull_bucket.py +++ b/tasks/0069_496_69496308_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_496_69496308_qa_1/task.toml b/tasks/0069_496_69496308_qa_1/task.toml index 8f8b1962db4840108b4d9a785b24f8c7888e6f0e..1eebf04b47029afc5d4a5fd3d10f2c084dc96ebf 100644 --- a/tasks/0069_496_69496308_qa_1/task.toml +++ b/tasks/0069_496_69496308_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_496_69496308_qa_4/environment/bootstrap.sh b/tasks/0069_496_69496308_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_496_69496308_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_496_69496308_qa_4/environment/pull_bucket.py b/tasks/0069_496_69496308_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_496_69496308_qa_4/environment/pull_bucket.py +++ b/tasks/0069_496_69496308_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_496_69496308_qa_4/task.toml b/tasks/0069_496_69496308_qa_4/task.toml index e206ca6cd9b43a3443ae0a211c4f7ea85493d035..5b4e4ba9c61c873224f676caada184752998cdb6 100644 --- a/tasks/0069_496_69496308_qa_4/task.toml +++ b/tasks/0069_496_69496308_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_534_69534181_qa_4/environment/bootstrap.sh b/tasks/0069_534_69534181_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_534_69534181_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_534_69534181_qa_4/environment/pull_bucket.py b/tasks/0069_534_69534181_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_534_69534181_qa_4/environment/pull_bucket.py +++ b/tasks/0069_534_69534181_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_534_69534181_qa_4/task.toml b/tasks/0069_534_69534181_qa_4/task.toml index 6b8b4c9ff5073477901372b3866991163b7f937c..149ed3c0db32c10f1b19a0c17fbf180b38b66a36 100644 --- a/tasks/0069_534_69534181_qa_4/task.toml +++ b/tasks/0069_534_69534181_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_534_69534181_qa_5/environment/bootstrap.sh b/tasks/0069_534_69534181_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_534_69534181_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_534_69534181_qa_5/environment/pull_bucket.py b/tasks/0069_534_69534181_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_534_69534181_qa_5/environment/pull_bucket.py +++ b/tasks/0069_534_69534181_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_534_69534181_qa_5/task.toml b/tasks/0069_534_69534181_qa_5/task.toml index b7999e59a7a73180a8b41957687ce79192ea50e5..319d8afc26672deca86ff0022024a7424d1d4b42 100644 --- a/tasks/0069_534_69534181_qa_5/task.toml +++ b/tasks/0069_534_69534181_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_548_69548302_qa_1/environment/bootstrap.sh b/tasks/0069_548_69548302_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_548_69548302_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_548_69548302_qa_1/environment/pull_bucket.py b/tasks/0069_548_69548302_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_548_69548302_qa_1/environment/pull_bucket.py +++ b/tasks/0069_548_69548302_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_548_69548302_qa_1/task.toml b/tasks/0069_548_69548302_qa_1/task.toml index 2efa2643c0e1111a0a454af227e0ad244bca61a8..9e2dce5622c7f8147df8c8e3f228000b2a50f1e3 100644 --- a/tasks/0069_548_69548302_qa_1/task.toml +++ b/tasks/0069_548_69548302_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_589_69589694_qa_4/environment/bootstrap.sh b/tasks/0069_589_69589694_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_589_69589694_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_589_69589694_qa_4/environment/pull_bucket.py b/tasks/0069_589_69589694_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_589_69589694_qa_4/environment/pull_bucket.py +++ b/tasks/0069_589_69589694_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_589_69589694_qa_4/task.toml b/tasks/0069_589_69589694_qa_4/task.toml index fe22c548c8c0aab4b043abb48c637c6afc67a309..fb8197565298bae77f9b971f85439a7ebfead697 100644 --- a/tasks/0069_589_69589694_qa_4/task.toml +++ b/tasks/0069_589_69589694_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_613_69613166_qa_5/environment/bootstrap.sh b/tasks/0069_613_69613166_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_613_69613166_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_613_69613166_qa_5/environment/pull_bucket.py b/tasks/0069_613_69613166_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_613_69613166_qa_5/environment/pull_bucket.py +++ b/tasks/0069_613_69613166_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_613_69613166_qa_5/task.toml b/tasks/0069_613_69613166_qa_5/task.toml index 77ba987bcf9370f9d0aacd3cce0b8603fb731250..17cde03f10339e1c911a3f96309ed6371f980f62 100644 --- a/tasks/0069_613_69613166_qa_5/task.toml +++ b/tasks/0069_613_69613166_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_615_69615875_qa_2/environment/bootstrap.sh b/tasks/0069_615_69615875_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_615_69615875_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_615_69615875_qa_2/environment/pull_bucket.py b/tasks/0069_615_69615875_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_615_69615875_qa_2/environment/pull_bucket.py +++ b/tasks/0069_615_69615875_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_615_69615875_qa_2/task.toml b/tasks/0069_615_69615875_qa_2/task.toml index d87652e53796eeca308d61d1b2bb3913db6a9c80..2aa9d609c40739c27a04edab97524cb2d6580a77 100644 --- a/tasks/0069_615_69615875_qa_2/task.toml +++ b/tasks/0069_615_69615875_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_624_69624642_qa_1/environment/bootstrap.sh b/tasks/0069_624_69624642_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_624_69624642_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_624_69624642_qa_1/environment/pull_bucket.py b/tasks/0069_624_69624642_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_624_69624642_qa_1/environment/pull_bucket.py +++ b/tasks/0069_624_69624642_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_624_69624642_qa_1/task.toml b/tasks/0069_624_69624642_qa_1/task.toml index 6254e196797c1458fbb18174b4299d4106cd4a2c..f6bac0abb9d74e4597f8759b95ee8609ce78430e 100644 --- a/tasks/0069_624_69624642_qa_1/task.toml +++ b/tasks/0069_624_69624642_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_636_69636356_qa_2/environment/bootstrap.sh b/tasks/0069_636_69636356_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_636_69636356_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_636_69636356_qa_2/environment/pull_bucket.py b/tasks/0069_636_69636356_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_636_69636356_qa_2/environment/pull_bucket.py +++ b/tasks/0069_636_69636356_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_636_69636356_qa_2/task.toml b/tasks/0069_636_69636356_qa_2/task.toml index 8c20867aa80cd676531cb106ac7dc6fc03854335..80364fc32b9237e369abc40d22e10849dc58509c 100644 --- a/tasks/0069_636_69636356_qa_2/task.toml +++ b/tasks/0069_636_69636356_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_636_69636356_qa_4/environment/bootstrap.sh b/tasks/0069_636_69636356_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_636_69636356_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_636_69636356_qa_4/environment/pull_bucket.py b/tasks/0069_636_69636356_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_636_69636356_qa_4/environment/pull_bucket.py +++ b/tasks/0069_636_69636356_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_636_69636356_qa_4/task.toml b/tasks/0069_636_69636356_qa_4/task.toml index 0ab4b9b744cc1517b222cb8ed2f3a67c967c8195..5e976d81fcc4415400890d55ed63a0b9ada7ce02 100644 --- a/tasks/0069_636_69636356_qa_4/task.toml +++ b/tasks/0069_636_69636356_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_643_69643958_qa_2/environment/bootstrap.sh b/tasks/0069_643_69643958_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_643_69643958_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_643_69643958_qa_2/environment/pull_bucket.py b/tasks/0069_643_69643958_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_643_69643958_qa_2/environment/pull_bucket.py +++ b/tasks/0069_643_69643958_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_643_69643958_qa_2/task.toml b/tasks/0069_643_69643958_qa_2/task.toml index c252764ce5353bfe71fd9fc44f47e658ff2856e3..e2bac54f34d6c69893d1dc5527a0b93f0f2cf939 100644 --- a/tasks/0069_643_69643958_qa_2/task.toml +++ b/tasks/0069_643_69643958_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_646_69646794_qa_3/environment/bootstrap.sh b/tasks/0069_646_69646794_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_646_69646794_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_646_69646794_qa_3/environment/pull_bucket.py b/tasks/0069_646_69646794_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_646_69646794_qa_3/environment/pull_bucket.py +++ b/tasks/0069_646_69646794_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_646_69646794_qa_3/task.toml b/tasks/0069_646_69646794_qa_3/task.toml index 93a44f1a728f781e8d674b40a70f995cc56163b0..c8b288cc6db84e4b98394c8af80de441d500dd85 100644 --- a/tasks/0069_646_69646794_qa_3/task.toml +++ b/tasks/0069_646_69646794_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_698_69698122_qa_4/environment/bootstrap.sh b/tasks/0069_698_69698122_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_698_69698122_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_698_69698122_qa_4/environment/pull_bucket.py b/tasks/0069_698_69698122_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_698_69698122_qa_4/environment/pull_bucket.py +++ b/tasks/0069_698_69698122_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_698_69698122_qa_4/task.toml b/tasks/0069_698_69698122_qa_4/task.toml index 79e251c792aedbbbe4e7a0ddb6dc955bd77fabfd..6e11d181cda634a8c67b6dba16178f5ff02c1770 100644 --- a/tasks/0069_698_69698122_qa_4/task.toml +++ b/tasks/0069_698_69698122_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_856_69856853_qa_2/environment/bootstrap.sh b/tasks/0069_856_69856853_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_856_69856853_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_856_69856853_qa_2/environment/pull_bucket.py b/tasks/0069_856_69856853_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_856_69856853_qa_2/environment/pull_bucket.py +++ b/tasks/0069_856_69856853_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_856_69856853_qa_2/task.toml b/tasks/0069_856_69856853_qa_2/task.toml index 24ef0a8925e0fe258026a63b133b1e9c375294f4..26ae51586d1693d5e592cd298f6dc0011327f47f 100644 --- a/tasks/0069_856_69856853_qa_2/task.toml +++ b/tasks/0069_856_69856853_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_856_69856853_qa_5/environment/bootstrap.sh b/tasks/0069_856_69856853_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_856_69856853_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_856_69856853_qa_5/environment/pull_bucket.py b/tasks/0069_856_69856853_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_856_69856853_qa_5/environment/pull_bucket.py +++ b/tasks/0069_856_69856853_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_856_69856853_qa_5/task.toml b/tasks/0069_856_69856853_qa_5/task.toml index 202ffaef0461ba8cd64b32001874da1e5921ac79..07483c4f0fa56712ad6449eb0e7c262eb4896cd8 100644 --- a/tasks/0069_856_69856853_qa_5/task.toml +++ b/tasks/0069_856_69856853_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_922_69922733_qa_1/environment/bootstrap.sh b/tasks/0069_922_69922733_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_922_69922733_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_922_69922733_qa_1/environment/pull_bucket.py b/tasks/0069_922_69922733_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_922_69922733_qa_1/environment/pull_bucket.py +++ b/tasks/0069_922_69922733_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_922_69922733_qa_1/task.toml b/tasks/0069_922_69922733_qa_1/task.toml index 580d8c4f49caac5037c1fb5415106eff763c73e7..cd6b12a499e95a0627fdca88735e20c22275e3e7 100644 --- a/tasks/0069_922_69922733_qa_1/task.toml +++ b/tasks/0069_922_69922733_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_939_69939978_qa_2/environment/bootstrap.sh b/tasks/0069_939_69939978_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_939_69939978_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_939_69939978_qa_2/environment/pull_bucket.py b/tasks/0069_939_69939978_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_939_69939978_qa_2/environment/pull_bucket.py +++ b/tasks/0069_939_69939978_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_939_69939978_qa_2/task.toml b/tasks/0069_939_69939978_qa_2/task.toml index 3a6ba8bb8f17ecf0ddccc62cf52bf90870fd54e2..6b596c0f4daab9531f2c816a55492bb1d0e6d17f 100644 --- a/tasks/0069_939_69939978_qa_2/task.toml +++ b/tasks/0069_939_69939978_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_939_69939978_qa_3/environment/bootstrap.sh b/tasks/0069_939_69939978_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_939_69939978_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_939_69939978_qa_3/environment/pull_bucket.py b/tasks/0069_939_69939978_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_939_69939978_qa_3/environment/pull_bucket.py +++ b/tasks/0069_939_69939978_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_939_69939978_qa_3/task.toml b/tasks/0069_939_69939978_qa_3/task.toml index 711ee0fcfd12f7f6112a57dfc84af10174028040..334c37e9ea38da1f78e2ff15c6e2b44e328f7686 100644 --- a/tasks/0069_939_69939978_qa_3/task.toml +++ b/tasks/0069_939_69939978_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0069_956_69956218_qa_3/environment/bootstrap.sh b/tasks/0069_956_69956218_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0069_956_69956218_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0069_956_69956218_qa_3/environment/pull_bucket.py b/tasks/0069_956_69956218_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0069_956_69956218_qa_3/environment/pull_bucket.py +++ b/tasks/0069_956_69956218_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0069_956_69956218_qa_3/task.toml b/tasks/0069_956_69956218_qa_3/task.toml index 1b9df9ffbd6b4a5d8be136933debbafd34024a0a..92988ed00c6ab1aeaf7c782ebcff6a609e261dd0 100644 --- a/tasks/0069_956_69956218_qa_3/task.toml +++ b/tasks/0069_956_69956218_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_045_70045525_qa_1/environment/bootstrap.sh b/tasks/0070_045_70045525_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_045_70045525_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_045_70045525_qa_1/environment/pull_bucket.py b/tasks/0070_045_70045525_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_045_70045525_qa_1/environment/pull_bucket.py +++ b/tasks/0070_045_70045525_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_045_70045525_qa_1/task.toml b/tasks/0070_045_70045525_qa_1/task.toml index 36d9fd89661bcb54a7af76fd19380f3727065ad6..57ada162d548ef2b164608f331ca9b29037b03ad 100644 --- a/tasks/0070_045_70045525_qa_1/task.toml +++ b/tasks/0070_045_70045525_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_120_70120425_qa_3/environment/bootstrap.sh b/tasks/0070_120_70120425_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_120_70120425_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_120_70120425_qa_3/environment/pull_bucket.py b/tasks/0070_120_70120425_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_120_70120425_qa_3/environment/pull_bucket.py +++ b/tasks/0070_120_70120425_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_120_70120425_qa_3/task.toml b/tasks/0070_120_70120425_qa_3/task.toml index fb3248fc05f5aff194222645294c6e2b10b9c012..c7e2b3cfed2ca1bb0a018a3b03dbbfe4579c8494 100644 --- a/tasks/0070_120_70120425_qa_3/task.toml +++ b/tasks/0070_120_70120425_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_120_70120425_qa_5/environment/bootstrap.sh b/tasks/0070_120_70120425_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_120_70120425_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_120_70120425_qa_5/environment/pull_bucket.py b/tasks/0070_120_70120425_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_120_70120425_qa_5/environment/pull_bucket.py +++ b/tasks/0070_120_70120425_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_120_70120425_qa_5/task.toml b/tasks/0070_120_70120425_qa_5/task.toml index 07f576b390ba49230e3193cbbc52eab08b1cb63e..2900b536cd5187de0a770da4efff55e3b20cf49a 100644 --- a/tasks/0070_120_70120425_qa_5/task.toml +++ b/tasks/0070_120_70120425_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_244_70244302_qa_3/environment/bootstrap.sh b/tasks/0070_244_70244302_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_244_70244302_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_244_70244302_qa_3/environment/pull_bucket.py b/tasks/0070_244_70244302_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_244_70244302_qa_3/environment/pull_bucket.py +++ b/tasks/0070_244_70244302_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_244_70244302_qa_3/task.toml b/tasks/0070_244_70244302_qa_3/task.toml index 68bd8470c27550c748d6600b51c8a987cf7ee9a4..94a0166776df5ae480a278686d1a34644c2733f8 100644 --- a/tasks/0070_244_70244302_qa_3/task.toml +++ b/tasks/0070_244_70244302_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_372_70372979_qa_4/environment/bootstrap.sh b/tasks/0070_372_70372979_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_372_70372979_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_372_70372979_qa_4/environment/pull_bucket.py b/tasks/0070_372_70372979_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_372_70372979_qa_4/environment/pull_bucket.py +++ b/tasks/0070_372_70372979_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_372_70372979_qa_4/task.toml b/tasks/0070_372_70372979_qa_4/task.toml index cb2ddf5a9d649a5f1abc8e4d72f28b5ea0c8f51b..dee174ddaf0c78b79294eb1abec627c943d949ee 100644 --- a/tasks/0070_372_70372979_qa_4/task.toml +++ b/tasks/0070_372_70372979_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_379_70379910_qa_2/environment/bootstrap.sh b/tasks/0070_379_70379910_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_379_70379910_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_379_70379910_qa_2/environment/pull_bucket.py b/tasks/0070_379_70379910_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_379_70379910_qa_2/environment/pull_bucket.py +++ b/tasks/0070_379_70379910_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_379_70379910_qa_2/task.toml b/tasks/0070_379_70379910_qa_2/task.toml index 3ec0b6ab99bbb7eebe97223cc5d4166b4e87cb65..453fc347c5b9f744501a42570e0cbcc52d4c55a2 100644 --- a/tasks/0070_379_70379910_qa_2/task.toml +++ b/tasks/0070_379_70379910_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_379_70379910_qa_5/environment/bootstrap.sh b/tasks/0070_379_70379910_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_379_70379910_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_379_70379910_qa_5/environment/pull_bucket.py b/tasks/0070_379_70379910_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_379_70379910_qa_5/environment/pull_bucket.py +++ b/tasks/0070_379_70379910_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_379_70379910_qa_5/task.toml b/tasks/0070_379_70379910_qa_5/task.toml index 4df7b61c2867f2d4f8f32a4ff216d6e560783ff9..daadf95e343bfd16033cdd1acb82b09f46fff682 100644 --- a/tasks/0070_379_70379910_qa_5/task.toml +++ b/tasks/0070_379_70379910_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_381_70381965_qa_4/environment/bootstrap.sh b/tasks/0070_381_70381965_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_381_70381965_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_381_70381965_qa_4/environment/pull_bucket.py b/tasks/0070_381_70381965_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_381_70381965_qa_4/environment/pull_bucket.py +++ b/tasks/0070_381_70381965_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_381_70381965_qa_4/task.toml b/tasks/0070_381_70381965_qa_4/task.toml index c8dbc825f1a244a2d0e23989e680efb9bb7a1215..607185d09501bc0f5a6d93d9f0ce8aeac752f87e 100644 --- a/tasks/0070_381_70381965_qa_4/task.toml +++ b/tasks/0070_381_70381965_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_381_70381965_qa_5/environment/bootstrap.sh b/tasks/0070_381_70381965_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_381_70381965_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_381_70381965_qa_5/environment/pull_bucket.py b/tasks/0070_381_70381965_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_381_70381965_qa_5/environment/pull_bucket.py +++ b/tasks/0070_381_70381965_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_381_70381965_qa_5/task.toml b/tasks/0070_381_70381965_qa_5/task.toml index 44b449963b84846d138852499bc2616a3fe14975..da83093481b4489a97df069f62cc1592c1170886 100644 --- a/tasks/0070_381_70381965_qa_5/task.toml +++ b/tasks/0070_381_70381965_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_420_70420149_qa_1/environment/bootstrap.sh b/tasks/0070_420_70420149_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_420_70420149_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_420_70420149_qa_1/environment/pull_bucket.py b/tasks/0070_420_70420149_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_420_70420149_qa_1/environment/pull_bucket.py +++ b/tasks/0070_420_70420149_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_420_70420149_qa_1/task.toml b/tasks/0070_420_70420149_qa_1/task.toml index bb660d96050d7204edf86fdc9a3fb160f46cf014..f8e8691d0d5833652a5462422ab17c59b309a63a 100644 --- a/tasks/0070_420_70420149_qa_1/task.toml +++ b/tasks/0070_420_70420149_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_420_70420149_qa_5/environment/bootstrap.sh b/tasks/0070_420_70420149_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_420_70420149_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_420_70420149_qa_5/environment/pull_bucket.py b/tasks/0070_420_70420149_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_420_70420149_qa_5/environment/pull_bucket.py +++ b/tasks/0070_420_70420149_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_420_70420149_qa_5/task.toml b/tasks/0070_420_70420149_qa_5/task.toml index ad1e1a15443bf133c99099d1d4071baa280150bb..302f1c0f34a0ab4ffe1f632fea9881a38c8a6892 100644 --- a/tasks/0070_420_70420149_qa_5/task.toml +++ b/tasks/0070_420_70420149_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_620_70620378_qa_5/environment/bootstrap.sh b/tasks/0070_620_70620378_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_620_70620378_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_620_70620378_qa_5/environment/pull_bucket.py b/tasks/0070_620_70620378_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_620_70620378_qa_5/environment/pull_bucket.py +++ b/tasks/0070_620_70620378_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_620_70620378_qa_5/task.toml b/tasks/0070_620_70620378_qa_5/task.toml index 044c32e86aa4df7453aee75083eb6f38eb8a1ec7..82811ac16eaf587cb2394508d4c4c9e08468bece 100644 --- a/tasks/0070_620_70620378_qa_5/task.toml +++ b/tasks/0070_620_70620378_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_655_70655259_qa_5/environment/bootstrap.sh b/tasks/0070_655_70655259_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_655_70655259_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_655_70655259_qa_5/environment/pull_bucket.py b/tasks/0070_655_70655259_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_655_70655259_qa_5/environment/pull_bucket.py +++ b/tasks/0070_655_70655259_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_655_70655259_qa_5/task.toml b/tasks/0070_655_70655259_qa_5/task.toml index 728c8978f23ee1d3c96deb78e8f6913d91a8cea9..6eadd424fcbad48170769177218768535e27e851 100644 --- a/tasks/0070_655_70655259_qa_5/task.toml +++ b/tasks/0070_655_70655259_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_784_70784112_qa_2/environment/bootstrap.sh b/tasks/0070_784_70784112_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_784_70784112_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_784_70784112_qa_2/environment/pull_bucket.py b/tasks/0070_784_70784112_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_784_70784112_qa_2/environment/pull_bucket.py +++ b/tasks/0070_784_70784112_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_784_70784112_qa_2/task.toml b/tasks/0070_784_70784112_qa_2/task.toml index dfce4924fd1654ff8e505ed837272b2c5cd422aa..cb93df0f6100314fef5f526fc5954b663bab2a83 100644 --- a/tasks/0070_784_70784112_qa_2/task.toml +++ b/tasks/0070_784_70784112_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_816_70816004_qa_3/environment/bootstrap.sh b/tasks/0070_816_70816004_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_816_70816004_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_816_70816004_qa_3/environment/pull_bucket.py b/tasks/0070_816_70816004_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_816_70816004_qa_3/environment/pull_bucket.py +++ b/tasks/0070_816_70816004_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_816_70816004_qa_3/task.toml b/tasks/0070_816_70816004_qa_3/task.toml index 1d3b79abb9530995dba50be65aada15faa122724..2a6e8ebfd8d9745c02935defe744454948948218 100644 --- a/tasks/0070_816_70816004_qa_3/task.toml +++ b/tasks/0070_816_70816004_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_874_70874122_qa_5/environment/bootstrap.sh b/tasks/0070_874_70874122_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_874_70874122_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_874_70874122_qa_5/environment/pull_bucket.py b/tasks/0070_874_70874122_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_874_70874122_qa_5/environment/pull_bucket.py +++ b/tasks/0070_874_70874122_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_874_70874122_qa_5/task.toml b/tasks/0070_874_70874122_qa_5/task.toml index 97f4aa9c32089495e9edfafa486e360a36a7e470..43ed57a5547c19e9771edc37eefd479eaf33f08c 100644 --- a/tasks/0070_874_70874122_qa_5/task.toml +++ b/tasks/0070_874_70874122_qa_5/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_908_70908084_qa_2/environment/bootstrap.sh b/tasks/0070_908_70908084_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_908_70908084_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_908_70908084_qa_2/environment/pull_bucket.py b/tasks/0070_908_70908084_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_908_70908084_qa_2/environment/pull_bucket.py +++ b/tasks/0070_908_70908084_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_908_70908084_qa_2/task.toml b/tasks/0070_908_70908084_qa_2/task.toml index 40bd1b462761e28e2053a6ef8b61010526ae1ab7..c4e45f75930808a53ea8735613a5ecc1167cf457 100644 --- a/tasks/0070_908_70908084_qa_2/task.toml +++ b/tasks/0070_908_70908084_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_908_70908084_qa_4/environment/bootstrap.sh b/tasks/0070_908_70908084_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_908_70908084_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_908_70908084_qa_4/environment/pull_bucket.py b/tasks/0070_908_70908084_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_908_70908084_qa_4/environment/pull_bucket.py +++ b/tasks/0070_908_70908084_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_908_70908084_qa_4/task.toml b/tasks/0070_908_70908084_qa_4/task.toml index 14dc2195e8f08da1300dd968d11e11ba44a7b002..96b2e782d2fb95a50383d149cbb1cd3d715a9065 100644 --- a/tasks/0070_908_70908084_qa_4/task.toml +++ b/tasks/0070_908_70908084_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_945_70945386_qa_3/environment/bootstrap.sh b/tasks/0070_945_70945386_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_945_70945386_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_945_70945386_qa_3/environment/pull_bucket.py b/tasks/0070_945_70945386_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_945_70945386_qa_3/environment/pull_bucket.py +++ b/tasks/0070_945_70945386_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_945_70945386_qa_3/task.toml b/tasks/0070_945_70945386_qa_3/task.toml index 9c0e26759d75597c86b452d70cfdb34e7ffacd3a..c6065a32be19f14c4e786a53b6fa7055bfab1665 100644 --- a/tasks/0070_945_70945386_qa_3/task.toml +++ b/tasks/0070_945_70945386_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_945_70945386_qa_4/environment/bootstrap.sh b/tasks/0070_945_70945386_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_945_70945386_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_945_70945386_qa_4/environment/pull_bucket.py b/tasks/0070_945_70945386_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_945_70945386_qa_4/environment/pull_bucket.py +++ b/tasks/0070_945_70945386_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_945_70945386_qa_4/task.toml b/tasks/0070_945_70945386_qa_4/task.toml index afd8cb8b4ac98a53929a5008b3a75fc120a2d95b..b8b58e4b3569928e7947d714ed7650acebb17bae 100644 --- a/tasks/0070_945_70945386_qa_4/task.toml +++ b/tasks/0070_945_70945386_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_989_70989704_qa_1/environment/bootstrap.sh b/tasks/0070_989_70989704_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_989_70989704_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_989_70989704_qa_1/environment/pull_bucket.py b/tasks/0070_989_70989704_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_989_70989704_qa_1/environment/pull_bucket.py +++ b/tasks/0070_989_70989704_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_989_70989704_qa_1/task.toml b/tasks/0070_989_70989704_qa_1/task.toml index 908f48808584b287a7a2e65cc2f970c8af9788ee..5af26d5844c5f6fd6e8009bd14a714fda7659d7e 100644 --- a/tasks/0070_989_70989704_qa_1/task.toml +++ b/tasks/0070_989_70989704_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0070_990_70990012_qa_1/environment/bootstrap.sh b/tasks/0070_990_70990012_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0070_990_70990012_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0070_990_70990012_qa_1/environment/pull_bucket.py b/tasks/0070_990_70990012_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0070_990_70990012_qa_1/environment/pull_bucket.py +++ b/tasks/0070_990_70990012_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0070_990_70990012_qa_1/task.toml b/tasks/0070_990_70990012_qa_1/task.toml index edc9ca2a96bd0ca5b03248bee19394b07c69028f..8a674b38127061c22acc1c087cf82d1fdb212864 100644 --- a/tasks/0070_990_70990012_qa_1/task.toml +++ b/tasks/0070_990_70990012_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_055_71055191_qa_1/environment/bootstrap.sh b/tasks/0071_055_71055191_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_055_71055191_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_055_71055191_qa_1/environment/pull_bucket.py b/tasks/0071_055_71055191_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_055_71055191_qa_1/environment/pull_bucket.py +++ b/tasks/0071_055_71055191_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_055_71055191_qa_1/task.toml b/tasks/0071_055_71055191_qa_1/task.toml index 7714fe6b282adb210123b47b4be77840be25cd33..d16bcd25968c6b28e7fc47bf2bb523b6c987de71 100644 --- a/tasks/0071_055_71055191_qa_1/task.toml +++ b/tasks/0071_055_71055191_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_091_71091389_qa_2/environment/bootstrap.sh b/tasks/0071_091_71091389_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_091_71091389_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_091_71091389_qa_2/environment/pull_bucket.py b/tasks/0071_091_71091389_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_091_71091389_qa_2/environment/pull_bucket.py +++ b/tasks/0071_091_71091389_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_091_71091389_qa_2/task.toml b/tasks/0071_091_71091389_qa_2/task.toml index bfbdab0e82b7649e0b3cd568c76f40f924b38aaf..4fed711aed4fa7dbe15841dff489e53b7e2e8dc1 100644 --- a/tasks/0071_091_71091389_qa_2/task.toml +++ b/tasks/0071_091_71091389_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_225_71225358_qa_3/environment/bootstrap.sh b/tasks/0071_225_71225358_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_225_71225358_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_225_71225358_qa_3/environment/pull_bucket.py b/tasks/0071_225_71225358_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_225_71225358_qa_3/environment/pull_bucket.py +++ b/tasks/0071_225_71225358_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_225_71225358_qa_3/task.toml b/tasks/0071_225_71225358_qa_3/task.toml index e2a3c94c5d7df9568a01100af412b37e62932652..b5dee8e2fb0aa6803eaff9eb9c04dce2052be85f 100644 --- a/tasks/0071_225_71225358_qa_3/task.toml +++ b/tasks/0071_225_71225358_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_254_71254255_qa_2/environment/bootstrap.sh b/tasks/0071_254_71254255_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_254_71254255_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_254_71254255_qa_2/environment/pull_bucket.py b/tasks/0071_254_71254255_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_254_71254255_qa_2/environment/pull_bucket.py +++ b/tasks/0071_254_71254255_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_254_71254255_qa_2/task.toml b/tasks/0071_254_71254255_qa_2/task.toml index 89f2d399535ace331c92dbdd16f467ac4125a037..b819264a3fce41f3a24997b498f7829bf33c21f3 100644 --- a/tasks/0071_254_71254255_qa_2/task.toml +++ b/tasks/0071_254_71254255_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_397_71397798_qa_2/environment/bootstrap.sh b/tasks/0071_397_71397798_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_397_71397798_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_397_71397798_qa_2/environment/pull_bucket.py b/tasks/0071_397_71397798_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_397_71397798_qa_2/environment/pull_bucket.py +++ b/tasks/0071_397_71397798_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_397_71397798_qa_2/task.toml b/tasks/0071_397_71397798_qa_2/task.toml index bd71a796099a4b3a2b6e4d2aec64b875090c2971..32498a65bf31644501b82fe4ad163271cd3d261a 100644 --- a/tasks/0071_397_71397798_qa_2/task.toml +++ b/tasks/0071_397_71397798_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_437_71437256_qa_3/environment/bootstrap.sh b/tasks/0071_437_71437256_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_437_71437256_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_437_71437256_qa_3/environment/pull_bucket.py b/tasks/0071_437_71437256_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_437_71437256_qa_3/environment/pull_bucket.py +++ b/tasks/0071_437_71437256_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_437_71437256_qa_3/task.toml b/tasks/0071_437_71437256_qa_3/task.toml index 307c75114d05dddd67165f8a6431f25decc2aeb0..8707e831e5df9d2627c5618c2f17f7bc8c396dd9 100644 --- a/tasks/0071_437_71437256_qa_3/task.toml +++ b/tasks/0071_437_71437256_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_540_71540621_qa_4/environment/bootstrap.sh b/tasks/0071_540_71540621_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_540_71540621_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_540_71540621_qa_4/environment/pull_bucket.py b/tasks/0071_540_71540621_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_540_71540621_qa_4/environment/pull_bucket.py +++ b/tasks/0071_540_71540621_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_540_71540621_qa_4/task.toml b/tasks/0071_540_71540621_qa_4/task.toml index bbb71abde0d1fba8c1295634e43798d572008fb4..5a817c4d251afffdf6e6819e478153e89318b8a5 100644 --- a/tasks/0071_540_71540621_qa_4/task.toml +++ b/tasks/0071_540_71540621_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_543_71543992_qa_2/environment/bootstrap.sh b/tasks/0071_543_71543992_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_543_71543992_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_543_71543992_qa_2/environment/pull_bucket.py b/tasks/0071_543_71543992_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_543_71543992_qa_2/environment/pull_bucket.py +++ b/tasks/0071_543_71543992_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_543_71543992_qa_2/task.toml b/tasks/0071_543_71543992_qa_2/task.toml index 6ed27c03c40bee53758b41a6df24984f40937572..ac3a75075b1fa3ecbfbdd4337c57d31418946ff2 100644 --- a/tasks/0071_543_71543992_qa_2/task.toml +++ b/tasks/0071_543_71543992_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_543_71543992_qa_4/environment/bootstrap.sh b/tasks/0071_543_71543992_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_543_71543992_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_543_71543992_qa_4/environment/pull_bucket.py b/tasks/0071_543_71543992_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_543_71543992_qa_4/environment/pull_bucket.py +++ b/tasks/0071_543_71543992_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_543_71543992_qa_4/task.toml b/tasks/0071_543_71543992_qa_4/task.toml index 5886150c6f3fce7964b2cc5554a764a7e475c251..801c4b0c5ed7f080873050d631c828b0511b9f28 100644 --- a/tasks/0071_543_71543992_qa_4/task.toml +++ b/tasks/0071_543_71543992_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_619_71619618_qa_1/environment/bootstrap.sh b/tasks/0071_619_71619618_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_619_71619618_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_619_71619618_qa_1/environment/pull_bucket.py b/tasks/0071_619_71619618_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_619_71619618_qa_1/environment/pull_bucket.py +++ b/tasks/0071_619_71619618_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_619_71619618_qa_1/task.toml b/tasks/0071_619_71619618_qa_1/task.toml index 06b95ef492fd0aa5c3c2b5bb2be74e2f016e2490..7b06c3935b30e6329f4cb9cd8da25523facbd34e 100644 --- a/tasks/0071_619_71619618_qa_1/task.toml +++ b/tasks/0071_619_71619618_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_776_71776442_qa_2/environment/bootstrap.sh b/tasks/0071_776_71776442_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_776_71776442_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_776_71776442_qa_2/environment/pull_bucket.py b/tasks/0071_776_71776442_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_776_71776442_qa_2/environment/pull_bucket.py +++ b/tasks/0071_776_71776442_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_776_71776442_qa_2/task.toml b/tasks/0071_776_71776442_qa_2/task.toml index c4b606dabb18079f0114cccfd2a732e4c63ead88..4d3bb714801e1b256b26ee27a5c53af04d7f3631 100644 --- a/tasks/0071_776_71776442_qa_2/task.toml +++ b/tasks/0071_776_71776442_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_776_71776442_qa_3/environment/bootstrap.sh b/tasks/0071_776_71776442_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_776_71776442_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_776_71776442_qa_3/environment/pull_bucket.py b/tasks/0071_776_71776442_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_776_71776442_qa_3/environment/pull_bucket.py +++ b/tasks/0071_776_71776442_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_776_71776442_qa_3/task.toml b/tasks/0071_776_71776442_qa_3/task.toml index 878419bda6222676d2df5e69cc9cd2ab76c6a885..6380d58cc715a90bb753c22adf7e7ada5b281751 100644 --- a/tasks/0071_776_71776442_qa_3/task.toml +++ b/tasks/0071_776_71776442_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_785_71785724_qa_4/environment/bootstrap.sh b/tasks/0071_785_71785724_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_785_71785724_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_785_71785724_qa_4/environment/pull_bucket.py b/tasks/0071_785_71785724_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_785_71785724_qa_4/environment/pull_bucket.py +++ b/tasks/0071_785_71785724_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_785_71785724_qa_4/task.toml b/tasks/0071_785_71785724_qa_4/task.toml index 7d07512cf60da774f0a3c02f5cd94b1611f782fb..dec8bc762d0235b1f0e5b95e6767ecbfb3d7fb31 100644 --- a/tasks/0071_785_71785724_qa_4/task.toml +++ b/tasks/0071_785_71785724_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_785_71785724_qa_5/environment/bootstrap.sh b/tasks/0071_785_71785724_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_785_71785724_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_785_71785724_qa_5/environment/pull_bucket.py b/tasks/0071_785_71785724_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_785_71785724_qa_5/environment/pull_bucket.py +++ b/tasks/0071_785_71785724_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_785_71785724_qa_5/task.toml b/tasks/0071_785_71785724_qa_5/task.toml index 35872e2f8d8bf98d8cbe84b200c02342b485b268..ed909dd02955f795d3cfd9ed1a03a95ce92fa7d2 100644 --- a/tasks/0071_785_71785724_qa_5/task.toml +++ b/tasks/0071_785_71785724_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_835_71835908_qa_1/environment/bootstrap.sh b/tasks/0071_835_71835908_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_835_71835908_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_835_71835908_qa_1/environment/pull_bucket.py b/tasks/0071_835_71835908_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_835_71835908_qa_1/environment/pull_bucket.py +++ b/tasks/0071_835_71835908_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_835_71835908_qa_1/task.toml b/tasks/0071_835_71835908_qa_1/task.toml index 7bfb019604986b7e19ee90640d66b28b01f2f86c..60fe0554fcdf9fadc59e325452c64de767f6671c 100644 --- a/tasks/0071_835_71835908_qa_1/task.toml +++ b/tasks/0071_835_71835908_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_835_71835908_qa_3/environment/bootstrap.sh b/tasks/0071_835_71835908_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_835_71835908_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_835_71835908_qa_3/environment/pull_bucket.py b/tasks/0071_835_71835908_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_835_71835908_qa_3/environment/pull_bucket.py +++ b/tasks/0071_835_71835908_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_835_71835908_qa_3/task.toml b/tasks/0071_835_71835908_qa_3/task.toml index 0a8d2ce714bea817785ea3a31e72828f28325a7d..31b7632ef23a93fa8f2b250457cec98b19352ebe 100644 --- a/tasks/0071_835_71835908_qa_3/task.toml +++ b/tasks/0071_835_71835908_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_845_71845804_qa_1/environment/bootstrap.sh b/tasks/0071_845_71845804_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_845_71845804_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_845_71845804_qa_1/environment/pull_bucket.py b/tasks/0071_845_71845804_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_845_71845804_qa_1/environment/pull_bucket.py +++ b/tasks/0071_845_71845804_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_845_71845804_qa_1/task.toml b/tasks/0071_845_71845804_qa_1/task.toml index f847cfb1f8317edf6bc2c8baa1f19317379c8915..d8583339bf1c8a94524ab0e183f47101ead8c3d3 100644 --- a/tasks/0071_845_71845804_qa_1/task.toml +++ b/tasks/0071_845_71845804_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_845_71845804_qa_3/environment/bootstrap.sh b/tasks/0071_845_71845804_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_845_71845804_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_845_71845804_qa_3/environment/pull_bucket.py b/tasks/0071_845_71845804_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_845_71845804_qa_3/environment/pull_bucket.py +++ b/tasks/0071_845_71845804_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_845_71845804_qa_3/task.toml b/tasks/0071_845_71845804_qa_3/task.toml index 54a8bfcf7b61fffb4a34632df181e7864f2da9a5..e935ebe84f374e557a8701648b22de5042827d2d 100644 --- a/tasks/0071_845_71845804_qa_3/task.toml +++ b/tasks/0071_845_71845804_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_845_71845804_qa_5/environment/bootstrap.sh b/tasks/0071_845_71845804_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_845_71845804_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_845_71845804_qa_5/environment/pull_bucket.py b/tasks/0071_845_71845804_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_845_71845804_qa_5/environment/pull_bucket.py +++ b/tasks/0071_845_71845804_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_845_71845804_qa_5/task.toml b/tasks/0071_845_71845804_qa_5/task.toml index 746ea0f755150b59f74a30922baa5d196bc4366f..856a011758af31e9d79f6a85d89cae1277054d7d 100644 --- a/tasks/0071_845_71845804_qa_5/task.toml +++ b/tasks/0071_845_71845804_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_909_71909129_qa_1/environment/bootstrap.sh b/tasks/0071_909_71909129_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_909_71909129_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_909_71909129_qa_1/environment/pull_bucket.py b/tasks/0071_909_71909129_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_909_71909129_qa_1/environment/pull_bucket.py +++ b/tasks/0071_909_71909129_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_909_71909129_qa_1/task.toml b/tasks/0071_909_71909129_qa_1/task.toml index 3bab5161cb13450b71a805bc61c3558c8e70906e..8ffcf04c20ea0f146cb50b5d1345a94324b7c93c 100644 --- a/tasks/0071_909_71909129_qa_1/task.toml +++ b/tasks/0071_909_71909129_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_909_71909129_qa_2/environment/bootstrap.sh b/tasks/0071_909_71909129_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_909_71909129_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_909_71909129_qa_2/environment/pull_bucket.py b/tasks/0071_909_71909129_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_909_71909129_qa_2/environment/pull_bucket.py +++ b/tasks/0071_909_71909129_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_909_71909129_qa_2/task.toml b/tasks/0071_909_71909129_qa_2/task.toml index f6af040b8cd0ee648aa26ac81d678f2bc88bc175..1aded94fadaf53a40dc3f63d70c531ef04264d49 100644 --- a/tasks/0071_909_71909129_qa_2/task.toml +++ b/tasks/0071_909_71909129_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_909_71909129_qa_5/environment/bootstrap.sh b/tasks/0071_909_71909129_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_909_71909129_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_909_71909129_qa_5/environment/pull_bucket.py b/tasks/0071_909_71909129_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_909_71909129_qa_5/environment/pull_bucket.py +++ b/tasks/0071_909_71909129_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_909_71909129_qa_5/task.toml b/tasks/0071_909_71909129_qa_5/task.toml index de3a3c9844c3f14331e2572b31ebd8996d76bbc2..ecd107c9338fce53d4b098370be9c4959c581786 100644 --- a/tasks/0071_909_71909129_qa_5/task.toml +++ b/tasks/0071_909_71909129_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_997_71997138_qa_3/environment/bootstrap.sh b/tasks/0071_997_71997138_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_997_71997138_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_997_71997138_qa_3/environment/pull_bucket.py b/tasks/0071_997_71997138_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_997_71997138_qa_3/environment/pull_bucket.py +++ b/tasks/0071_997_71997138_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_997_71997138_qa_3/task.toml b/tasks/0071_997_71997138_qa_3/task.toml index 3bb43919bbebbcb696eccee6a9e2bd747f89d354..f789360e2076dfa6e1d335c212f2ef2350947e90 100644 --- a/tasks/0071_997_71997138_qa_3/task.toml +++ b/tasks/0071_997_71997138_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0071_997_71997138_qa_5/environment/bootstrap.sh b/tasks/0071_997_71997138_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0071_997_71997138_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0071_997_71997138_qa_5/environment/pull_bucket.py b/tasks/0071_997_71997138_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0071_997_71997138_qa_5/environment/pull_bucket.py +++ b/tasks/0071_997_71997138_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0071_997_71997138_qa_5/task.toml b/tasks/0071_997_71997138_qa_5/task.toml index 3fcf5f515654d65cb476c1e31dede51c7f9ece4d..e9752fffeb28f459817bd14cf8f01df5326772dd 100644 --- a/tasks/0071_997_71997138_qa_5/task.toml +++ b/tasks/0071_997_71997138_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_066_72066220_qa_1/environment/bootstrap.sh b/tasks/0072_066_72066220_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_066_72066220_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_066_72066220_qa_1/environment/pull_bucket.py b/tasks/0072_066_72066220_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_066_72066220_qa_1/environment/pull_bucket.py +++ b/tasks/0072_066_72066220_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_066_72066220_qa_1/task.toml b/tasks/0072_066_72066220_qa_1/task.toml index 4d3e6eda199a63618cf18e66becdca797b57e137..c1079b8e6fa5a98aacc7b6e39c2c3a8c4d9de654 100644 --- a/tasks/0072_066_72066220_qa_1/task.toml +++ b/tasks/0072_066_72066220_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_071_72071082_qa_1/environment/bootstrap.sh b/tasks/0072_071_72071082_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_071_72071082_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_071_72071082_qa_1/environment/pull_bucket.py b/tasks/0072_071_72071082_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_071_72071082_qa_1/environment/pull_bucket.py +++ b/tasks/0072_071_72071082_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_071_72071082_qa_1/task.toml b/tasks/0072_071_72071082_qa_1/task.toml index 1051d0b3cd4238b845d50aec360f97b3fffa8f5c..364617d6237623ddfa3e1332dc24a00d6c37ae52 100644 --- a/tasks/0072_071_72071082_qa_1/task.toml +++ b/tasks/0072_071_72071082_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_071_72071082_qa_5/environment/bootstrap.sh b/tasks/0072_071_72071082_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_071_72071082_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_071_72071082_qa_5/environment/pull_bucket.py b/tasks/0072_071_72071082_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_071_72071082_qa_5/environment/pull_bucket.py +++ b/tasks/0072_071_72071082_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_071_72071082_qa_5/task.toml b/tasks/0072_071_72071082_qa_5/task.toml index 4c26b5f3dc5b4d9bf5eb5cf772ba0ed4b1579842..fd0d19422fc64233696e850fb800102b5358911d 100644 --- a/tasks/0072_071_72071082_qa_5/task.toml +++ b/tasks/0072_071_72071082_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_108_72108430_qa_3/environment/bootstrap.sh b/tasks/0072_108_72108430_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_108_72108430_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_108_72108430_qa_3/environment/pull_bucket.py b/tasks/0072_108_72108430_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_108_72108430_qa_3/environment/pull_bucket.py +++ b/tasks/0072_108_72108430_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_108_72108430_qa_3/task.toml b/tasks/0072_108_72108430_qa_3/task.toml index d369b62457846c33fa71e7a910fcdac73bc36387..386c9d033990ec9f784bd118ed97139ae0ae156a 100644 --- a/tasks/0072_108_72108430_qa_3/task.toml +++ b/tasks/0072_108_72108430_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_182_72182036_qa_3/environment/bootstrap.sh b/tasks/0072_182_72182036_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_182_72182036_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_182_72182036_qa_3/environment/pull_bucket.py b/tasks/0072_182_72182036_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_182_72182036_qa_3/environment/pull_bucket.py +++ b/tasks/0072_182_72182036_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_182_72182036_qa_3/task.toml b/tasks/0072_182_72182036_qa_3/task.toml index bfbdeb4eb83b447e8244216fd29e0b08987f9353..5988cf0a6b0e45c6a6e879987e01b48c8a783d9d 100644 --- a/tasks/0072_182_72182036_qa_3/task.toml +++ b/tasks/0072_182_72182036_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_216_72216676_qa_1/environment/bootstrap.sh b/tasks/0072_216_72216676_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_216_72216676_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_216_72216676_qa_1/environment/pull_bucket.py b/tasks/0072_216_72216676_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_216_72216676_qa_1/environment/pull_bucket.py +++ b/tasks/0072_216_72216676_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_216_72216676_qa_1/task.toml b/tasks/0072_216_72216676_qa_1/task.toml index e2919685f58311b288ae698b9d2c19c9d63cb48e..01ea5b14b8e6ffdc851093dd4c8b476c9dc8a080 100644 --- a/tasks/0072_216_72216676_qa_1/task.toml +++ b/tasks/0072_216_72216676_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_216_72216676_qa_4/environment/bootstrap.sh b/tasks/0072_216_72216676_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_216_72216676_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_216_72216676_qa_4/environment/pull_bucket.py b/tasks/0072_216_72216676_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_216_72216676_qa_4/environment/pull_bucket.py +++ b/tasks/0072_216_72216676_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_216_72216676_qa_4/task.toml b/tasks/0072_216_72216676_qa_4/task.toml index dcaf28ea2c8ce37b320416bc798202709b539463..ba9b021bef12dc392c7df028a55e965f00262711 100644 --- a/tasks/0072_216_72216676_qa_4/task.toml +++ b/tasks/0072_216_72216676_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_403_72403187_qa_1/environment/bootstrap.sh b/tasks/0072_403_72403187_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_403_72403187_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_403_72403187_qa_1/environment/pull_bucket.py b/tasks/0072_403_72403187_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_403_72403187_qa_1/environment/pull_bucket.py +++ b/tasks/0072_403_72403187_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_403_72403187_qa_1/task.toml b/tasks/0072_403_72403187_qa_1/task.toml index c3066b73decd2503ec10cd728fa255ecd8ea0164..a91fd322aee066e84662df7006009446932bae14 100644 --- a/tasks/0072_403_72403187_qa_1/task.toml +++ b/tasks/0072_403_72403187_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_471_72471518_qa_1/environment/bootstrap.sh b/tasks/0072_471_72471518_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_471_72471518_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_471_72471518_qa_1/environment/pull_bucket.py b/tasks/0072_471_72471518_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_471_72471518_qa_1/environment/pull_bucket.py +++ b/tasks/0072_471_72471518_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_471_72471518_qa_1/task.toml b/tasks/0072_471_72471518_qa_1/task.toml index bcfa34887871ccac5ab0f8e21f171988daa8bcdb..40ccaf9b7e38a1a00d592b3cc003bf79458cc5f5 100644 --- a/tasks/0072_471_72471518_qa_1/task.toml +++ b/tasks/0072_471_72471518_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_471_72471518_qa_3/environment/bootstrap.sh b/tasks/0072_471_72471518_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_471_72471518_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_471_72471518_qa_3/environment/pull_bucket.py b/tasks/0072_471_72471518_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_471_72471518_qa_3/environment/pull_bucket.py +++ b/tasks/0072_471_72471518_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_471_72471518_qa_3/task.toml b/tasks/0072_471_72471518_qa_3/task.toml index 7ba3c6803170750fb2eb9a465b2d103bab1e7b0c..df0edced91b25396455a6cf6063e75185c3082c1 100644 --- a/tasks/0072_471_72471518_qa_3/task.toml +++ b/tasks/0072_471_72471518_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_478_72478480_qa_4/environment/bootstrap.sh b/tasks/0072_478_72478480_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_478_72478480_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_478_72478480_qa_4/environment/pull_bucket.py b/tasks/0072_478_72478480_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_478_72478480_qa_4/environment/pull_bucket.py +++ b/tasks/0072_478_72478480_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_478_72478480_qa_4/task.toml b/tasks/0072_478_72478480_qa_4/task.toml index 3a753504f82eb9b05aba7978341969db65fe1e78..7af0597efbe56edca1d98d9dcac25e0f4a07ba2c 100644 --- a/tasks/0072_478_72478480_qa_4/task.toml +++ b/tasks/0072_478_72478480_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_665_72665847_qa_1/environment/bootstrap.sh b/tasks/0072_665_72665847_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_665_72665847_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_665_72665847_qa_1/environment/pull_bucket.py b/tasks/0072_665_72665847_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_665_72665847_qa_1/environment/pull_bucket.py +++ b/tasks/0072_665_72665847_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_665_72665847_qa_1/task.toml b/tasks/0072_665_72665847_qa_1/task.toml index 48e33d5b3dce233fac34ad5e83ce5d927f085ee0..03b3f603a1cc4b943b8daceaba98ff2711d2b1fd 100644 --- a/tasks/0072_665_72665847_qa_1/task.toml +++ b/tasks/0072_665_72665847_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_665_72665847_qa_5/environment/bootstrap.sh b/tasks/0072_665_72665847_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_665_72665847_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_665_72665847_qa_5/environment/pull_bucket.py b/tasks/0072_665_72665847_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_665_72665847_qa_5/environment/pull_bucket.py +++ b/tasks/0072_665_72665847_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_665_72665847_qa_5/task.toml b/tasks/0072_665_72665847_qa_5/task.toml index 8deea8404017834e3008dd8b4953ccb469b47a02..5aa19cb87b41ed8cbbaa3c3d0c8b258408e20048 100644 --- a/tasks/0072_665_72665847_qa_5/task.toml +++ b/tasks/0072_665_72665847_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_767_72767167_qa_1/environment/bootstrap.sh b/tasks/0072_767_72767167_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_767_72767167_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_767_72767167_qa_1/environment/pull_bucket.py b/tasks/0072_767_72767167_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_767_72767167_qa_1/environment/pull_bucket.py +++ b/tasks/0072_767_72767167_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_767_72767167_qa_1/task.toml b/tasks/0072_767_72767167_qa_1/task.toml index 704bb045ed8c253e9060c65447d36d76f3f8c1de..90d6c640a027d9aaf2db3f7e07cec642807cc888 100644 --- a/tasks/0072_767_72767167_qa_1/task.toml +++ b/tasks/0072_767_72767167_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_789_72789077_qa_1/environment/bootstrap.sh b/tasks/0072_789_72789077_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_789_72789077_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_789_72789077_qa_1/environment/pull_bucket.py b/tasks/0072_789_72789077_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_789_72789077_qa_1/environment/pull_bucket.py +++ b/tasks/0072_789_72789077_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_789_72789077_qa_1/task.toml b/tasks/0072_789_72789077_qa_1/task.toml index 1ebf0b4b4e81a7cbefa0ecda037ff2df3d3a4b05..e5d2dcc23479b8bc6a90ba00dd21796725069450 100644 --- a/tasks/0072_789_72789077_qa_1/task.toml +++ b/tasks/0072_789_72789077_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_789_72789077_qa_4/environment/bootstrap.sh b/tasks/0072_789_72789077_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_789_72789077_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_789_72789077_qa_4/environment/pull_bucket.py b/tasks/0072_789_72789077_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_789_72789077_qa_4/environment/pull_bucket.py +++ b/tasks/0072_789_72789077_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_789_72789077_qa_4/task.toml b/tasks/0072_789_72789077_qa_4/task.toml index eb68d978387de01439e9477961f668dffca1c54e..59cb94fe179f855436d1d9ce8b082feec97659b9 100644 --- a/tasks/0072_789_72789077_qa_4/task.toml +++ b/tasks/0072_789_72789077_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_839_72839930_qa_3/environment/bootstrap.sh b/tasks/0072_839_72839930_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_839_72839930_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_839_72839930_qa_3/environment/pull_bucket.py b/tasks/0072_839_72839930_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_839_72839930_qa_3/environment/pull_bucket.py +++ b/tasks/0072_839_72839930_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_839_72839930_qa_3/task.toml b/tasks/0072_839_72839930_qa_3/task.toml index 5ec25142070d49c0cabcb2498b39bedaf88f4d28..256a755493fb669917ff0240d848833f4685758e 100644 --- a/tasks/0072_839_72839930_qa_3/task.toml +++ b/tasks/0072_839_72839930_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_866_72866029_qa_5/environment/bootstrap.sh b/tasks/0072_866_72866029_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_866_72866029_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_866_72866029_qa_5/environment/pull_bucket.py b/tasks/0072_866_72866029_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_866_72866029_qa_5/environment/pull_bucket.py +++ b/tasks/0072_866_72866029_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_866_72866029_qa_5/task.toml b/tasks/0072_866_72866029_qa_5/task.toml index 231719d96260a98d09b192032edacc42278e99ea..d5f51f622517b7257a56aa982e6b6930c56377fb 100644 --- a/tasks/0072_866_72866029_qa_5/task.toml +++ b/tasks/0072_866_72866029_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_933_72933038_qa_4/environment/bootstrap.sh b/tasks/0072_933_72933038_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_933_72933038_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_933_72933038_qa_4/environment/pull_bucket.py b/tasks/0072_933_72933038_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_933_72933038_qa_4/environment/pull_bucket.py +++ b/tasks/0072_933_72933038_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_933_72933038_qa_4/task.toml b/tasks/0072_933_72933038_qa_4/task.toml index 47e988a5d8c44cbf261724a95a441cdac4192f7b..859b46117377314d8b5bd55e677e76c166be1fb8 100644 --- a/tasks/0072_933_72933038_qa_4/task.toml +++ b/tasks/0072_933_72933038_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_950_72950290_qa_2/environment/bootstrap.sh b/tasks/0072_950_72950290_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_950_72950290_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_950_72950290_qa_2/environment/pull_bucket.py b/tasks/0072_950_72950290_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_950_72950290_qa_2/environment/pull_bucket.py +++ b/tasks/0072_950_72950290_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_950_72950290_qa_2/task.toml b/tasks/0072_950_72950290_qa_2/task.toml index 0528a3d96774426da363715db8c2398972e26c2b..69b3e2e0462bec20dff7b379fd59595c8fa52a92 100644 --- a/tasks/0072_950_72950290_qa_2/task.toml +++ b/tasks/0072_950_72950290_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0072_990_72990356_qa_1/environment/bootstrap.sh b/tasks/0072_990_72990356_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0072_990_72990356_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0072_990_72990356_qa_1/environment/pull_bucket.py b/tasks/0072_990_72990356_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0072_990_72990356_qa_1/environment/pull_bucket.py +++ b/tasks/0072_990_72990356_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0072_990_72990356_qa_1/task.toml b/tasks/0072_990_72990356_qa_1/task.toml index a30c84eff4a8bbe06efde1bf126f516cd43097d5..d6efcb04df3b80e1099562e1868d6c2523692f35 100644 --- a/tasks/0072_990_72990356_qa_1/task.toml +++ b/tasks/0072_990_72990356_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_093_73093411_qa_4/environment/bootstrap.sh b/tasks/0073_093_73093411_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_093_73093411_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_093_73093411_qa_4/environment/pull_bucket.py b/tasks/0073_093_73093411_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_093_73093411_qa_4/environment/pull_bucket.py +++ b/tasks/0073_093_73093411_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_093_73093411_qa_4/task.toml b/tasks/0073_093_73093411_qa_4/task.toml index 572df40c0669df23f83d12dbf8fd824ab39551c2..9774fd4d1d1d5f37a12b47fbb5dc723e98619b29 100644 --- a/tasks/0073_093_73093411_qa_4/task.toml +++ b/tasks/0073_093_73093411_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_125_73125764_qa_5/environment/bootstrap.sh b/tasks/0073_125_73125764_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_125_73125764_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_125_73125764_qa_5/environment/pull_bucket.py b/tasks/0073_125_73125764_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_125_73125764_qa_5/environment/pull_bucket.py +++ b/tasks/0073_125_73125764_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_125_73125764_qa_5/task.toml b/tasks/0073_125_73125764_qa_5/task.toml index 8bffd61e1ea5f63c94c3e6ce44994b3a3688ab69..a3fa1ffd92026838b023feb91305d13afbfad78f 100644 --- a/tasks/0073_125_73125764_qa_5/task.toml +++ b/tasks/0073_125_73125764_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_138_73138449_qa_1/environment/bootstrap.sh b/tasks/0073_138_73138449_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_138_73138449_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_138_73138449_qa_1/environment/pull_bucket.py b/tasks/0073_138_73138449_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_138_73138449_qa_1/environment/pull_bucket.py +++ b/tasks/0073_138_73138449_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_138_73138449_qa_1/task.toml b/tasks/0073_138_73138449_qa_1/task.toml index fc2076ef623284ed529c695b75f8b9f4de7dc576..3bf089399ef05ea515f31e84a36bcba10ff0c322 100644 --- a/tasks/0073_138_73138449_qa_1/task.toml +++ b/tasks/0073_138_73138449_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_138_73138449_qa_5/environment/bootstrap.sh b/tasks/0073_138_73138449_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_138_73138449_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_138_73138449_qa_5/environment/pull_bucket.py b/tasks/0073_138_73138449_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_138_73138449_qa_5/environment/pull_bucket.py +++ b/tasks/0073_138_73138449_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_138_73138449_qa_5/task.toml b/tasks/0073_138_73138449_qa_5/task.toml index db337c525fb8c1e75dca9060b8b7231750daf119..457c6c67f0972f4e635cc5bdfcacdd6c19b7ff20 100644 --- a/tasks/0073_138_73138449_qa_5/task.toml +++ b/tasks/0073_138_73138449_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_172_73172053_qa_3/environment/bootstrap.sh b/tasks/0073_172_73172053_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_172_73172053_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_172_73172053_qa_3/environment/pull_bucket.py b/tasks/0073_172_73172053_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_172_73172053_qa_3/environment/pull_bucket.py +++ b/tasks/0073_172_73172053_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_172_73172053_qa_3/task.toml b/tasks/0073_172_73172053_qa_3/task.toml index dad2be66bc9342f9e42f35f92e4b3f1f4488998c..d72f98271bfac70f7aca7053fcaf2a20452bdc85 100644 --- a/tasks/0073_172_73172053_qa_3/task.toml +++ b/tasks/0073_172_73172053_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_172_73172053_qa_5/environment/bootstrap.sh b/tasks/0073_172_73172053_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_172_73172053_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_172_73172053_qa_5/environment/pull_bucket.py b/tasks/0073_172_73172053_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_172_73172053_qa_5/environment/pull_bucket.py +++ b/tasks/0073_172_73172053_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_172_73172053_qa_5/task.toml b/tasks/0073_172_73172053_qa_5/task.toml index 81b67aedc658492fb53157e8bc732f01aff52f01..9e2b7576ad262ca5a73b9e162beed49752168ee8 100644 --- a/tasks/0073_172_73172053_qa_5/task.toml +++ b/tasks/0073_172_73172053_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_238_73238255_qa_2/environment/bootstrap.sh b/tasks/0073_238_73238255_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_238_73238255_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_238_73238255_qa_2/environment/pull_bucket.py b/tasks/0073_238_73238255_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_238_73238255_qa_2/environment/pull_bucket.py +++ b/tasks/0073_238_73238255_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_238_73238255_qa_2/task.toml b/tasks/0073_238_73238255_qa_2/task.toml index 243d8383bb4ef723374344938ee7060974ac9dc9..b03a0a5d4c84e15f45445d597528fc744db03a4a 100644 --- a/tasks/0073_238_73238255_qa_2/task.toml +++ b/tasks/0073_238_73238255_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_355_73355002_qa_1/environment/bootstrap.sh b/tasks/0073_355_73355002_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_355_73355002_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_355_73355002_qa_1/environment/pull_bucket.py b/tasks/0073_355_73355002_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_355_73355002_qa_1/environment/pull_bucket.py +++ b/tasks/0073_355_73355002_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_355_73355002_qa_1/task.toml b/tasks/0073_355_73355002_qa_1/task.toml index 73ea0aac712398b29c63c95848292c068fc8ae88..3791796b1c1a3587eef9a2735494763413dd7ca1 100644 --- a/tasks/0073_355_73355002_qa_1/task.toml +++ b/tasks/0073_355_73355002_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_355_73355002_qa_2/environment/bootstrap.sh b/tasks/0073_355_73355002_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_355_73355002_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_355_73355002_qa_2/environment/pull_bucket.py b/tasks/0073_355_73355002_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_355_73355002_qa_2/environment/pull_bucket.py +++ b/tasks/0073_355_73355002_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_355_73355002_qa_2/task.toml b/tasks/0073_355_73355002_qa_2/task.toml index a09ee9e74fc4418affa8b3fd044c6c97b60cbe4d..14c4ead6f6a022288dad81d484694a29bd4aff3a 100644 --- a/tasks/0073_355_73355002_qa_2/task.toml +++ b/tasks/0073_355_73355002_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_429_73429601_qa_5/environment/bootstrap.sh b/tasks/0073_429_73429601_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_429_73429601_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_429_73429601_qa_5/environment/pull_bucket.py b/tasks/0073_429_73429601_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_429_73429601_qa_5/environment/pull_bucket.py +++ b/tasks/0073_429_73429601_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_429_73429601_qa_5/task.toml b/tasks/0073_429_73429601_qa_5/task.toml index 8fffbec2ab6cb00ec6e9bdf617aac433e8387a2a..a004a42d1513a2af49f5aba29e59c0882730672e 100644 --- a/tasks/0073_429_73429601_qa_5/task.toml +++ b/tasks/0073_429_73429601_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_430_73430286_qa_2/environment/bootstrap.sh b/tasks/0073_430_73430286_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_430_73430286_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_430_73430286_qa_2/environment/pull_bucket.py b/tasks/0073_430_73430286_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_430_73430286_qa_2/environment/pull_bucket.py +++ b/tasks/0073_430_73430286_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_430_73430286_qa_2/task.toml b/tasks/0073_430_73430286_qa_2/task.toml index bac5b8345b4853be1b88ea5226f93b9398e59e68..d1b95e45d42420dc5ac072eee2a9c4931018c334 100644 --- a/tasks/0073_430_73430286_qa_2/task.toml +++ b/tasks/0073_430_73430286_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_430_73430286_qa_3/environment/bootstrap.sh b/tasks/0073_430_73430286_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_430_73430286_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_430_73430286_qa_3/environment/pull_bucket.py b/tasks/0073_430_73430286_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_430_73430286_qa_3/environment/pull_bucket.py +++ b/tasks/0073_430_73430286_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_430_73430286_qa_3/task.toml b/tasks/0073_430_73430286_qa_3/task.toml index 5b786cef2d02ca8e67bb92d4b22e7bf2e6945392..b1c8167d2f8deab94022c56629abf54e12b7983a 100644 --- a/tasks/0073_430_73430286_qa_3/task.toml +++ b/tasks/0073_430_73430286_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_430_73430286_qa_4/environment/bootstrap.sh b/tasks/0073_430_73430286_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_430_73430286_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_430_73430286_qa_4/environment/pull_bucket.py b/tasks/0073_430_73430286_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_430_73430286_qa_4/environment/pull_bucket.py +++ b/tasks/0073_430_73430286_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_430_73430286_qa_4/task.toml b/tasks/0073_430_73430286_qa_4/task.toml index ea3b40e1ac6b416445a2b01274b188cfe41c59e0..d1c6b1b918e23bdb52ed99c787f6b51485a6d51b 100644 --- a/tasks/0073_430_73430286_qa_4/task.toml +++ b/tasks/0073_430_73430286_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_439_73439547_qa_2/environment/bootstrap.sh b/tasks/0073_439_73439547_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_439_73439547_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_439_73439547_qa_2/environment/pull_bucket.py b/tasks/0073_439_73439547_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_439_73439547_qa_2/environment/pull_bucket.py +++ b/tasks/0073_439_73439547_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_439_73439547_qa_2/task.toml b/tasks/0073_439_73439547_qa_2/task.toml index 2c6324ea7d1b4017160fee80db1cfc8660957f95..88c0e0c9aa5ba46e8c1e8eba1c777845e1a3b7ee 100644 --- a/tasks/0073_439_73439547_qa_2/task.toml +++ b/tasks/0073_439_73439547_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_439_73439547_qa_3/environment/bootstrap.sh b/tasks/0073_439_73439547_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_439_73439547_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_439_73439547_qa_3/environment/pull_bucket.py b/tasks/0073_439_73439547_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_439_73439547_qa_3/environment/pull_bucket.py +++ b/tasks/0073_439_73439547_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_439_73439547_qa_3/task.toml b/tasks/0073_439_73439547_qa_3/task.toml index 817fac8771d0d4c86ff05e80ff4fae25efa71022..d348a93a7cabac25b6e41c14ae60479232ffd883 100644 --- a/tasks/0073_439_73439547_qa_3/task.toml +++ b/tasks/0073_439_73439547_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_456_73456234_qa_4/environment/bootstrap.sh b/tasks/0073_456_73456234_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_456_73456234_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_456_73456234_qa_4/environment/pull_bucket.py b/tasks/0073_456_73456234_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_456_73456234_qa_4/environment/pull_bucket.py +++ b/tasks/0073_456_73456234_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_456_73456234_qa_4/task.toml b/tasks/0073_456_73456234_qa_4/task.toml index 406c838074204619d5e00643532a54b00b8220b3..96844bf14250a6b37f4ecf7e3a2f2f6ba5118670 100644 --- a/tasks/0073_456_73456234_qa_4/task.toml +++ b/tasks/0073_456_73456234_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_488_73488117_qa_1/environment/bootstrap.sh b/tasks/0073_488_73488117_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_488_73488117_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_488_73488117_qa_1/environment/pull_bucket.py b/tasks/0073_488_73488117_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_488_73488117_qa_1/environment/pull_bucket.py +++ b/tasks/0073_488_73488117_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_488_73488117_qa_1/task.toml b/tasks/0073_488_73488117_qa_1/task.toml index ffc71bd0b83a604969c16d1f4a66212f11e7753b..7bf8d9e7566caafe879628fad411168981cd6018 100644 --- a/tasks/0073_488_73488117_qa_1/task.toml +++ b/tasks/0073_488_73488117_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_488_73488117_qa_2/environment/bootstrap.sh b/tasks/0073_488_73488117_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_488_73488117_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_488_73488117_qa_2/environment/pull_bucket.py b/tasks/0073_488_73488117_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_488_73488117_qa_2/environment/pull_bucket.py +++ b/tasks/0073_488_73488117_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_488_73488117_qa_2/task.toml b/tasks/0073_488_73488117_qa_2/task.toml index afdb8d2471d7082196736a75ea80e698357de132..e94b72835ffa3cf2e1040275a03878b46d2fbc64 100644 --- a/tasks/0073_488_73488117_qa_2/task.toml +++ b/tasks/0073_488_73488117_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_529_73529560_qa_5/environment/bootstrap.sh b/tasks/0073_529_73529560_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_529_73529560_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_529_73529560_qa_5/environment/pull_bucket.py b/tasks/0073_529_73529560_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_529_73529560_qa_5/environment/pull_bucket.py +++ b/tasks/0073_529_73529560_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_529_73529560_qa_5/task.toml b/tasks/0073_529_73529560_qa_5/task.toml index 3dcf844219fcdbf80c2ab71090ddef96e356c909..e727c0a18d0a5859d98f1da0119d8daec30caf22 100644 --- a/tasks/0073_529_73529560_qa_5/task.toml +++ b/tasks/0073_529_73529560_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_670_73670678_qa_3/environment/bootstrap.sh b/tasks/0073_670_73670678_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_670_73670678_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_670_73670678_qa_3/environment/pull_bucket.py b/tasks/0073_670_73670678_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_670_73670678_qa_3/environment/pull_bucket.py +++ b/tasks/0073_670_73670678_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_670_73670678_qa_3/task.toml b/tasks/0073_670_73670678_qa_3/task.toml index d6775653e276468a2b071a41b7d0d21524b9e7b2..9f6f9cf122e7444ace29d3cd4161fef3721db773 100644 --- a/tasks/0073_670_73670678_qa_3/task.toml +++ b/tasks/0073_670_73670678_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_670_73670678_qa_5/environment/bootstrap.sh b/tasks/0073_670_73670678_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_670_73670678_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_670_73670678_qa_5/environment/pull_bucket.py b/tasks/0073_670_73670678_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_670_73670678_qa_5/environment/pull_bucket.py +++ b/tasks/0073_670_73670678_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_670_73670678_qa_5/task.toml b/tasks/0073_670_73670678_qa_5/task.toml index 6cc83ebfa75c65a1a999435d40c35fefc5010b92..13ef90db5d981707f3d234fb5814a8d34807642e 100644 --- a/tasks/0073_670_73670678_qa_5/task.toml +++ b/tasks/0073_670_73670678_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_670_73670828_qa_2/environment/bootstrap.sh b/tasks/0073_670_73670828_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_670_73670828_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_670_73670828_qa_2/environment/pull_bucket.py b/tasks/0073_670_73670828_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_670_73670828_qa_2/environment/pull_bucket.py +++ b/tasks/0073_670_73670828_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_670_73670828_qa_2/task.toml b/tasks/0073_670_73670828_qa_2/task.toml index d5da942cbf223f01c751898d32a64d792dca65a5..ded774f3c925707a2b5094b63da1320d001c1d12 100644 --- a/tasks/0073_670_73670828_qa_2/task.toml +++ b/tasks/0073_670_73670828_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_670_73670828_qa_4/environment/bootstrap.sh b/tasks/0073_670_73670828_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_670_73670828_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_670_73670828_qa_4/environment/pull_bucket.py b/tasks/0073_670_73670828_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_670_73670828_qa_4/environment/pull_bucket.py +++ b/tasks/0073_670_73670828_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_670_73670828_qa_4/task.toml b/tasks/0073_670_73670828_qa_4/task.toml index 04055b6f34ccabbc9a8fd4ba511b973ef79d6d39..d533f77d9824c5340acd3ce3a70e3bd5b5ff0686 100644 --- a/tasks/0073_670_73670828_qa_4/task.toml +++ b/tasks/0073_670_73670828_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_670_73670828_qa_5/environment/bootstrap.sh b/tasks/0073_670_73670828_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_670_73670828_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_670_73670828_qa_5/environment/pull_bucket.py b/tasks/0073_670_73670828_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_670_73670828_qa_5/environment/pull_bucket.py +++ b/tasks/0073_670_73670828_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_670_73670828_qa_5/task.toml b/tasks/0073_670_73670828_qa_5/task.toml index 1dc0d14d309dd40462c525cedaf9e2781d7100de..10387a67d441d4a89dbfb66b599e474d9ff97a83 100644 --- a/tasks/0073_670_73670828_qa_5/task.toml +++ b/tasks/0073_670_73670828_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_719_73719424_qa_1/environment/bootstrap.sh b/tasks/0073_719_73719424_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_719_73719424_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_719_73719424_qa_1/environment/pull_bucket.py b/tasks/0073_719_73719424_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_719_73719424_qa_1/environment/pull_bucket.py +++ b/tasks/0073_719_73719424_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_719_73719424_qa_1/task.toml b/tasks/0073_719_73719424_qa_1/task.toml index a5ab3209f31da5f1acf209ad49603353e414168b..6076e143fb94a459a5fc58fa93ed7e2360d137d0 100644 --- a/tasks/0073_719_73719424_qa_1/task.toml +++ b/tasks/0073_719_73719424_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_719_73719424_qa_2/environment/bootstrap.sh b/tasks/0073_719_73719424_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_719_73719424_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_719_73719424_qa_2/environment/pull_bucket.py b/tasks/0073_719_73719424_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_719_73719424_qa_2/environment/pull_bucket.py +++ b/tasks/0073_719_73719424_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_719_73719424_qa_2/task.toml b/tasks/0073_719_73719424_qa_2/task.toml index dc5a6206a43f840f880ee274c6872a15f19d5034..aabe4a53903efd361e9ad488331d42a35523cf27 100644 --- a/tasks/0073_719_73719424_qa_2/task.toml +++ b/tasks/0073_719_73719424_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_796_73796901_qa_2/environment/bootstrap.sh b/tasks/0073_796_73796901_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_796_73796901_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_796_73796901_qa_2/environment/pull_bucket.py b/tasks/0073_796_73796901_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_796_73796901_qa_2/environment/pull_bucket.py +++ b/tasks/0073_796_73796901_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_796_73796901_qa_2/task.toml b/tasks/0073_796_73796901_qa_2/task.toml index e7fde2f93f7dd1522189ee9af042ab4b12b8be1f..9fd5ef78fc8ecd810c3a2e610cb345d2db009de1 100644 --- a/tasks/0073_796_73796901_qa_2/task.toml +++ b/tasks/0073_796_73796901_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_798_73798390_qa_4/environment/bootstrap.sh b/tasks/0073_798_73798390_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_798_73798390_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_798_73798390_qa_4/environment/pull_bucket.py b/tasks/0073_798_73798390_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_798_73798390_qa_4/environment/pull_bucket.py +++ b/tasks/0073_798_73798390_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_798_73798390_qa_4/task.toml b/tasks/0073_798_73798390_qa_4/task.toml index ade3fe46228d76efcc7b2baafd76d41dc69e4a83..d564dbbe32821ef3056ba1b631f1ed6ae4733427 100644 --- a/tasks/0073_798_73798390_qa_4/task.toml +++ b/tasks/0073_798_73798390_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_798_73798390_qa_5/environment/bootstrap.sh b/tasks/0073_798_73798390_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_798_73798390_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_798_73798390_qa_5/environment/pull_bucket.py b/tasks/0073_798_73798390_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_798_73798390_qa_5/environment/pull_bucket.py +++ b/tasks/0073_798_73798390_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_798_73798390_qa_5/task.toml b/tasks/0073_798_73798390_qa_5/task.toml index 04051c87514ab978918f6397e804053daf1e8332..26f18571465a136184661de41513c50a62120fec 100644 --- a/tasks/0073_798_73798390_qa_5/task.toml +++ b/tasks/0073_798_73798390_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_810_73810677_qa_2/environment/bootstrap.sh b/tasks/0073_810_73810677_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_810_73810677_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_810_73810677_qa_2/environment/pull_bucket.py b/tasks/0073_810_73810677_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_810_73810677_qa_2/environment/pull_bucket.py +++ b/tasks/0073_810_73810677_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_810_73810677_qa_2/task.toml b/tasks/0073_810_73810677_qa_2/task.toml index ebb5eb7a370d0a192976311e58529661247f08c5..be8a31d482eab66c825c5255a92502b62918edde 100644 --- a/tasks/0073_810_73810677_qa_2/task.toml +++ b/tasks/0073_810_73810677_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_814_73814551_qa_1/environment/bootstrap.sh b/tasks/0073_814_73814551_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_814_73814551_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_814_73814551_qa_1/environment/pull_bucket.py b/tasks/0073_814_73814551_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_814_73814551_qa_1/environment/pull_bucket.py +++ b/tasks/0073_814_73814551_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_814_73814551_qa_1/task.toml b/tasks/0073_814_73814551_qa_1/task.toml index b68b78afe5983d2e7b0eae62ee8ff7215be7afd1..66d989e7972dee0ad9d83d3c5bd97c1b4a9607de 100644 --- a/tasks/0073_814_73814551_qa_1/task.toml +++ b/tasks/0073_814_73814551_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_814_73814551_qa_2/environment/bootstrap.sh b/tasks/0073_814_73814551_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_814_73814551_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_814_73814551_qa_2/environment/pull_bucket.py b/tasks/0073_814_73814551_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_814_73814551_qa_2/environment/pull_bucket.py +++ b/tasks/0073_814_73814551_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_814_73814551_qa_2/task.toml b/tasks/0073_814_73814551_qa_2/task.toml index 5cf9d3efa85519385e7fa9b3aee36d84972213d1..0caa379e39f80e86f9228668e1a56bb711fe09a3 100644 --- a/tasks/0073_814_73814551_qa_2/task.toml +++ b/tasks/0073_814_73814551_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_814_73814551_qa_3/environment/bootstrap.sh b/tasks/0073_814_73814551_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_814_73814551_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_814_73814551_qa_3/environment/pull_bucket.py b/tasks/0073_814_73814551_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_814_73814551_qa_3/environment/pull_bucket.py +++ b/tasks/0073_814_73814551_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_814_73814551_qa_3/task.toml b/tasks/0073_814_73814551_qa_3/task.toml index 52f4f3fcac7d5058b68c7bd50a62f5e24c23decb..5331332b30980c7e874ac3626b612733452a1471 100644 --- a/tasks/0073_814_73814551_qa_3/task.toml +++ b/tasks/0073_814_73814551_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_814_73814551_qa_5/environment/bootstrap.sh b/tasks/0073_814_73814551_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_814_73814551_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_814_73814551_qa_5/environment/pull_bucket.py b/tasks/0073_814_73814551_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_814_73814551_qa_5/environment/pull_bucket.py +++ b/tasks/0073_814_73814551_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_814_73814551_qa_5/task.toml b/tasks/0073_814_73814551_qa_5/task.toml index 4027f3d432ccf95f1be2cc7d115e85f9bdb53462..00aed2cade3dd9147b685b5d683efa492e76bcb3 100644 --- a/tasks/0073_814_73814551_qa_5/task.toml +++ b/tasks/0073_814_73814551_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_893_73893447_qa_1/environment/bootstrap.sh b/tasks/0073_893_73893447_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_893_73893447_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_893_73893447_qa_1/environment/pull_bucket.py b/tasks/0073_893_73893447_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_893_73893447_qa_1/environment/pull_bucket.py +++ b/tasks/0073_893_73893447_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_893_73893447_qa_1/task.toml b/tasks/0073_893_73893447_qa_1/task.toml index bfee0fcb1c92ec51a626d3fbc34969e22804ee61..91b475c20b12505ff73d2ffbf6e273d28503e451 100644 --- a/tasks/0073_893_73893447_qa_1/task.toml +++ b/tasks/0073_893_73893447_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_893_73893447_qa_2/environment/bootstrap.sh b/tasks/0073_893_73893447_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_893_73893447_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_893_73893447_qa_2/environment/pull_bucket.py b/tasks/0073_893_73893447_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_893_73893447_qa_2/environment/pull_bucket.py +++ b/tasks/0073_893_73893447_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_893_73893447_qa_2/task.toml b/tasks/0073_893_73893447_qa_2/task.toml index 5bfe94fcfbf5ebd02c257453ad5e4534c77368ea..68bcdb1742c16fdb36aa72c7c426f9d09cb33cf1 100644 --- a/tasks/0073_893_73893447_qa_2/task.toml +++ b/tasks/0073_893_73893447_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_901_73901899_qa_3/environment/bootstrap.sh b/tasks/0073_901_73901899_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_901_73901899_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_901_73901899_qa_3/environment/pull_bucket.py b/tasks/0073_901_73901899_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_901_73901899_qa_3/environment/pull_bucket.py +++ b/tasks/0073_901_73901899_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_901_73901899_qa_3/task.toml b/tasks/0073_901_73901899_qa_3/task.toml index 34f1cd248d98b598025b59208de88003f227233f..3eb1ea162512d2ce11f9fd3b036c36040e61502c 100644 --- a/tasks/0073_901_73901899_qa_3/task.toml +++ b/tasks/0073_901_73901899_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_939_73939724_qa_1/environment/bootstrap.sh b/tasks/0073_939_73939724_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_939_73939724_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_939_73939724_qa_1/environment/pull_bucket.py b/tasks/0073_939_73939724_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_939_73939724_qa_1/environment/pull_bucket.py +++ b/tasks/0073_939_73939724_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_939_73939724_qa_1/task.toml b/tasks/0073_939_73939724_qa_1/task.toml index dc226a2a9df97c44bcedad7ecaa04f11f1d17a54..014912835dc127b679da1a6fca43522266e1b348 100644 --- a/tasks/0073_939_73939724_qa_1/task.toml +++ b/tasks/0073_939_73939724_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_939_73939724_qa_2/environment/bootstrap.sh b/tasks/0073_939_73939724_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_939_73939724_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_939_73939724_qa_2/environment/pull_bucket.py b/tasks/0073_939_73939724_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_939_73939724_qa_2/environment/pull_bucket.py +++ b/tasks/0073_939_73939724_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_939_73939724_qa_2/task.toml b/tasks/0073_939_73939724_qa_2/task.toml index 8994adaf7db796d0f1571c00246a14bc2d7627a5..56f74b22404d1174fe8cf99728d309af05404bf2 100644 --- a/tasks/0073_939_73939724_qa_2/task.toml +++ b/tasks/0073_939_73939724_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_939_73939724_qa_3/environment/bootstrap.sh b/tasks/0073_939_73939724_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_939_73939724_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_939_73939724_qa_3/environment/pull_bucket.py b/tasks/0073_939_73939724_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_939_73939724_qa_3/environment/pull_bucket.py +++ b/tasks/0073_939_73939724_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_939_73939724_qa_3/task.toml b/tasks/0073_939_73939724_qa_3/task.toml index 268ce5b74e5deea3fa752361ee1a3fcc6637a3bb..740190e5c2713c53accd8edbc231039e6201611d 100644 --- a/tasks/0073_939_73939724_qa_3/task.toml +++ b/tasks/0073_939_73939724_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0073_984_73984919_qa_4/environment/bootstrap.sh b/tasks/0073_984_73984919_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0073_984_73984919_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0073_984_73984919_qa_4/environment/pull_bucket.py b/tasks/0073_984_73984919_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0073_984_73984919_qa_4/environment/pull_bucket.py +++ b/tasks/0073_984_73984919_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0073_984_73984919_qa_4/task.toml b/tasks/0073_984_73984919_qa_4/task.toml index 070fdc3ba3192a0c4bb90ed96198efb6628923b2..d11998a64fd24f4a580fee2854d031698e44cc91 100644 --- a/tasks/0073_984_73984919_qa_4/task.toml +++ b/tasks/0073_984_73984919_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_012_74012086_qa_5/environment/bootstrap.sh b/tasks/0074_012_74012086_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_012_74012086_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_012_74012086_qa_5/environment/pull_bucket.py b/tasks/0074_012_74012086_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_012_74012086_qa_5/environment/pull_bucket.py +++ b/tasks/0074_012_74012086_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_012_74012086_qa_5/task.toml b/tasks/0074_012_74012086_qa_5/task.toml index cb0150b96c2f0475b5c834fe3fee8332591ffc93..2be17b87235b030e1c8a05f0bb47ad81fae646a5 100644 --- a/tasks/0074_012_74012086_qa_5/task.toml +++ b/tasks/0074_012_74012086_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_013_74013118_qa_3/environment/bootstrap.sh b/tasks/0074_013_74013118_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_013_74013118_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_013_74013118_qa_3/environment/pull_bucket.py b/tasks/0074_013_74013118_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_013_74013118_qa_3/environment/pull_bucket.py +++ b/tasks/0074_013_74013118_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_013_74013118_qa_3/task.toml b/tasks/0074_013_74013118_qa_3/task.toml index 3501b220a97184f21f576ea861c116fac03ac231..f051af83a204720f6274cfeb14931bef39ddda5f 100644 --- a/tasks/0074_013_74013118_qa_3/task.toml +++ b/tasks/0074_013_74013118_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_094_74094547_qa_2/environment/bootstrap.sh b/tasks/0074_094_74094547_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_094_74094547_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_094_74094547_qa_2/environment/pull_bucket.py b/tasks/0074_094_74094547_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_094_74094547_qa_2/environment/pull_bucket.py +++ b/tasks/0074_094_74094547_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_094_74094547_qa_2/task.toml b/tasks/0074_094_74094547_qa_2/task.toml index 21114276d4a10cf33dc96ae038fa4c90e36b6778..a0714f848b20951ab4dbf998596a09613a26111a 100644 --- a/tasks/0074_094_74094547_qa_2/task.toml +++ b/tasks/0074_094_74094547_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_129_74129496_qa_2/environment/bootstrap.sh b/tasks/0074_129_74129496_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_129_74129496_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_129_74129496_qa_2/environment/pull_bucket.py b/tasks/0074_129_74129496_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_129_74129496_qa_2/environment/pull_bucket.py +++ b/tasks/0074_129_74129496_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_129_74129496_qa_2/task.toml b/tasks/0074_129_74129496_qa_2/task.toml index 525d8ce61fecd4fc8ca9641e7153b305ba5b489f..5c404a918bc66d99173b193eb94b63daf0f4c6ee 100644 --- a/tasks/0074_129_74129496_qa_2/task.toml +++ b/tasks/0074_129_74129496_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_258_74258957_qa_4/environment/bootstrap.sh b/tasks/0074_258_74258957_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_258_74258957_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_258_74258957_qa_4/environment/pull_bucket.py b/tasks/0074_258_74258957_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_258_74258957_qa_4/environment/pull_bucket.py +++ b/tasks/0074_258_74258957_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_258_74258957_qa_4/task.toml b/tasks/0074_258_74258957_qa_4/task.toml index 6567aceeddc1e3e05cc101742a88220d7fc47398..56890db17bfea367306bee1ef67ae37b60e165aa 100644 --- a/tasks/0074_258_74258957_qa_4/task.toml +++ b/tasks/0074_258_74258957_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_276_74276642_qa_3/environment/bootstrap.sh b/tasks/0074_276_74276642_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_276_74276642_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_276_74276642_qa_3/environment/pull_bucket.py b/tasks/0074_276_74276642_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_276_74276642_qa_3/environment/pull_bucket.py +++ b/tasks/0074_276_74276642_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_276_74276642_qa_3/task.toml b/tasks/0074_276_74276642_qa_3/task.toml index f11b68a6c52715c252ebdb15ec27651f4f2f017c..4970afcff3c7fd051f2f87af2a7167c5aefe82dd 100644 --- a/tasks/0074_276_74276642_qa_3/task.toml +++ b/tasks/0074_276_74276642_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_277_74277035_qa_1/environment/bootstrap.sh b/tasks/0074_277_74277035_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_277_74277035_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_277_74277035_qa_1/environment/pull_bucket.py b/tasks/0074_277_74277035_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_277_74277035_qa_1/environment/pull_bucket.py +++ b/tasks/0074_277_74277035_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_277_74277035_qa_1/task.toml b/tasks/0074_277_74277035_qa_1/task.toml index c2e05ed415435ad696cabadf0b9d18ab87cea02b..889fd87c5ccbeab3e912babdd0f4b323292986db 100644 --- a/tasks/0074_277_74277035_qa_1/task.toml +++ b/tasks/0074_277_74277035_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_281_74281388_qa_1/environment/bootstrap.sh b/tasks/0074_281_74281388_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_281_74281388_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_281_74281388_qa_1/environment/pull_bucket.py b/tasks/0074_281_74281388_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_281_74281388_qa_1/environment/pull_bucket.py +++ b/tasks/0074_281_74281388_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_281_74281388_qa_1/task.toml b/tasks/0074_281_74281388_qa_1/task.toml index d136161942330593f118fddde7436bcc15b1097b..fa4810c4471483f315814e8ccfd228006de0370d 100644 --- a/tasks/0074_281_74281388_qa_1/task.toml +++ b/tasks/0074_281_74281388_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_290_74290093_qa_1/environment/bootstrap.sh b/tasks/0074_290_74290093_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_290_74290093_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_290_74290093_qa_1/environment/pull_bucket.py b/tasks/0074_290_74290093_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_290_74290093_qa_1/environment/pull_bucket.py +++ b/tasks/0074_290_74290093_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_290_74290093_qa_1/task.toml b/tasks/0074_290_74290093_qa_1/task.toml index 773a420f8c17fadaf02bc65e37bcef884f01ec23..180f11ceb75ccb7ba6ef1da8d509d30a473b9ad9 100644 --- a/tasks/0074_290_74290093_qa_1/task.toml +++ b/tasks/0074_290_74290093_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_314_74314286_qa_3/environment/bootstrap.sh b/tasks/0074_314_74314286_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_314_74314286_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_314_74314286_qa_3/environment/pull_bucket.py b/tasks/0074_314_74314286_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_314_74314286_qa_3/environment/pull_bucket.py +++ b/tasks/0074_314_74314286_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_314_74314286_qa_3/task.toml b/tasks/0074_314_74314286_qa_3/task.toml index f89317b350e30c03b51dc9474ec70e8b74477183..30147310cd50dff9b49cc859b99bb3c72004922c 100644 --- a/tasks/0074_314_74314286_qa_3/task.toml +++ b/tasks/0074_314_74314286_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_314_74314286_qa_4/environment/bootstrap.sh b/tasks/0074_314_74314286_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_314_74314286_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_314_74314286_qa_4/environment/pull_bucket.py b/tasks/0074_314_74314286_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_314_74314286_qa_4/environment/pull_bucket.py +++ b/tasks/0074_314_74314286_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_314_74314286_qa_4/task.toml b/tasks/0074_314_74314286_qa_4/task.toml index f619aacff6c06a4c6e68d6d13c8c8befbe5df7f6..881249a99a5fe45fbc6e27ef1f0b674fda5eaa42 100644 --- a/tasks/0074_314_74314286_qa_4/task.toml +++ b/tasks/0074_314_74314286_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_346_74346808_qa_4/environment/bootstrap.sh b/tasks/0074_346_74346808_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_346_74346808_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_346_74346808_qa_4/environment/pull_bucket.py b/tasks/0074_346_74346808_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_346_74346808_qa_4/environment/pull_bucket.py +++ b/tasks/0074_346_74346808_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_346_74346808_qa_4/task.toml b/tasks/0074_346_74346808_qa_4/task.toml index 0bbf4b9b78f0d6a494fda911c4f74412213846de..bd4a49cdd84ca3fbe88fd3390fce9252b15ab8cb 100644 --- a/tasks/0074_346_74346808_qa_4/task.toml +++ b/tasks/0074_346_74346808_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_379_74379604_qa_5/environment/bootstrap.sh b/tasks/0074_379_74379604_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_379_74379604_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_379_74379604_qa_5/environment/pull_bucket.py b/tasks/0074_379_74379604_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_379_74379604_qa_5/environment/pull_bucket.py +++ b/tasks/0074_379_74379604_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_379_74379604_qa_5/task.toml b/tasks/0074_379_74379604_qa_5/task.toml index 921ec9b142d2376f88514ff40c67e42649706a12..00a3909d6129a278f0dbf1c207fe1469b05d4b42 100644 --- a/tasks/0074_379_74379604_qa_5/task.toml +++ b/tasks/0074_379_74379604_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_406_74406391_qa_3/environment/bootstrap.sh b/tasks/0074_406_74406391_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_406_74406391_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_406_74406391_qa_3/environment/pull_bucket.py b/tasks/0074_406_74406391_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_406_74406391_qa_3/environment/pull_bucket.py +++ b/tasks/0074_406_74406391_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_406_74406391_qa_3/task.toml b/tasks/0074_406_74406391_qa_3/task.toml index c4e5232e76a610af4af397dddf883cd5007d8d66..86b45c36d5be704b866d295e61a1ecd6dcf36530 100644 --- a/tasks/0074_406_74406391_qa_3/task.toml +++ b/tasks/0074_406_74406391_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_450_74450579_qa_5/environment/bootstrap.sh b/tasks/0074_450_74450579_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_450_74450579_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_450_74450579_qa_5/environment/pull_bucket.py b/tasks/0074_450_74450579_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_450_74450579_qa_5/environment/pull_bucket.py +++ b/tasks/0074_450_74450579_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_450_74450579_qa_5/task.toml b/tasks/0074_450_74450579_qa_5/task.toml index e965e09b0fe5c6b3dcef5be49e042317149fc54f..31c2ec6079de55df5386351eee6a39c81179a763 100644 --- a/tasks/0074_450_74450579_qa_5/task.toml +++ b/tasks/0074_450_74450579_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_467_74467849_qa_1/environment/bootstrap.sh b/tasks/0074_467_74467849_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_467_74467849_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_467_74467849_qa_1/environment/pull_bucket.py b/tasks/0074_467_74467849_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_467_74467849_qa_1/environment/pull_bucket.py +++ b/tasks/0074_467_74467849_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_467_74467849_qa_1/task.toml b/tasks/0074_467_74467849_qa_1/task.toml index 691ce740ede5e88f10479da9c0176ac5b18f2de0..6c24b922bd17c17cc4a763ce814c9a9b5c472d42 100644 --- a/tasks/0074_467_74467849_qa_1/task.toml +++ b/tasks/0074_467_74467849_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_467_74467849_qa_2/environment/bootstrap.sh b/tasks/0074_467_74467849_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_467_74467849_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_467_74467849_qa_2/environment/pull_bucket.py b/tasks/0074_467_74467849_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_467_74467849_qa_2/environment/pull_bucket.py +++ b/tasks/0074_467_74467849_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_467_74467849_qa_2/task.toml b/tasks/0074_467_74467849_qa_2/task.toml index e3ce00393a7a6aaf2f980aed47ff4ea6ba04191a..10a7e2c15be5282254ee808bbfc335a9ceaa8d47 100644 --- a/tasks/0074_467_74467849_qa_2/task.toml +++ b/tasks/0074_467_74467849_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_483_74483957_qa_1/environment/bootstrap.sh b/tasks/0074_483_74483957_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_483_74483957_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_483_74483957_qa_1/environment/pull_bucket.py b/tasks/0074_483_74483957_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_483_74483957_qa_1/environment/pull_bucket.py +++ b/tasks/0074_483_74483957_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_483_74483957_qa_1/task.toml b/tasks/0074_483_74483957_qa_1/task.toml index f090693b645d71c0ec1a535f42916f7073b03f0c..6912370794995ca641700baef19087587ff59d92 100644 --- a/tasks/0074_483_74483957_qa_1/task.toml +++ b/tasks/0074_483_74483957_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_483_74483957_qa_5/environment/bootstrap.sh b/tasks/0074_483_74483957_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_483_74483957_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_483_74483957_qa_5/environment/pull_bucket.py b/tasks/0074_483_74483957_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_483_74483957_qa_5/environment/pull_bucket.py +++ b/tasks/0074_483_74483957_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_483_74483957_qa_5/task.toml b/tasks/0074_483_74483957_qa_5/task.toml index e019d58c10d169cef3d30a672f6869c944a8e603..8f5a26bd1a990d86163d64fdfabe13a59546d005 100644 --- a/tasks/0074_483_74483957_qa_5/task.toml +++ b/tasks/0074_483_74483957_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_514_74514325_qa_1/environment/bootstrap.sh b/tasks/0074_514_74514325_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_514_74514325_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_514_74514325_qa_1/environment/pull_bucket.py b/tasks/0074_514_74514325_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_514_74514325_qa_1/environment/pull_bucket.py +++ b/tasks/0074_514_74514325_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_514_74514325_qa_1/task.toml b/tasks/0074_514_74514325_qa_1/task.toml index 19b5a2abeb8382db3df351897495a33925f48b5f..8d8ac956f26b8b0f7f65a4b4b27f829753036479 100644 --- a/tasks/0074_514_74514325_qa_1/task.toml +++ b/tasks/0074_514_74514325_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_537_74537408_qa_5/environment/bootstrap.sh b/tasks/0074_537_74537408_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_537_74537408_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_537_74537408_qa_5/environment/pull_bucket.py b/tasks/0074_537_74537408_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_537_74537408_qa_5/environment/pull_bucket.py +++ b/tasks/0074_537_74537408_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_537_74537408_qa_5/task.toml b/tasks/0074_537_74537408_qa_5/task.toml index c0df4401cce2412ec51f95406d5c31566bbeddaf..ae04ac8d9d9be504a096b7f43895c418e72c80d6 100644 --- a/tasks/0074_537_74537408_qa_5/task.toml +++ b/tasks/0074_537_74537408_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_549_74549731_qa_2/environment/bootstrap.sh b/tasks/0074_549_74549731_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_549_74549731_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_549_74549731_qa_2/environment/pull_bucket.py b/tasks/0074_549_74549731_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_549_74549731_qa_2/environment/pull_bucket.py +++ b/tasks/0074_549_74549731_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_549_74549731_qa_2/task.toml b/tasks/0074_549_74549731_qa_2/task.toml index 4259dfc7ef9110fcc0dd64f42072cea054a3be04..36ae72a3e12c2ddbcfd498e96d6a4834ffb1ece1 100644 --- a/tasks/0074_549_74549731_qa_2/task.toml +++ b/tasks/0074_549_74549731_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_549_74549731_qa_3/environment/bootstrap.sh b/tasks/0074_549_74549731_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_549_74549731_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_549_74549731_qa_3/environment/pull_bucket.py b/tasks/0074_549_74549731_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_549_74549731_qa_3/environment/pull_bucket.py +++ b/tasks/0074_549_74549731_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_549_74549731_qa_3/task.toml b/tasks/0074_549_74549731_qa_3/task.toml index 7dfc9d83734e9b1bcdbae062d67588248b4e2019..223cb2bccb87821cb1dec46c5e9493dffbc5a2cc 100644 --- a/tasks/0074_549_74549731_qa_3/task.toml +++ b/tasks/0074_549_74549731_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_549_74549731_qa_5/environment/bootstrap.sh b/tasks/0074_549_74549731_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_549_74549731_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_549_74549731_qa_5/environment/pull_bucket.py b/tasks/0074_549_74549731_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_549_74549731_qa_5/environment/pull_bucket.py +++ b/tasks/0074_549_74549731_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_549_74549731_qa_5/task.toml b/tasks/0074_549_74549731_qa_5/task.toml index 9f510c19af2ae64c77c94c79a54e04cb3f34597b..290e137ec024f1424e15f83dd48ad9420a2b046f 100644 --- a/tasks/0074_549_74549731_qa_5/task.toml +++ b/tasks/0074_549_74549731_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_600_74600268_qa_2/environment/bootstrap.sh b/tasks/0074_600_74600268_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_600_74600268_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_600_74600268_qa_2/environment/pull_bucket.py b/tasks/0074_600_74600268_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_600_74600268_qa_2/environment/pull_bucket.py +++ b/tasks/0074_600_74600268_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_600_74600268_qa_2/task.toml b/tasks/0074_600_74600268_qa_2/task.toml index b7f55b42ca67a10c778dd3310844ad0b170b4303..c4603fcf7f5dc710eff6b14084e8554265d00548 100644 --- a/tasks/0074_600_74600268_qa_2/task.toml +++ b/tasks/0074_600_74600268_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_645_74645065_qa_5/environment/bootstrap.sh b/tasks/0074_645_74645065_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_645_74645065_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_645_74645065_qa_5/environment/pull_bucket.py b/tasks/0074_645_74645065_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_645_74645065_qa_5/environment/pull_bucket.py +++ b/tasks/0074_645_74645065_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_645_74645065_qa_5/task.toml b/tasks/0074_645_74645065_qa_5/task.toml index 484191c82f24b4058a292778aaa609a62208e4d6..4e9986412eae70c1478e96990ca34b19f17bbe2a 100644 --- a/tasks/0074_645_74645065_qa_5/task.toml +++ b/tasks/0074_645_74645065_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_705_74705026_qa_1/environment/bootstrap.sh b/tasks/0074_705_74705026_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_705_74705026_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_705_74705026_qa_1/environment/pull_bucket.py b/tasks/0074_705_74705026_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_705_74705026_qa_1/environment/pull_bucket.py +++ b/tasks/0074_705_74705026_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_705_74705026_qa_1/task.toml b/tasks/0074_705_74705026_qa_1/task.toml index 0587d205373d91dcc26fe257699a8f6a972853aa..c3f14b9feffd1aaa701505c77a5229ea0112acf6 100644 --- a/tasks/0074_705_74705026_qa_1/task.toml +++ b/tasks/0074_705_74705026_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_739_74739274_qa_1/environment/bootstrap.sh b/tasks/0074_739_74739274_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_739_74739274_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_739_74739274_qa_1/environment/pull_bucket.py b/tasks/0074_739_74739274_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_739_74739274_qa_1/environment/pull_bucket.py +++ b/tasks/0074_739_74739274_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_739_74739274_qa_1/task.toml b/tasks/0074_739_74739274_qa_1/task.toml index f700902fdc31885510788f70b90926c90b143227..c7b93a3c83e10d61aadbb99c5787df5e01e30626 100644 --- a/tasks/0074_739_74739274_qa_1/task.toml +++ b/tasks/0074_739_74739274_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_739_74739274_qa_3/environment/bootstrap.sh b/tasks/0074_739_74739274_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_739_74739274_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_739_74739274_qa_3/environment/pull_bucket.py b/tasks/0074_739_74739274_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_739_74739274_qa_3/environment/pull_bucket.py +++ b/tasks/0074_739_74739274_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_739_74739274_qa_3/task.toml b/tasks/0074_739_74739274_qa_3/task.toml index 7edd3e270fb0bb97cf769dd1a1ddbde61075dceb..e308ed9ede13716e005ff3a4c36b706dc759dc8f 100644 --- a/tasks/0074_739_74739274_qa_3/task.toml +++ b/tasks/0074_739_74739274_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_771_74771438_qa_1/environment/bootstrap.sh b/tasks/0074_771_74771438_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_771_74771438_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_771_74771438_qa_1/environment/pull_bucket.py b/tasks/0074_771_74771438_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_771_74771438_qa_1/environment/pull_bucket.py +++ b/tasks/0074_771_74771438_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_771_74771438_qa_1/task.toml b/tasks/0074_771_74771438_qa_1/task.toml index f6fa5b923875b9e916470d436fcb969cab1a5006..1316c90f173c307de72476408ffbe6a632f0f816 100644 --- a/tasks/0074_771_74771438_qa_1/task.toml +++ b/tasks/0074_771_74771438_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_776_74776615_qa_1/environment/bootstrap.sh b/tasks/0074_776_74776615_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_776_74776615_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_776_74776615_qa_1/environment/pull_bucket.py b/tasks/0074_776_74776615_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_776_74776615_qa_1/environment/pull_bucket.py +++ b/tasks/0074_776_74776615_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_776_74776615_qa_1/task.toml b/tasks/0074_776_74776615_qa_1/task.toml index 5ae1b3f2885e06d47c0eb4fea706139e01fdda88..10357319d22810df44c902c3dfae4e33800cd04b 100644 --- a/tasks/0074_776_74776615_qa_1/task.toml +++ b/tasks/0074_776_74776615_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_813_74813463_qa_2/environment/bootstrap.sh b/tasks/0074_813_74813463_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_813_74813463_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_813_74813463_qa_2/environment/pull_bucket.py b/tasks/0074_813_74813463_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_813_74813463_qa_2/environment/pull_bucket.py +++ b/tasks/0074_813_74813463_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_813_74813463_qa_2/task.toml b/tasks/0074_813_74813463_qa_2/task.toml index 0b2786ae0a6acf668e11c18acb7da75ce08b860e..63ad2e6a9ad23b8c712118ccd68847359bf3648b 100644 --- a/tasks/0074_813_74813463_qa_2/task.toml +++ b/tasks/0074_813_74813463_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_813_74813463_qa_5/environment/bootstrap.sh b/tasks/0074_813_74813463_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_813_74813463_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_813_74813463_qa_5/environment/pull_bucket.py b/tasks/0074_813_74813463_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_813_74813463_qa_5/environment/pull_bucket.py +++ b/tasks/0074_813_74813463_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_813_74813463_qa_5/task.toml b/tasks/0074_813_74813463_qa_5/task.toml index 1ee2c1cc98eb83244d9dc0a5aa80b244be4e6609..f345ca0d62d6e74a7ad2c777980185ea7c10463e 100644 --- a/tasks/0074_813_74813463_qa_5/task.toml +++ b/tasks/0074_813_74813463_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_813_74813772_qa_4/environment/bootstrap.sh b/tasks/0074_813_74813772_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_813_74813772_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_813_74813772_qa_4/environment/pull_bucket.py b/tasks/0074_813_74813772_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_813_74813772_qa_4/environment/pull_bucket.py +++ b/tasks/0074_813_74813772_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_813_74813772_qa_4/task.toml b/tasks/0074_813_74813772_qa_4/task.toml index 8646a79833b627c90a270835f45547c899668a97..cd1481a8ee95843c7c4a0dd657d33826f03af66f 100644 --- a/tasks/0074_813_74813772_qa_4/task.toml +++ b/tasks/0074_813_74813772_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_813_74813772_qa_5/environment/bootstrap.sh b/tasks/0074_813_74813772_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_813_74813772_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_813_74813772_qa_5/environment/pull_bucket.py b/tasks/0074_813_74813772_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_813_74813772_qa_5/environment/pull_bucket.py +++ b/tasks/0074_813_74813772_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_813_74813772_qa_5/task.toml b/tasks/0074_813_74813772_qa_5/task.toml index cd74b9cab4b5c7268d50614d52bc8431f1938efc..41d58a3da6a65debadbc87db83784b8e5a2deeed 100644 --- a/tasks/0074_813_74813772_qa_5/task.toml +++ b/tasks/0074_813_74813772_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_828_74828746_qa_4/environment/bootstrap.sh b/tasks/0074_828_74828746_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_828_74828746_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_828_74828746_qa_4/environment/pull_bucket.py b/tasks/0074_828_74828746_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_828_74828746_qa_4/environment/pull_bucket.py +++ b/tasks/0074_828_74828746_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_828_74828746_qa_4/task.toml b/tasks/0074_828_74828746_qa_4/task.toml index f475c8c1bd73a0cd86462bf44b8a34db22127eb7..6abd2ffcd020362c0b57586668873236c953d28e 100644 --- a/tasks/0074_828_74828746_qa_4/task.toml +++ b/tasks/0074_828_74828746_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_832_74832240_qa_5/environment/bootstrap.sh b/tasks/0074_832_74832240_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_832_74832240_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_832_74832240_qa_5/environment/pull_bucket.py b/tasks/0074_832_74832240_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_832_74832240_qa_5/environment/pull_bucket.py +++ b/tasks/0074_832_74832240_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_832_74832240_qa_5/task.toml b/tasks/0074_832_74832240_qa_5/task.toml index b7fe7d5587de25dc0dddabdc17c32420bc30a6a2..b8105653eba205ecdc2d19b4ff4c918c0129a0ea 100644 --- a/tasks/0074_832_74832240_qa_5/task.toml +++ b/tasks/0074_832_74832240_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_836_74836808_qa_3/environment/bootstrap.sh b/tasks/0074_836_74836808_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_836_74836808_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_836_74836808_qa_3/environment/pull_bucket.py b/tasks/0074_836_74836808_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_836_74836808_qa_3/environment/pull_bucket.py +++ b/tasks/0074_836_74836808_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_836_74836808_qa_3/task.toml b/tasks/0074_836_74836808_qa_3/task.toml index 9edec290e732ebfd45841431e820b0fe4ae4e899..cd18c9e7ba32d226619cdc3f3b68c4e6be341004 100644 --- a/tasks/0074_836_74836808_qa_3/task.toml +++ b/tasks/0074_836_74836808_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_845_74845042_qa_3/environment/bootstrap.sh b/tasks/0074_845_74845042_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_845_74845042_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_845_74845042_qa_3/environment/pull_bucket.py b/tasks/0074_845_74845042_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_845_74845042_qa_3/environment/pull_bucket.py +++ b/tasks/0074_845_74845042_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_845_74845042_qa_3/task.toml b/tasks/0074_845_74845042_qa_3/task.toml index d50ba2f2ecb6471e1f1783775e316c5df85f875b..bffe94e84b3263fe97900786dc744236eb1a44bb 100644 --- a/tasks/0074_845_74845042_qa_3/task.toml +++ b/tasks/0074_845_74845042_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_845_74845042_qa_5/environment/bootstrap.sh b/tasks/0074_845_74845042_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_845_74845042_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_845_74845042_qa_5/environment/pull_bucket.py b/tasks/0074_845_74845042_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_845_74845042_qa_5/environment/pull_bucket.py +++ b/tasks/0074_845_74845042_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_845_74845042_qa_5/task.toml b/tasks/0074_845_74845042_qa_5/task.toml index a2bc9186b44bd6c62b88afa19d31d38aea1390c6..9444e3616074f61417b19dfb75487b898cbe566d 100644 --- a/tasks/0074_845_74845042_qa_5/task.toml +++ b/tasks/0074_845_74845042_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_848_74848872_qa_4/environment/bootstrap.sh b/tasks/0074_848_74848872_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_848_74848872_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_848_74848872_qa_4/environment/pull_bucket.py b/tasks/0074_848_74848872_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_848_74848872_qa_4/environment/pull_bucket.py +++ b/tasks/0074_848_74848872_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_848_74848872_qa_4/task.toml b/tasks/0074_848_74848872_qa_4/task.toml index 60b5ba0d91ae523f26b7ffc555395bc1fcda0d53..26d04d2ba1923c341926ce758ea8a3085876d088 100644 --- a/tasks/0074_848_74848872_qa_4/task.toml +++ b/tasks/0074_848_74848872_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_849_74849685_qa_3/environment/bootstrap.sh b/tasks/0074_849_74849685_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_849_74849685_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_849_74849685_qa_3/environment/pull_bucket.py b/tasks/0074_849_74849685_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_849_74849685_qa_3/environment/pull_bucket.py +++ b/tasks/0074_849_74849685_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_849_74849685_qa_3/task.toml b/tasks/0074_849_74849685_qa_3/task.toml index e35d54730e825b40da9218879f3e0aa3b57b21ad..fb89c5ea1c51904e7229c76b1aed683a15328637 100644 --- a/tasks/0074_849_74849685_qa_3/task.toml +++ b/tasks/0074_849_74849685_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_849_74849685_qa_4/environment/bootstrap.sh b/tasks/0074_849_74849685_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_849_74849685_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_849_74849685_qa_4/environment/pull_bucket.py b/tasks/0074_849_74849685_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_849_74849685_qa_4/environment/pull_bucket.py +++ b/tasks/0074_849_74849685_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_849_74849685_qa_4/task.toml b/tasks/0074_849_74849685_qa_4/task.toml index 08fb38905a76a352c61499064ab8fad14ed3d561..70c81c354229917ffdefa92056a2ec150aad667d 100644 --- a/tasks/0074_849_74849685_qa_4/task.toml +++ b/tasks/0074_849_74849685_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_849_74849685_qa_5/environment/bootstrap.sh b/tasks/0074_849_74849685_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_849_74849685_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_849_74849685_qa_5/environment/pull_bucket.py b/tasks/0074_849_74849685_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_849_74849685_qa_5/environment/pull_bucket.py +++ b/tasks/0074_849_74849685_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_849_74849685_qa_5/task.toml b/tasks/0074_849_74849685_qa_5/task.toml index 8b0505889396b4138ea3bc127a559523514790d1..bfd8f1f35c10e295a4c92c77cd59bfafd914af5f 100644 --- a/tasks/0074_849_74849685_qa_5/task.toml +++ b/tasks/0074_849_74849685_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_880_74880980_qa_1/environment/bootstrap.sh b/tasks/0074_880_74880980_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_880_74880980_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_880_74880980_qa_1/environment/pull_bucket.py b/tasks/0074_880_74880980_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_880_74880980_qa_1/environment/pull_bucket.py +++ b/tasks/0074_880_74880980_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_880_74880980_qa_1/task.toml b/tasks/0074_880_74880980_qa_1/task.toml index 8d3e62bb1e81a61c8c8325dcc1e24b7796ab0cef..f812a344ee765a2d45ebf80c6f30ad40fe6e9976 100644 --- a/tasks/0074_880_74880980_qa_1/task.toml +++ b/tasks/0074_880_74880980_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_904_74904214_qa_1/environment/bootstrap.sh b/tasks/0074_904_74904214_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_904_74904214_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_904_74904214_qa_1/environment/pull_bucket.py b/tasks/0074_904_74904214_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_904_74904214_qa_1/environment/pull_bucket.py +++ b/tasks/0074_904_74904214_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_904_74904214_qa_1/task.toml b/tasks/0074_904_74904214_qa_1/task.toml index 325039dbcd7f0c4fe436e4e6c28886c54816e3d3..2637a97d005a147ea7994029b4da24002c8ef691 100644 --- a/tasks/0074_904_74904214_qa_1/task.toml +++ b/tasks/0074_904_74904214_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_918_74918107_qa_4/environment/bootstrap.sh b/tasks/0074_918_74918107_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_918_74918107_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_918_74918107_qa_4/environment/pull_bucket.py b/tasks/0074_918_74918107_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_918_74918107_qa_4/environment/pull_bucket.py +++ b/tasks/0074_918_74918107_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_918_74918107_qa_4/task.toml b/tasks/0074_918_74918107_qa_4/task.toml index d5a9b6af3ce9117ce746a1f584c8d00ee968f802..059878cbaa3411038ee02fe9e6a2b492988fb2bd 100644 --- a/tasks/0074_918_74918107_qa_4/task.toml +++ b/tasks/0074_918_74918107_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_956_74956806_qa_3/environment/bootstrap.sh b/tasks/0074_956_74956806_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_956_74956806_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_956_74956806_qa_3/environment/pull_bucket.py b/tasks/0074_956_74956806_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_956_74956806_qa_3/environment/pull_bucket.py +++ b/tasks/0074_956_74956806_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_956_74956806_qa_3/task.toml b/tasks/0074_956_74956806_qa_3/task.toml index fbe0452b7fea283fb58c39a7552063e9122c4cbd..2815c8c5bf801bb77ed403acf27d1f0c07c23276 100644 --- a/tasks/0074_956_74956806_qa_3/task.toml +++ b/tasks/0074_956_74956806_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_999_74999890_qa_2/environment/bootstrap.sh b/tasks/0074_999_74999890_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_999_74999890_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_999_74999890_qa_2/environment/pull_bucket.py b/tasks/0074_999_74999890_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_999_74999890_qa_2/environment/pull_bucket.py +++ b/tasks/0074_999_74999890_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_999_74999890_qa_2/task.toml b/tasks/0074_999_74999890_qa_2/task.toml index 91439a4a1ea190e42b1bff4eaaa35a22fda0b91e..6e82ea8945206b6ac1930cef8373a801aa447551 100644 --- a/tasks/0074_999_74999890_qa_2/task.toml +++ b/tasks/0074_999_74999890_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0074_999_74999890_qa_5/environment/bootstrap.sh b/tasks/0074_999_74999890_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0074_999_74999890_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0074_999_74999890_qa_5/environment/pull_bucket.py b/tasks/0074_999_74999890_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0074_999_74999890_qa_5/environment/pull_bucket.py +++ b/tasks/0074_999_74999890_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0074_999_74999890_qa_5/task.toml b/tasks/0074_999_74999890_qa_5/task.toml index 2575e065a64d00103bb49e32309ed110d58eafe4..de8015cf6ff809346a1d4bb802586c8165d37b14 100644 --- a/tasks/0074_999_74999890_qa_5/task.toml +++ b/tasks/0074_999_74999890_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_045_75045566_qa_3/environment/bootstrap.sh b/tasks/0075_045_75045566_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_045_75045566_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_045_75045566_qa_3/environment/pull_bucket.py b/tasks/0075_045_75045566_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_045_75045566_qa_3/environment/pull_bucket.py +++ b/tasks/0075_045_75045566_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_045_75045566_qa_3/task.toml b/tasks/0075_045_75045566_qa_3/task.toml index 010ff7d75300fa0e1697383535f1fc919abebaaa..2d376e4b4f35526e9e5854cd027157bcb5315d03 100644 --- a/tasks/0075_045_75045566_qa_3/task.toml +++ b/tasks/0075_045_75045566_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_061_75061101_qa_2/environment/bootstrap.sh b/tasks/0075_061_75061101_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_061_75061101_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_061_75061101_qa_2/environment/pull_bucket.py b/tasks/0075_061_75061101_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_061_75061101_qa_2/environment/pull_bucket.py +++ b/tasks/0075_061_75061101_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_061_75061101_qa_2/task.toml b/tasks/0075_061_75061101_qa_2/task.toml index f4b1199359ac6d8ae0ba67ffa9aa11c67eee0da5..055694b001c9d2a554a322e8ed0a48860316d556 100644 --- a/tasks/0075_061_75061101_qa_2/task.toml +++ b/tasks/0075_061_75061101_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_061_75061101_qa_3/environment/bootstrap.sh b/tasks/0075_061_75061101_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_061_75061101_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_061_75061101_qa_3/environment/pull_bucket.py b/tasks/0075_061_75061101_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_061_75061101_qa_3/environment/pull_bucket.py +++ b/tasks/0075_061_75061101_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_061_75061101_qa_3/task.toml b/tasks/0075_061_75061101_qa_3/task.toml index 9cf67554d0926e9e5baa7d300afa52f8ca86bd61..855e23db2b2c1b92190f752fc75f7d69ab8fd107 100644 --- a/tasks/0075_061_75061101_qa_3/task.toml +++ b/tasks/0075_061_75061101_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_079_75079174_qa_4/environment/bootstrap.sh b/tasks/0075_079_75079174_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_079_75079174_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_079_75079174_qa_4/environment/pull_bucket.py b/tasks/0075_079_75079174_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_079_75079174_qa_4/environment/pull_bucket.py +++ b/tasks/0075_079_75079174_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_079_75079174_qa_4/task.toml b/tasks/0075_079_75079174_qa_4/task.toml index 6772c32d1d2bc61f74f40aa84a80496fb219b44b..1389ca482e3ca70d15c8e8dfe56928c42f77e401 100644 --- a/tasks/0075_079_75079174_qa_4/task.toml +++ b/tasks/0075_079_75079174_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_081_75081757_qa_2/environment/bootstrap.sh b/tasks/0075_081_75081757_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_081_75081757_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_081_75081757_qa_2/environment/pull_bucket.py b/tasks/0075_081_75081757_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_081_75081757_qa_2/environment/pull_bucket.py +++ b/tasks/0075_081_75081757_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_081_75081757_qa_2/task.toml b/tasks/0075_081_75081757_qa_2/task.toml index 7150ed27680048a065ce13c239309f54a1ccac0b..a9b046bbfc263f1e97d4254909bb47aad0955925 100644 --- a/tasks/0075_081_75081757_qa_2/task.toml +++ b/tasks/0075_081_75081757_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_081_75081757_qa_3/environment/bootstrap.sh b/tasks/0075_081_75081757_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_081_75081757_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_081_75081757_qa_3/environment/pull_bucket.py b/tasks/0075_081_75081757_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_081_75081757_qa_3/environment/pull_bucket.py +++ b/tasks/0075_081_75081757_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_081_75081757_qa_3/task.toml b/tasks/0075_081_75081757_qa_3/task.toml index a64fd7a3f05cdb3da9746078b862f809fbeccb8a..2d5fb230dbbf9380598ad69056483e8796bf8b41 100644 --- a/tasks/0075_081_75081757_qa_3/task.toml +++ b/tasks/0075_081_75081757_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_081_75081757_qa_4/environment/bootstrap.sh b/tasks/0075_081_75081757_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_081_75081757_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_081_75081757_qa_4/environment/pull_bucket.py b/tasks/0075_081_75081757_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_081_75081757_qa_4/environment/pull_bucket.py +++ b/tasks/0075_081_75081757_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_081_75081757_qa_4/task.toml b/tasks/0075_081_75081757_qa_4/task.toml index cca21f2c223ff10dcaf07280830512e00d183b03..cd675862f4fb7beafe9d232a07d9b5e0ce142d9b 100644 --- a/tasks/0075_081_75081757_qa_4/task.toml +++ b/tasks/0075_081_75081757_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_094_75094397_qa_1/environment/bootstrap.sh b/tasks/0075_094_75094397_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_094_75094397_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_094_75094397_qa_1/environment/pull_bucket.py b/tasks/0075_094_75094397_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_094_75094397_qa_1/environment/pull_bucket.py +++ b/tasks/0075_094_75094397_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_094_75094397_qa_1/task.toml b/tasks/0075_094_75094397_qa_1/task.toml index 11e36bffc7804f05895531d16252d6b5709fd9cd..8e785ec636a668a883cb1fbe9b20167ec08ca6a7 100644 --- a/tasks/0075_094_75094397_qa_1/task.toml +++ b/tasks/0075_094_75094397_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_094_75094397_qa_3/environment/bootstrap.sh b/tasks/0075_094_75094397_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_094_75094397_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_094_75094397_qa_3/environment/pull_bucket.py b/tasks/0075_094_75094397_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_094_75094397_qa_3/environment/pull_bucket.py +++ b/tasks/0075_094_75094397_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_094_75094397_qa_3/task.toml b/tasks/0075_094_75094397_qa_3/task.toml index 64c0d0fb80ea6f785063e65612c0538908e3e02b..bc5a9e5c303e4babdc6f1dbb6eea9bc858e927a5 100644 --- a/tasks/0075_094_75094397_qa_3/task.toml +++ b/tasks/0075_094_75094397_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_108_75108038_qa_2/environment/bootstrap.sh b/tasks/0075_108_75108038_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_108_75108038_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_108_75108038_qa_2/environment/pull_bucket.py b/tasks/0075_108_75108038_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_108_75108038_qa_2/environment/pull_bucket.py +++ b/tasks/0075_108_75108038_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_108_75108038_qa_2/task.toml b/tasks/0075_108_75108038_qa_2/task.toml index 0b27a42911fbe85e37bceb39c2dcd7333d6035ef..e3f95a089bd403885d2ba21f5129df9b46d685db 100644 --- a/tasks/0075_108_75108038_qa_2/task.toml +++ b/tasks/0075_108_75108038_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_131_75131662_qa_1/environment/bootstrap.sh b/tasks/0075_131_75131662_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_131_75131662_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_131_75131662_qa_1/environment/pull_bucket.py b/tasks/0075_131_75131662_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_131_75131662_qa_1/environment/pull_bucket.py +++ b/tasks/0075_131_75131662_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_131_75131662_qa_1/task.toml b/tasks/0075_131_75131662_qa_1/task.toml index cd47d5762092dfa434b169faea52d3097ce5e4f3..bd2f302641949dcbec7dd93a6b69396a28c8d161 100644 --- a/tasks/0075_131_75131662_qa_1/task.toml +++ b/tasks/0075_131_75131662_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_131_75131662_qa_5/environment/bootstrap.sh b/tasks/0075_131_75131662_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_131_75131662_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_131_75131662_qa_5/environment/pull_bucket.py b/tasks/0075_131_75131662_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_131_75131662_qa_5/environment/pull_bucket.py +++ b/tasks/0075_131_75131662_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_131_75131662_qa_5/task.toml b/tasks/0075_131_75131662_qa_5/task.toml index b2c80d0a21a8ef5b10860ef6b6ed7e4344563d83..ef8cc70b35843d34c4af71e0e576d4ddff7262de 100644 --- a/tasks/0075_131_75131662_qa_5/task.toml +++ b/tasks/0075_131_75131662_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_146_75146296_qa_4/environment/bootstrap.sh b/tasks/0075_146_75146296_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_146_75146296_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_146_75146296_qa_4/environment/pull_bucket.py b/tasks/0075_146_75146296_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_146_75146296_qa_4/environment/pull_bucket.py +++ b/tasks/0075_146_75146296_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_146_75146296_qa_4/task.toml b/tasks/0075_146_75146296_qa_4/task.toml index ce41b3936a3424c67e49942ab9338dda39545a17..f1430aa237367c8b53b7541d64ff9743d4679f72 100644 --- a/tasks/0075_146_75146296_qa_4/task.toml +++ b/tasks/0075_146_75146296_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_148_75148017_qa_1/environment/bootstrap.sh b/tasks/0075_148_75148017_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_148_75148017_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_148_75148017_qa_1/environment/pull_bucket.py b/tasks/0075_148_75148017_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_148_75148017_qa_1/environment/pull_bucket.py +++ b/tasks/0075_148_75148017_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_148_75148017_qa_1/task.toml b/tasks/0075_148_75148017_qa_1/task.toml index 347f900fecc95ce04ec568841359539a8897b237..02e0c6b61736faaf8467a1b2f8d83f729210b8d2 100644 --- a/tasks/0075_148_75148017_qa_1/task.toml +++ b/tasks/0075_148_75148017_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_148_75148017_qa_4/environment/bootstrap.sh b/tasks/0075_148_75148017_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_148_75148017_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_148_75148017_qa_4/environment/pull_bucket.py b/tasks/0075_148_75148017_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_148_75148017_qa_4/environment/pull_bucket.py +++ b/tasks/0075_148_75148017_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_148_75148017_qa_4/task.toml b/tasks/0075_148_75148017_qa_4/task.toml index 368d3bbad2a3839da928edebfd81f400d8035d4b..59aae75d8c9a8c2e35e7ddd047d5f29a9e3fe57d 100644 --- a/tasks/0075_148_75148017_qa_4/task.toml +++ b/tasks/0075_148_75148017_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_174_75174860_qa_1/environment/bootstrap.sh b/tasks/0075_174_75174860_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_174_75174860_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_174_75174860_qa_1/environment/pull_bucket.py b/tasks/0075_174_75174860_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_174_75174860_qa_1/environment/pull_bucket.py +++ b/tasks/0075_174_75174860_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_174_75174860_qa_1/task.toml b/tasks/0075_174_75174860_qa_1/task.toml index d99323f5ce62d81996e08a6f5a41a21506510ee9..4606032ef33aa918a0b24e43bfac0e6bc628b999 100644 --- a/tasks/0075_174_75174860_qa_1/task.toml +++ b/tasks/0075_174_75174860_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_174_75174860_qa_2/environment/bootstrap.sh b/tasks/0075_174_75174860_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_174_75174860_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_174_75174860_qa_2/environment/pull_bucket.py b/tasks/0075_174_75174860_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_174_75174860_qa_2/environment/pull_bucket.py +++ b/tasks/0075_174_75174860_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_174_75174860_qa_2/task.toml b/tasks/0075_174_75174860_qa_2/task.toml index 993618dfb58c9cdab8fc89fec689aa65f3ea981d..1ef288d3f02fbd13b08a10f362543ea23aa3a0a9 100644 --- a/tasks/0075_174_75174860_qa_2/task.toml +++ b/tasks/0075_174_75174860_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_174_75174860_qa_3/environment/bootstrap.sh b/tasks/0075_174_75174860_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_174_75174860_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_174_75174860_qa_3/environment/pull_bucket.py b/tasks/0075_174_75174860_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_174_75174860_qa_3/environment/pull_bucket.py +++ b/tasks/0075_174_75174860_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_174_75174860_qa_3/task.toml b/tasks/0075_174_75174860_qa_3/task.toml index b1c9e8e93b834f625cb1daa28963e7805de0bec7..2e11f9aee21acade272cc883aca7b247235ce6f5 100644 --- a/tasks/0075_174_75174860_qa_3/task.toml +++ b/tasks/0075_174_75174860_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_210_75210599_qa_3/environment/bootstrap.sh b/tasks/0075_210_75210599_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_210_75210599_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_210_75210599_qa_3/environment/pull_bucket.py b/tasks/0075_210_75210599_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_210_75210599_qa_3/environment/pull_bucket.py +++ b/tasks/0075_210_75210599_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_210_75210599_qa_3/task.toml b/tasks/0075_210_75210599_qa_3/task.toml index e8d57b4d167fb634340dbbd5631afd0a87944602..a0d9910c9bf464f48035ae14ee5401e18959f9f8 100644 --- a/tasks/0075_210_75210599_qa_3/task.toml +++ b/tasks/0075_210_75210599_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_282_75282744_qa_2/environment/bootstrap.sh b/tasks/0075_282_75282744_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_282_75282744_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_282_75282744_qa_2/environment/pull_bucket.py b/tasks/0075_282_75282744_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_282_75282744_qa_2/environment/pull_bucket.py +++ b/tasks/0075_282_75282744_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_282_75282744_qa_2/task.toml b/tasks/0075_282_75282744_qa_2/task.toml index b47a780ce12ab2da454a5ae6c3595a99c1350c1a..71275e455f9d9a79089953aaf747dded730e25ac 100644 --- a/tasks/0075_282_75282744_qa_2/task.toml +++ b/tasks/0075_282_75282744_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_365_75365358_qa_5/environment/bootstrap.sh b/tasks/0075_365_75365358_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_365_75365358_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_365_75365358_qa_5/environment/pull_bucket.py b/tasks/0075_365_75365358_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_365_75365358_qa_5/environment/pull_bucket.py +++ b/tasks/0075_365_75365358_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_365_75365358_qa_5/task.toml b/tasks/0075_365_75365358_qa_5/task.toml index 67a2ec099217e57c09df1bebc4d8edf309fcda6d..195af18143a71bd0a561544ef21e95cfb428cd87 100644 --- a/tasks/0075_365_75365358_qa_5/task.toml +++ b/tasks/0075_365_75365358_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_379_75379398_qa_2/environment/bootstrap.sh b/tasks/0075_379_75379398_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_379_75379398_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_379_75379398_qa_2/environment/pull_bucket.py b/tasks/0075_379_75379398_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_379_75379398_qa_2/environment/pull_bucket.py +++ b/tasks/0075_379_75379398_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_379_75379398_qa_2/task.toml b/tasks/0075_379_75379398_qa_2/task.toml index d96d1ba8337f63dc40833f3bb7548ccc00912fd7..b7dca3242b2bed5379fd71a78bb7244f4c7ac961 100644 --- a/tasks/0075_379_75379398_qa_2/task.toml +++ b/tasks/0075_379_75379398_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_391_75391350_qa_3/environment/bootstrap.sh b/tasks/0075_391_75391350_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_391_75391350_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_391_75391350_qa_3/environment/pull_bucket.py b/tasks/0075_391_75391350_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_391_75391350_qa_3/environment/pull_bucket.py +++ b/tasks/0075_391_75391350_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_391_75391350_qa_3/task.toml b/tasks/0075_391_75391350_qa_3/task.toml index 785b3308c881530a4c0722be3a416ac327fb89e9..fae39b065ce2507706025862e73b99dcd1cfe35c 100644 --- a/tasks/0075_391_75391350_qa_3/task.toml +++ b/tasks/0075_391_75391350_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_402_75402843_qa_3/environment/bootstrap.sh b/tasks/0075_402_75402843_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_402_75402843_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_402_75402843_qa_3/environment/pull_bucket.py b/tasks/0075_402_75402843_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_402_75402843_qa_3/environment/pull_bucket.py +++ b/tasks/0075_402_75402843_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_402_75402843_qa_3/task.toml b/tasks/0075_402_75402843_qa_3/task.toml index 45e30bc92c8c2d96c6150cb67831d24d60bcfb18..6939dfa5c1131324cf731baf6fea60ab337edcbf 100644 --- a/tasks/0075_402_75402843_qa_3/task.toml +++ b/tasks/0075_402_75402843_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_402_75402843_qa_5/environment/bootstrap.sh b/tasks/0075_402_75402843_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_402_75402843_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_402_75402843_qa_5/environment/pull_bucket.py b/tasks/0075_402_75402843_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_402_75402843_qa_5/environment/pull_bucket.py +++ b/tasks/0075_402_75402843_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_402_75402843_qa_5/task.toml b/tasks/0075_402_75402843_qa_5/task.toml index 49553f214aba2735a9b1319381604d85ba415ac3..9398e2f83c2c90c60b95f8838fe2004ac13f3d37 100644 --- a/tasks/0075_402_75402843_qa_5/task.toml +++ b/tasks/0075_402_75402843_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_543_75543417_qa_5/environment/bootstrap.sh b/tasks/0075_543_75543417_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_543_75543417_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_543_75543417_qa_5/environment/pull_bucket.py b/tasks/0075_543_75543417_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_543_75543417_qa_5/environment/pull_bucket.py +++ b/tasks/0075_543_75543417_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_543_75543417_qa_5/task.toml b/tasks/0075_543_75543417_qa_5/task.toml index 7e7fee471048ff8af613734d2d5c13acbd27937e..c835fc4179165ec09e6e28fb16e6a9c1e672c153 100644 --- a/tasks/0075_543_75543417_qa_5/task.toml +++ b/tasks/0075_543_75543417_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_568_75568531_qa_3/environment/bootstrap.sh b/tasks/0075_568_75568531_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_568_75568531_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_568_75568531_qa_3/environment/pull_bucket.py b/tasks/0075_568_75568531_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_568_75568531_qa_3/environment/pull_bucket.py +++ b/tasks/0075_568_75568531_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_568_75568531_qa_3/task.toml b/tasks/0075_568_75568531_qa_3/task.toml index d957ca2007b913c14e772a4c6b36ed957317fcb3..950f6f85374047b8a1ade1b570cd28ed0d4b71a0 100644 --- a/tasks/0075_568_75568531_qa_3/task.toml +++ b/tasks/0075_568_75568531_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_579_75579600_qa_1/environment/bootstrap.sh b/tasks/0075_579_75579600_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_579_75579600_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_579_75579600_qa_1/environment/pull_bucket.py b/tasks/0075_579_75579600_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_579_75579600_qa_1/environment/pull_bucket.py +++ b/tasks/0075_579_75579600_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_579_75579600_qa_1/task.toml b/tasks/0075_579_75579600_qa_1/task.toml index 5d02ae00fe95b7c153dd6390a1b424eeb9fe98d5..11fd9f1165922c087677092a2ade7762afa6d28f 100644 --- a/tasks/0075_579_75579600_qa_1/task.toml +++ b/tasks/0075_579_75579600_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_579_75579600_qa_3/environment/bootstrap.sh b/tasks/0075_579_75579600_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_579_75579600_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_579_75579600_qa_3/environment/pull_bucket.py b/tasks/0075_579_75579600_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_579_75579600_qa_3/environment/pull_bucket.py +++ b/tasks/0075_579_75579600_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_579_75579600_qa_3/task.toml b/tasks/0075_579_75579600_qa_3/task.toml index fec3b452bb50a11dafe9b472fb849b5df7e53166..e3592e6802b0579b40ea0470905054cbf2b4140d 100644 --- a/tasks/0075_579_75579600_qa_3/task.toml +++ b/tasks/0075_579_75579600_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_579_75579600_qa_4/environment/bootstrap.sh b/tasks/0075_579_75579600_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_579_75579600_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_579_75579600_qa_4/environment/pull_bucket.py b/tasks/0075_579_75579600_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_579_75579600_qa_4/environment/pull_bucket.py +++ b/tasks/0075_579_75579600_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_579_75579600_qa_4/task.toml b/tasks/0075_579_75579600_qa_4/task.toml index dcb5ce1e4d73599d9fbaca2e5cf9643f75893c03..0a4f7c8b1a4b948eb24fbd96226444ee14a9e01f 100644 --- a/tasks/0075_579_75579600_qa_4/task.toml +++ b/tasks/0075_579_75579600_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_579_75579600_qa_5/environment/bootstrap.sh b/tasks/0075_579_75579600_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_579_75579600_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_579_75579600_qa_5/environment/pull_bucket.py b/tasks/0075_579_75579600_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_579_75579600_qa_5/environment/pull_bucket.py +++ b/tasks/0075_579_75579600_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_579_75579600_qa_5/task.toml b/tasks/0075_579_75579600_qa_5/task.toml index 796b4e5c6469e9eaf2f6dd967683f25c48447690..e692b2cf91e192d2e4b956571a25472008234086 100644 --- a/tasks/0075_579_75579600_qa_5/task.toml +++ b/tasks/0075_579_75579600_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_648_75648287_qa_1/environment/bootstrap.sh b/tasks/0075_648_75648287_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_648_75648287_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_648_75648287_qa_1/environment/pull_bucket.py b/tasks/0075_648_75648287_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_648_75648287_qa_1/environment/pull_bucket.py +++ b/tasks/0075_648_75648287_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_648_75648287_qa_1/task.toml b/tasks/0075_648_75648287_qa_1/task.toml index 5a09b454f69ab765b3d8a7970b7aa900110173c9..fbc4a68d3118e534b4dbf209f9839fa9f313b2fe 100644 --- a/tasks/0075_648_75648287_qa_1/task.toml +++ b/tasks/0075_648_75648287_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_744_75744297_qa_3/environment/bootstrap.sh b/tasks/0075_744_75744297_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_744_75744297_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_744_75744297_qa_3/environment/pull_bucket.py b/tasks/0075_744_75744297_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_744_75744297_qa_3/environment/pull_bucket.py +++ b/tasks/0075_744_75744297_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_744_75744297_qa_3/task.toml b/tasks/0075_744_75744297_qa_3/task.toml index fb36dc13c1362cb78c67252bfebaedb54b9e7c52..1572895f483b1d222aa289c7d429a00cdc556d33 100644 --- a/tasks/0075_744_75744297_qa_3/task.toml +++ b/tasks/0075_744_75744297_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_759_75759898_qa_1/environment/bootstrap.sh b/tasks/0075_759_75759898_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_759_75759898_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_759_75759898_qa_1/environment/pull_bucket.py b/tasks/0075_759_75759898_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_759_75759898_qa_1/environment/pull_bucket.py +++ b/tasks/0075_759_75759898_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_759_75759898_qa_1/task.toml b/tasks/0075_759_75759898_qa_1/task.toml index 01755ac46ee7236b7fde3369133adc76e96ce753..8b463e45419ea8f81afc4aedb4271b13303ffec3 100644 --- a/tasks/0075_759_75759898_qa_1/task.toml +++ b/tasks/0075_759_75759898_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_765_75765515_qa_5/environment/bootstrap.sh b/tasks/0075_765_75765515_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_765_75765515_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_765_75765515_qa_5/environment/pull_bucket.py b/tasks/0075_765_75765515_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_765_75765515_qa_5/environment/pull_bucket.py +++ b/tasks/0075_765_75765515_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_765_75765515_qa_5/task.toml b/tasks/0075_765_75765515_qa_5/task.toml index e7a357da54ebb7113e12ac86552a08d216017242..4b511a04d2b0e8f40a5c5dc1a358de650e1dacca 100644 --- a/tasks/0075_765_75765515_qa_5/task.toml +++ b/tasks/0075_765_75765515_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_769_75769467_qa_2/environment/bootstrap.sh b/tasks/0075_769_75769467_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_769_75769467_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_769_75769467_qa_2/environment/pull_bucket.py b/tasks/0075_769_75769467_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_769_75769467_qa_2/environment/pull_bucket.py +++ b/tasks/0075_769_75769467_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_769_75769467_qa_2/task.toml b/tasks/0075_769_75769467_qa_2/task.toml index 48eab93a28072ed183f3e4b7c12a3f1f28d9554c..958fdd4a8bc2fa0cfec9acb764db8aec99b76152 100644 --- a/tasks/0075_769_75769467_qa_2/task.toml +++ b/tasks/0075_769_75769467_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_813_75813284_qa_5/environment/bootstrap.sh b/tasks/0075_813_75813284_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_813_75813284_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_813_75813284_qa_5/environment/pull_bucket.py b/tasks/0075_813_75813284_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_813_75813284_qa_5/environment/pull_bucket.py +++ b/tasks/0075_813_75813284_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_813_75813284_qa_5/task.toml b/tasks/0075_813_75813284_qa_5/task.toml index 9ccce5c87fbcaf7859380ce9d4f16296b7fedb3d..73c1dd10f1a118cf95e6b3ebe64c9f5299e5da45 100644 --- a/tasks/0075_813_75813284_qa_5/task.toml +++ b/tasks/0075_813_75813284_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_886_75886496_qa_2/environment/bootstrap.sh b/tasks/0075_886_75886496_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_886_75886496_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_886_75886496_qa_2/environment/pull_bucket.py b/tasks/0075_886_75886496_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_886_75886496_qa_2/environment/pull_bucket.py +++ b/tasks/0075_886_75886496_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_886_75886496_qa_2/task.toml b/tasks/0075_886_75886496_qa_2/task.toml index 9f90dae6b876387cb7df90aac62b384880eb30ef..ce65c03b2ead7d2a6952439984e6685c49bcfa39 100644 --- a/tasks/0075_886_75886496_qa_2/task.toml +++ b/tasks/0075_886_75886496_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_890_75890673_qa_1/environment/bootstrap.sh b/tasks/0075_890_75890673_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_890_75890673_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_890_75890673_qa_1/environment/pull_bucket.py b/tasks/0075_890_75890673_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_890_75890673_qa_1/environment/pull_bucket.py +++ b/tasks/0075_890_75890673_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_890_75890673_qa_1/task.toml b/tasks/0075_890_75890673_qa_1/task.toml index 900a323d9316600591ff73eca208e2eea339edc1..5eb8d1d6ab88a342c6589fa533fc9589e50b94ee 100644 --- a/tasks/0075_890_75890673_qa_1/task.toml +++ b/tasks/0075_890_75890673_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_890_75890673_qa_3/environment/bootstrap.sh b/tasks/0075_890_75890673_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_890_75890673_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_890_75890673_qa_3/environment/pull_bucket.py b/tasks/0075_890_75890673_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_890_75890673_qa_3/environment/pull_bucket.py +++ b/tasks/0075_890_75890673_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_890_75890673_qa_3/task.toml b/tasks/0075_890_75890673_qa_3/task.toml index 8191851b4db98a31ab9a7544b31d2e541e727bdc..22fed1ebd5f337b5329246e5394fde551f995efe 100644 --- a/tasks/0075_890_75890673_qa_3/task.toml +++ b/tasks/0075_890_75890673_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_890_75890673_qa_4/environment/bootstrap.sh b/tasks/0075_890_75890673_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_890_75890673_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_890_75890673_qa_4/environment/pull_bucket.py b/tasks/0075_890_75890673_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_890_75890673_qa_4/environment/pull_bucket.py +++ b/tasks/0075_890_75890673_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_890_75890673_qa_4/task.toml b/tasks/0075_890_75890673_qa_4/task.toml index 3cde4184bdcf69a759f7b825fb147318551c1634..782124c2ca16bf3b5b767b97a67400e5be62d8a3 100644 --- a/tasks/0075_890_75890673_qa_4/task.toml +++ b/tasks/0075_890_75890673_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0075_984_75984285_qa_1/environment/bootstrap.sh b/tasks/0075_984_75984285_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0075_984_75984285_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0075_984_75984285_qa_1/environment/pull_bucket.py b/tasks/0075_984_75984285_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0075_984_75984285_qa_1/environment/pull_bucket.py +++ b/tasks/0075_984_75984285_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0075_984_75984285_qa_1/task.toml b/tasks/0075_984_75984285_qa_1/task.toml index 4e7d2d6ebc7b4a87160665db80788036ed6af698..d6f7ef4131703eeed180ac15ceb7cfac393f1c8e 100644 --- a/tasks/0075_984_75984285_qa_1/task.toml +++ b/tasks/0075_984_75984285_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_053_76053971_qa_3/environment/bootstrap.sh b/tasks/0076_053_76053971_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_053_76053971_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_053_76053971_qa_3/environment/pull_bucket.py b/tasks/0076_053_76053971_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_053_76053971_qa_3/environment/pull_bucket.py +++ b/tasks/0076_053_76053971_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_053_76053971_qa_3/task.toml b/tasks/0076_053_76053971_qa_3/task.toml index 33f3a4c9667e0ec3eac09ae53a7dd4171a3b4e68..90838ed5643b64f10878718b2be8268ad1dacd59 100644 --- a/tasks/0076_053_76053971_qa_3/task.toml +++ b/tasks/0076_053_76053971_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_072_76072290_qa_1/environment/bootstrap.sh b/tasks/0076_072_76072290_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_072_76072290_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_072_76072290_qa_1/environment/pull_bucket.py b/tasks/0076_072_76072290_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_072_76072290_qa_1/environment/pull_bucket.py +++ b/tasks/0076_072_76072290_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_072_76072290_qa_1/task.toml b/tasks/0076_072_76072290_qa_1/task.toml index 2426ff84c99e5e841d9d163e9b39dc2dc969e99b..7e95ed5191f24d2798f3a969ea244c52e650074d 100644 --- a/tasks/0076_072_76072290_qa_1/task.toml +++ b/tasks/0076_072_76072290_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_072_76072290_qa_5/environment/bootstrap.sh b/tasks/0076_072_76072290_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_072_76072290_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_072_76072290_qa_5/environment/pull_bucket.py b/tasks/0076_072_76072290_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_072_76072290_qa_5/environment/pull_bucket.py +++ b/tasks/0076_072_76072290_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_072_76072290_qa_5/task.toml b/tasks/0076_072_76072290_qa_5/task.toml index 054291a2bd045ee2c527eb1d0bf318204ba86f66..85a4514e1a3659044ce92bc7417b06db774d4fb7 100644 --- a/tasks/0076_072_76072290_qa_5/task.toml +++ b/tasks/0076_072_76072290_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_096_76096011_qa_4/environment/bootstrap.sh b/tasks/0076_096_76096011_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_096_76096011_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_096_76096011_qa_4/environment/pull_bucket.py b/tasks/0076_096_76096011_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_096_76096011_qa_4/environment/pull_bucket.py +++ b/tasks/0076_096_76096011_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_096_76096011_qa_4/task.toml b/tasks/0076_096_76096011_qa_4/task.toml index df64164730facd62343d15e58c4a8dbe6717d947..8fa47b28bc76f0229f865e1fc965f4ec9de4342a 100644 --- a/tasks/0076_096_76096011_qa_4/task.toml +++ b/tasks/0076_096_76096011_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_103_76103911_qa_4/environment/bootstrap.sh b/tasks/0076_103_76103911_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_103_76103911_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_103_76103911_qa_4/environment/pull_bucket.py b/tasks/0076_103_76103911_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_103_76103911_qa_4/environment/pull_bucket.py +++ b/tasks/0076_103_76103911_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_103_76103911_qa_4/task.toml b/tasks/0076_103_76103911_qa_4/task.toml index 665c8ac6cab9bd7afd49ec99174d63ca531e6bc3..44ce78cc24d16b9e11a0fdf8a1a7014830462179 100644 --- a/tasks/0076_103_76103911_qa_4/task.toml +++ b/tasks/0076_103_76103911_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_177_76177455_qa_1/environment/bootstrap.sh b/tasks/0076_177_76177455_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_177_76177455_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_177_76177455_qa_1/environment/pull_bucket.py b/tasks/0076_177_76177455_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_177_76177455_qa_1/environment/pull_bucket.py +++ b/tasks/0076_177_76177455_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_177_76177455_qa_1/task.toml b/tasks/0076_177_76177455_qa_1/task.toml index 34c694c57e38321920893c7e3894587744f837ce..75a026227505bd10742eb3dea4c68c0d5239ba29 100644 --- a/tasks/0076_177_76177455_qa_1/task.toml +++ b/tasks/0076_177_76177455_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_177_76177455_qa_3/environment/bootstrap.sh b/tasks/0076_177_76177455_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_177_76177455_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_177_76177455_qa_3/environment/pull_bucket.py b/tasks/0076_177_76177455_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_177_76177455_qa_3/environment/pull_bucket.py +++ b/tasks/0076_177_76177455_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_177_76177455_qa_3/task.toml b/tasks/0076_177_76177455_qa_3/task.toml index c4f631ba38831c74141459081caf6ec1d49a0b07..cd64a85035c39c047793e3df3166b3b951f57f6c 100644 --- a/tasks/0076_177_76177455_qa_3/task.toml +++ b/tasks/0076_177_76177455_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_236_76236428_qa_2/environment/bootstrap.sh b/tasks/0076_236_76236428_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_236_76236428_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_236_76236428_qa_2/environment/pull_bucket.py b/tasks/0076_236_76236428_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_236_76236428_qa_2/environment/pull_bucket.py +++ b/tasks/0076_236_76236428_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_236_76236428_qa_2/task.toml b/tasks/0076_236_76236428_qa_2/task.toml index b2779e5343a3708fa42422965614304ae217f15b..971e7c0bd4a5d4b7dc8328d576ab901b4e85df96 100644 --- a/tasks/0076_236_76236428_qa_2/task.toml +++ b/tasks/0076_236_76236428_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_236_76236428_qa_5/environment/bootstrap.sh b/tasks/0076_236_76236428_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_236_76236428_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_236_76236428_qa_5/environment/pull_bucket.py b/tasks/0076_236_76236428_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_236_76236428_qa_5/environment/pull_bucket.py +++ b/tasks/0076_236_76236428_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_236_76236428_qa_5/task.toml b/tasks/0076_236_76236428_qa_5/task.toml index 100107bad745a6df41ec5facccb289adbaea6413..2bd0375d22f1b7588cc78e15e7c44356c7e01260 100644 --- a/tasks/0076_236_76236428_qa_5/task.toml +++ b/tasks/0076_236_76236428_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_259_76259625_qa_4/environment/bootstrap.sh b/tasks/0076_259_76259625_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_259_76259625_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_259_76259625_qa_4/environment/pull_bucket.py b/tasks/0076_259_76259625_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_259_76259625_qa_4/environment/pull_bucket.py +++ b/tasks/0076_259_76259625_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_259_76259625_qa_4/task.toml b/tasks/0076_259_76259625_qa_4/task.toml index 7ec8b31012fb06b63303a7097e3f90f70b1f9d5b..2ea69818da027a7d70a248b47bd509e0d943d47c 100644 --- a/tasks/0076_259_76259625_qa_4/task.toml +++ b/tasks/0076_259_76259625_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_273_76273931_qa_3/environment/bootstrap.sh b/tasks/0076_273_76273931_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_273_76273931_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_273_76273931_qa_3/environment/pull_bucket.py b/tasks/0076_273_76273931_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_273_76273931_qa_3/environment/pull_bucket.py +++ b/tasks/0076_273_76273931_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_273_76273931_qa_3/task.toml b/tasks/0076_273_76273931_qa_3/task.toml index b3d6baf498fa0357c35664d2e62832255568e34f..26572c95eb910a71127892f873cae85ca0444c3a 100644 --- a/tasks/0076_273_76273931_qa_3/task.toml +++ b/tasks/0076_273_76273931_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_273_76273931_qa_4/environment/bootstrap.sh b/tasks/0076_273_76273931_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_273_76273931_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_273_76273931_qa_4/environment/pull_bucket.py b/tasks/0076_273_76273931_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_273_76273931_qa_4/environment/pull_bucket.py +++ b/tasks/0076_273_76273931_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_273_76273931_qa_4/task.toml b/tasks/0076_273_76273931_qa_4/task.toml index 1c87e16f923a43b7485e68601a8fcb44ba18803b..a2628bf88174d4437d3e87376835481136c5700c 100644 --- a/tasks/0076_273_76273931_qa_4/task.toml +++ b/tasks/0076_273_76273931_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_274_76274848_qa_3/environment/bootstrap.sh b/tasks/0076_274_76274848_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_274_76274848_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_274_76274848_qa_3/environment/pull_bucket.py b/tasks/0076_274_76274848_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_274_76274848_qa_3/environment/pull_bucket.py +++ b/tasks/0076_274_76274848_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_274_76274848_qa_3/task.toml b/tasks/0076_274_76274848_qa_3/task.toml index 19f215f2d115e5d7065eed438affba7d1bc00e11..1cd355e194f556f7de8af6a8d881d54f7ec1e4d2 100644 --- a/tasks/0076_274_76274848_qa_3/task.toml +++ b/tasks/0076_274_76274848_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_274_76274848_qa_5/environment/bootstrap.sh b/tasks/0076_274_76274848_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_274_76274848_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_274_76274848_qa_5/environment/pull_bucket.py b/tasks/0076_274_76274848_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_274_76274848_qa_5/environment/pull_bucket.py +++ b/tasks/0076_274_76274848_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_274_76274848_qa_5/task.toml b/tasks/0076_274_76274848_qa_5/task.toml index 0ff0fcac93110aff9622640cebb8c89e066e2b7b..f9ee109ab81f760ec0be66d637c048c5cd182579 100644 --- a/tasks/0076_274_76274848_qa_5/task.toml +++ b/tasks/0076_274_76274848_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_296_76296066_qa_2/environment/bootstrap.sh b/tasks/0076_296_76296066_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_296_76296066_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_296_76296066_qa_2/environment/pull_bucket.py b/tasks/0076_296_76296066_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_296_76296066_qa_2/environment/pull_bucket.py +++ b/tasks/0076_296_76296066_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_296_76296066_qa_2/task.toml b/tasks/0076_296_76296066_qa_2/task.toml index f7b350c79c0771557f0a1ffd0b73fb69dbad2d91..7ed37d66911b46694ebb0fc33feaca94f038908c 100644 --- a/tasks/0076_296_76296066_qa_2/task.toml +++ b/tasks/0076_296_76296066_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_298_76298846_qa_3/environment/bootstrap.sh b/tasks/0076_298_76298846_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_298_76298846_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_298_76298846_qa_3/environment/pull_bucket.py b/tasks/0076_298_76298846_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_298_76298846_qa_3/environment/pull_bucket.py +++ b/tasks/0076_298_76298846_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_298_76298846_qa_3/task.toml b/tasks/0076_298_76298846_qa_3/task.toml index 772791ae708fb5b0f64da5f29a88f9c0cbfac236..caa311463d460b4b9f4a18e2d5e40fc12a17a1a0 100644 --- a/tasks/0076_298_76298846_qa_3/task.toml +++ b/tasks/0076_298_76298846_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_310_76310705_qa_1/environment/bootstrap.sh b/tasks/0076_310_76310705_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_310_76310705_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_310_76310705_qa_1/environment/pull_bucket.py b/tasks/0076_310_76310705_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_310_76310705_qa_1/environment/pull_bucket.py +++ b/tasks/0076_310_76310705_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_310_76310705_qa_1/task.toml b/tasks/0076_310_76310705_qa_1/task.toml index b9f9066e351266e0717e46c76a1fb71fa93dc398..79abdf68cbbc4a756fd73875e616bde3950c2430 100644 --- a/tasks/0076_310_76310705_qa_1/task.toml +++ b/tasks/0076_310_76310705_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_310_76310705_qa_3/environment/bootstrap.sh b/tasks/0076_310_76310705_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_310_76310705_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_310_76310705_qa_3/environment/pull_bucket.py b/tasks/0076_310_76310705_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_310_76310705_qa_3/environment/pull_bucket.py +++ b/tasks/0076_310_76310705_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_310_76310705_qa_3/task.toml b/tasks/0076_310_76310705_qa_3/task.toml index 53da9af2408cf919384c5291aec643a010bcb019..e72eb4e3b362b77ba0108e7fc00c349abad444d2 100644 --- a/tasks/0076_310_76310705_qa_3/task.toml +++ b/tasks/0076_310_76310705_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_310_76310922_qa_1/environment/bootstrap.sh b/tasks/0076_310_76310922_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_310_76310922_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_310_76310922_qa_1/environment/pull_bucket.py b/tasks/0076_310_76310922_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_310_76310922_qa_1/environment/pull_bucket.py +++ b/tasks/0076_310_76310922_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_310_76310922_qa_1/task.toml b/tasks/0076_310_76310922_qa_1/task.toml index e80c78a0d244c621e0a271f701b71b6bc3dc872e..e573da43c31abea71ba0585723fb83dd4e391b90 100644 --- a/tasks/0076_310_76310922_qa_1/task.toml +++ b/tasks/0076_310_76310922_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_310_76310922_qa_2/environment/bootstrap.sh b/tasks/0076_310_76310922_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_310_76310922_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_310_76310922_qa_2/environment/pull_bucket.py b/tasks/0076_310_76310922_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_310_76310922_qa_2/environment/pull_bucket.py +++ b/tasks/0076_310_76310922_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_310_76310922_qa_2/task.toml b/tasks/0076_310_76310922_qa_2/task.toml index bcbcbdf29611b0d2409cc7f1f7216ff87bd1075f..7ff0b5a3eb15dda0aa477755ec3421df5ddc5db9 100644 --- a/tasks/0076_310_76310922_qa_2/task.toml +++ b/tasks/0076_310_76310922_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_340_76340399_qa_5/environment/bootstrap.sh b/tasks/0076_340_76340399_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_340_76340399_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_340_76340399_qa_5/environment/pull_bucket.py b/tasks/0076_340_76340399_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_340_76340399_qa_5/environment/pull_bucket.py +++ b/tasks/0076_340_76340399_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_340_76340399_qa_5/task.toml b/tasks/0076_340_76340399_qa_5/task.toml index 8ba195d437263c498777f123e41d5eaf510ed84b..7985eac314fff6fb62bf9d48d6f261f17cbf003a 100644 --- a/tasks/0076_340_76340399_qa_5/task.toml +++ b/tasks/0076_340_76340399_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_359_76359024_qa_1/environment/bootstrap.sh b/tasks/0076_359_76359024_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_359_76359024_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_359_76359024_qa_1/environment/pull_bucket.py b/tasks/0076_359_76359024_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_359_76359024_qa_1/environment/pull_bucket.py +++ b/tasks/0076_359_76359024_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_359_76359024_qa_1/task.toml b/tasks/0076_359_76359024_qa_1/task.toml index 07b552859e9d36870af382feda1234f8e81d82fa..dc06147ff524435b5179094e0e36123e58283e7f 100644 --- a/tasks/0076_359_76359024_qa_1/task.toml +++ b/tasks/0076_359_76359024_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_410_76410509_qa_2/environment/bootstrap.sh b/tasks/0076_410_76410509_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_410_76410509_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_410_76410509_qa_2/environment/pull_bucket.py b/tasks/0076_410_76410509_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_410_76410509_qa_2/environment/pull_bucket.py +++ b/tasks/0076_410_76410509_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_410_76410509_qa_2/task.toml b/tasks/0076_410_76410509_qa_2/task.toml index 0803a075c2846b5f8099dc90b627252f178b1376..4118201b02c2c1353829eae02dcb8f1390d141e6 100644 --- a/tasks/0076_410_76410509_qa_2/task.toml +++ b/tasks/0076_410_76410509_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_501_76501548_qa_3/environment/bootstrap.sh b/tasks/0076_501_76501548_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_501_76501548_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_501_76501548_qa_3/environment/pull_bucket.py b/tasks/0076_501_76501548_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_501_76501548_qa_3/environment/pull_bucket.py +++ b/tasks/0076_501_76501548_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_501_76501548_qa_3/task.toml b/tasks/0076_501_76501548_qa_3/task.toml index d39dff8f17fa0a6696814e747a3772ca9baf2952..0f2e1416fdb9034846c9a03258d01ee80b096197 100644 --- a/tasks/0076_501_76501548_qa_3/task.toml +++ b/tasks/0076_501_76501548_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_540_76540106_qa_1/environment/bootstrap.sh b/tasks/0076_540_76540106_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_540_76540106_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_540_76540106_qa_1/environment/pull_bucket.py b/tasks/0076_540_76540106_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_540_76540106_qa_1/environment/pull_bucket.py +++ b/tasks/0076_540_76540106_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_540_76540106_qa_1/task.toml b/tasks/0076_540_76540106_qa_1/task.toml index 175d8e03f3250eaf8cc4cc1bdde6caaaedbd8895..bb91ca520f0b210bc49611e7712897aa83ddd676 100644 --- a/tasks/0076_540_76540106_qa_1/task.toml +++ b/tasks/0076_540_76540106_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_552_76552424_qa_2/environment/bootstrap.sh b/tasks/0076_552_76552424_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_552_76552424_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_552_76552424_qa_2/environment/pull_bucket.py b/tasks/0076_552_76552424_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_552_76552424_qa_2/environment/pull_bucket.py +++ b/tasks/0076_552_76552424_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_552_76552424_qa_2/task.toml b/tasks/0076_552_76552424_qa_2/task.toml index 588c2c6785d47581ebdd132197951e77143f09a8..79e9886ed62e965e4137675ab5bf5111d64e69ae 100644 --- a/tasks/0076_552_76552424_qa_2/task.toml +++ b/tasks/0076_552_76552424_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_739_76739870_qa_2/environment/bootstrap.sh b/tasks/0076_739_76739870_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_739_76739870_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_739_76739870_qa_2/environment/pull_bucket.py b/tasks/0076_739_76739870_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_739_76739870_qa_2/environment/pull_bucket.py +++ b/tasks/0076_739_76739870_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_739_76739870_qa_2/task.toml b/tasks/0076_739_76739870_qa_2/task.toml index 89a303258829f0d0196cc3ea16c1673300e8cb0a..9817443c3968aa9ad358fd43e2964c8676fc9808 100644 --- a/tasks/0076_739_76739870_qa_2/task.toml +++ b/tasks/0076_739_76739870_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_739_76739870_qa_4/environment/bootstrap.sh b/tasks/0076_739_76739870_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_739_76739870_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_739_76739870_qa_4/environment/pull_bucket.py b/tasks/0076_739_76739870_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_739_76739870_qa_4/environment/pull_bucket.py +++ b/tasks/0076_739_76739870_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_739_76739870_qa_4/task.toml b/tasks/0076_739_76739870_qa_4/task.toml index ce944671400e204334ffce6fa927f47e26553c91..e5bae2905d98d9f4d490173ae488b009ad457880 100644 --- a/tasks/0076_739_76739870_qa_4/task.toml +++ b/tasks/0076_739_76739870_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_740_76740114_qa_3/environment/bootstrap.sh b/tasks/0076_740_76740114_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_740_76740114_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_740_76740114_qa_3/environment/pull_bucket.py b/tasks/0076_740_76740114_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_740_76740114_qa_3/environment/pull_bucket.py +++ b/tasks/0076_740_76740114_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_740_76740114_qa_3/task.toml b/tasks/0076_740_76740114_qa_3/task.toml index 0d02412a16110bdd1aedd2e30de8725edce379af..1aa068665e5f8ee72656507d9420248a75c9f99e 100644 --- a/tasks/0076_740_76740114_qa_3/task.toml +++ b/tasks/0076_740_76740114_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_746_76746181_qa_2/environment/bootstrap.sh b/tasks/0076_746_76746181_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_746_76746181_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_746_76746181_qa_2/environment/pull_bucket.py b/tasks/0076_746_76746181_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_746_76746181_qa_2/environment/pull_bucket.py +++ b/tasks/0076_746_76746181_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_746_76746181_qa_2/task.toml b/tasks/0076_746_76746181_qa_2/task.toml index f06df58068839ba268db65aa00f9ec1129225001..a8033bb364a5802bc20b2b4a1db7e699a8f4c03b 100644 --- a/tasks/0076_746_76746181_qa_2/task.toml +++ b/tasks/0076_746_76746181_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_758_76758480_qa_1/environment/bootstrap.sh b/tasks/0076_758_76758480_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_758_76758480_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_758_76758480_qa_1/environment/pull_bucket.py b/tasks/0076_758_76758480_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_758_76758480_qa_1/environment/pull_bucket.py +++ b/tasks/0076_758_76758480_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_758_76758480_qa_1/task.toml b/tasks/0076_758_76758480_qa_1/task.toml index 21153694762f87b721ebf4464943e7ad4ee50414..6daeea0f360313f3d331e678996f888811b9f841 100644 --- a/tasks/0076_758_76758480_qa_1/task.toml +++ b/tasks/0076_758_76758480_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_770_76770209_qa_1/environment/bootstrap.sh b/tasks/0076_770_76770209_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_770_76770209_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_770_76770209_qa_1/environment/pull_bucket.py b/tasks/0076_770_76770209_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_770_76770209_qa_1/environment/pull_bucket.py +++ b/tasks/0076_770_76770209_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_770_76770209_qa_1/task.toml b/tasks/0076_770_76770209_qa_1/task.toml index a8e8eb550f9b000972855f936e985679f7b1a4f0..2a0db3a60d5cb2a7799b29174c75b619eec0b8ae 100644 --- a/tasks/0076_770_76770209_qa_1/task.toml +++ b/tasks/0076_770_76770209_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_770_76770209_qa_3/environment/bootstrap.sh b/tasks/0076_770_76770209_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_770_76770209_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_770_76770209_qa_3/environment/pull_bucket.py b/tasks/0076_770_76770209_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_770_76770209_qa_3/environment/pull_bucket.py +++ b/tasks/0076_770_76770209_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_770_76770209_qa_3/task.toml b/tasks/0076_770_76770209_qa_3/task.toml index 815f21af0d35084f2e47edfb15c125a629528f64..3f88b18b3ba30b4d4a74badfad7a65c932b60d21 100644 --- a/tasks/0076_770_76770209_qa_3/task.toml +++ b/tasks/0076_770_76770209_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_770_76770209_qa_4/environment/bootstrap.sh b/tasks/0076_770_76770209_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_770_76770209_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_770_76770209_qa_4/environment/pull_bucket.py b/tasks/0076_770_76770209_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_770_76770209_qa_4/environment/pull_bucket.py +++ b/tasks/0076_770_76770209_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_770_76770209_qa_4/task.toml b/tasks/0076_770_76770209_qa_4/task.toml index aae7193b1c78b6553b6fcca0d33cd7167318098b..e2d1a3512a2e1791c89a7f003c1608886ceaf8d6 100644 --- a/tasks/0076_770_76770209_qa_4/task.toml +++ b/tasks/0076_770_76770209_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0076_883_76883860_qa_2/environment/bootstrap.sh b/tasks/0076_883_76883860_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0076_883_76883860_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0076_883_76883860_qa_2/environment/pull_bucket.py b/tasks/0076_883_76883860_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0076_883_76883860_qa_2/environment/pull_bucket.py +++ b/tasks/0076_883_76883860_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0076_883_76883860_qa_2/task.toml b/tasks/0076_883_76883860_qa_2/task.toml index 085f247bdc9766cc5691c2e6a350ea2bc543a022..718993cb208b2c201e4434b5219d788ccc8b2cd7 100644 --- a/tasks/0076_883_76883860_qa_2/task.toml +++ b/tasks/0076_883_76883860_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_004_77004274_qa_1/environment/bootstrap.sh b/tasks/0077_004_77004274_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_004_77004274_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_004_77004274_qa_1/environment/pull_bucket.py b/tasks/0077_004_77004274_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_004_77004274_qa_1/environment/pull_bucket.py +++ b/tasks/0077_004_77004274_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_004_77004274_qa_1/task.toml b/tasks/0077_004_77004274_qa_1/task.toml index 0e6f42411303e6514b66c9106a78ac918430e20e..888d1e8f0343037cfbb6edb7f9c3b87f620f1f0a 100644 --- a/tasks/0077_004_77004274_qa_1/task.toml +++ b/tasks/0077_004_77004274_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_004_77004274_qa_5/environment/bootstrap.sh b/tasks/0077_004_77004274_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_004_77004274_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_004_77004274_qa_5/environment/pull_bucket.py b/tasks/0077_004_77004274_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_004_77004274_qa_5/environment/pull_bucket.py +++ b/tasks/0077_004_77004274_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_004_77004274_qa_5/task.toml b/tasks/0077_004_77004274_qa_5/task.toml index 6a766056bdce552e26f6e393c2fdc580d3f45d69..346c1f87a66e22c72449048ab323cb51e519fb92 100644 --- a/tasks/0077_004_77004274_qa_5/task.toml +++ b/tasks/0077_004_77004274_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_006_77006094_qa_1/environment/bootstrap.sh b/tasks/0077_006_77006094_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_006_77006094_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_006_77006094_qa_1/environment/pull_bucket.py b/tasks/0077_006_77006094_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_006_77006094_qa_1/environment/pull_bucket.py +++ b/tasks/0077_006_77006094_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_006_77006094_qa_1/task.toml b/tasks/0077_006_77006094_qa_1/task.toml index 42eefff180a8824f5a5799b90761fab69e65c8fe..98a046ff9d7b4c33d9badcefb24737ea0c02ed3c 100644 --- a/tasks/0077_006_77006094_qa_1/task.toml +++ b/tasks/0077_006_77006094_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_100_77100984_qa_2/environment/bootstrap.sh b/tasks/0077_100_77100984_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_100_77100984_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_100_77100984_qa_2/environment/pull_bucket.py b/tasks/0077_100_77100984_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_100_77100984_qa_2/environment/pull_bucket.py +++ b/tasks/0077_100_77100984_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_100_77100984_qa_2/task.toml b/tasks/0077_100_77100984_qa_2/task.toml index fd43b1faf768da7f68abf4627ff0a19662e770b4..1fa2486f72aefbf807855d45aed9206d77a6e46c 100644 --- a/tasks/0077_100_77100984_qa_2/task.toml +++ b/tasks/0077_100_77100984_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_100_77100984_qa_3/environment/bootstrap.sh b/tasks/0077_100_77100984_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_100_77100984_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_100_77100984_qa_3/environment/pull_bucket.py b/tasks/0077_100_77100984_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_100_77100984_qa_3/environment/pull_bucket.py +++ b/tasks/0077_100_77100984_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_100_77100984_qa_3/task.toml b/tasks/0077_100_77100984_qa_3/task.toml index 7ce4e1a971f1a3c9a2ebf933776f80743747a067..fb6922816004eb440ea501609f00ced7858b7c55 100644 --- a/tasks/0077_100_77100984_qa_3/task.toml +++ b/tasks/0077_100_77100984_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_130_77130970_qa_5/environment/bootstrap.sh b/tasks/0077_130_77130970_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_130_77130970_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_130_77130970_qa_5/environment/pull_bucket.py b/tasks/0077_130_77130970_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_130_77130970_qa_5/environment/pull_bucket.py +++ b/tasks/0077_130_77130970_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_130_77130970_qa_5/task.toml b/tasks/0077_130_77130970_qa_5/task.toml index 901ec49ee571d6d2b1944ad6394fc618d7b7fd7e..acd1274f047dc466d9f2365d306454896fda416f 100644 --- a/tasks/0077_130_77130970_qa_5/task.toml +++ b/tasks/0077_130_77130970_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_133_77133974_qa_4/environment/bootstrap.sh b/tasks/0077_133_77133974_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_133_77133974_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_133_77133974_qa_4/environment/pull_bucket.py b/tasks/0077_133_77133974_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_133_77133974_qa_4/environment/pull_bucket.py +++ b/tasks/0077_133_77133974_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_133_77133974_qa_4/task.toml b/tasks/0077_133_77133974_qa_4/task.toml index 1c79ee06f628e705381c05a8abdd12b3bb1d9d55..0944c39c9090cfd2cf2d15c359ef0da4bd5fb4e0 100644 --- a/tasks/0077_133_77133974_qa_4/task.toml +++ b/tasks/0077_133_77133974_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_155_77155673_qa_4/environment/bootstrap.sh b/tasks/0077_155_77155673_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_155_77155673_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_155_77155673_qa_4/environment/pull_bucket.py b/tasks/0077_155_77155673_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_155_77155673_qa_4/environment/pull_bucket.py +++ b/tasks/0077_155_77155673_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_155_77155673_qa_4/task.toml b/tasks/0077_155_77155673_qa_4/task.toml index 5f98e62ed906ac738e47dc07405782f284791ba3..d2c1400a3d5f03ad6d3d9fca3a57c7f32564ff32 100644 --- a/tasks/0077_155_77155673_qa_4/task.toml +++ b/tasks/0077_155_77155673_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_165_77165888_qa_1/environment/bootstrap.sh b/tasks/0077_165_77165888_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_165_77165888_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_165_77165888_qa_1/environment/pull_bucket.py b/tasks/0077_165_77165888_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_165_77165888_qa_1/environment/pull_bucket.py +++ b/tasks/0077_165_77165888_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_165_77165888_qa_1/task.toml b/tasks/0077_165_77165888_qa_1/task.toml index 7bd95593d279396bf2378cfc7a6b60c362d937e5..bda1085fc044711d3525519b885054ead8724782 100644 --- a/tasks/0077_165_77165888_qa_1/task.toml +++ b/tasks/0077_165_77165888_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_167_77167063_qa_2/environment/bootstrap.sh b/tasks/0077_167_77167063_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_167_77167063_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_167_77167063_qa_2/environment/pull_bucket.py b/tasks/0077_167_77167063_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_167_77167063_qa_2/environment/pull_bucket.py +++ b/tasks/0077_167_77167063_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_167_77167063_qa_2/task.toml b/tasks/0077_167_77167063_qa_2/task.toml index d12bdc409d34e03e38b3d604a6e595cb646337db..dc6efde3e32b482bc07cb8fe9c762bdadda2915a 100644 --- a/tasks/0077_167_77167063_qa_2/task.toml +++ b/tasks/0077_167_77167063_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_167_77167063_qa_4/environment/bootstrap.sh b/tasks/0077_167_77167063_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_167_77167063_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_167_77167063_qa_4/environment/pull_bucket.py b/tasks/0077_167_77167063_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_167_77167063_qa_4/environment/pull_bucket.py +++ b/tasks/0077_167_77167063_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_167_77167063_qa_4/task.toml b/tasks/0077_167_77167063_qa_4/task.toml index fa72dbb4a219451d276614fc18d893c402834bf2..d912c5203c5a56717ad013ce3dbb1724d174718e 100644 --- a/tasks/0077_167_77167063_qa_4/task.toml +++ b/tasks/0077_167_77167063_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_218_77218707_qa_3/environment/bootstrap.sh b/tasks/0077_218_77218707_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_218_77218707_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_218_77218707_qa_3/environment/pull_bucket.py b/tasks/0077_218_77218707_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_218_77218707_qa_3/environment/pull_bucket.py +++ b/tasks/0077_218_77218707_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_218_77218707_qa_3/task.toml b/tasks/0077_218_77218707_qa_3/task.toml index 0badcabf6625b35bd236e2be53337dba1a7a154f..83d38761501b0ab6edd4569f3ba6288a8e931d38 100644 --- a/tasks/0077_218_77218707_qa_3/task.toml +++ b/tasks/0077_218_77218707_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_218_77218707_qa_4/environment/bootstrap.sh b/tasks/0077_218_77218707_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_218_77218707_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_218_77218707_qa_4/environment/pull_bucket.py b/tasks/0077_218_77218707_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_218_77218707_qa_4/environment/pull_bucket.py +++ b/tasks/0077_218_77218707_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_218_77218707_qa_4/task.toml b/tasks/0077_218_77218707_qa_4/task.toml index a87f8ca2f3896d333f712281bb49cf0ff198dcc6..9f89ff2eb54be41981119c87801e8dae47cff426 100644 --- a/tasks/0077_218_77218707_qa_4/task.toml +++ b/tasks/0077_218_77218707_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_266_77266642_qa_3/environment/bootstrap.sh b/tasks/0077_266_77266642_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_266_77266642_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_266_77266642_qa_3/environment/pull_bucket.py b/tasks/0077_266_77266642_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_266_77266642_qa_3/environment/pull_bucket.py +++ b/tasks/0077_266_77266642_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_266_77266642_qa_3/task.toml b/tasks/0077_266_77266642_qa_3/task.toml index f081962d3061991e75264b1fe575050a0155c769..d1e39604f7ae04fc1f6e4707d26837db5ba8ecb7 100644 --- a/tasks/0077_266_77266642_qa_3/task.toml +++ b/tasks/0077_266_77266642_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_322_77322684_qa_2/environment/bootstrap.sh b/tasks/0077_322_77322684_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_322_77322684_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_322_77322684_qa_2/environment/pull_bucket.py b/tasks/0077_322_77322684_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_322_77322684_qa_2/environment/pull_bucket.py +++ b/tasks/0077_322_77322684_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_322_77322684_qa_2/task.toml b/tasks/0077_322_77322684_qa_2/task.toml index 02da4ba0b7793ac2b1dee4087e7bf34982d87057..c576bd77362628ec9a1345ee4f8d38617dfd34bd 100644 --- a/tasks/0077_322_77322684_qa_2/task.toml +++ b/tasks/0077_322_77322684_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_322_77322684_qa_3/environment/bootstrap.sh b/tasks/0077_322_77322684_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_322_77322684_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_322_77322684_qa_3/environment/pull_bucket.py b/tasks/0077_322_77322684_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_322_77322684_qa_3/environment/pull_bucket.py +++ b/tasks/0077_322_77322684_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_322_77322684_qa_3/task.toml b/tasks/0077_322_77322684_qa_3/task.toml index ed0603306c1ab1ac8aecd11b91f98f5bbba260e5..aa4410ba7c1608ad46897280387fe096185c4de4 100644 --- a/tasks/0077_322_77322684_qa_3/task.toml +++ b/tasks/0077_322_77322684_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_497_77497432_qa_1/environment/bootstrap.sh b/tasks/0077_497_77497432_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_497_77497432_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_497_77497432_qa_1/environment/pull_bucket.py b/tasks/0077_497_77497432_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_497_77497432_qa_1/environment/pull_bucket.py +++ b/tasks/0077_497_77497432_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_497_77497432_qa_1/task.toml b/tasks/0077_497_77497432_qa_1/task.toml index e18a9797cf745e55df9d1e2c3ae5bfc0b0652d23..a75e65e080ef5f86e3b0257b5fac9d0f0530b337 100644 --- a/tasks/0077_497_77497432_qa_1/task.toml +++ b/tasks/0077_497_77497432_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_497_77497432_qa_2/environment/bootstrap.sh b/tasks/0077_497_77497432_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_497_77497432_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_497_77497432_qa_2/environment/pull_bucket.py b/tasks/0077_497_77497432_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_497_77497432_qa_2/environment/pull_bucket.py +++ b/tasks/0077_497_77497432_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_497_77497432_qa_2/task.toml b/tasks/0077_497_77497432_qa_2/task.toml index 112d8f35db6e0912860504226a11d20fa36b9c79..ddb425ad12b222bb55877c03bf9c08a7bd1e21c0 100644 --- a/tasks/0077_497_77497432_qa_2/task.toml +++ b/tasks/0077_497_77497432_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_528_77528261_qa_3/environment/bootstrap.sh b/tasks/0077_528_77528261_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_528_77528261_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_528_77528261_qa_3/environment/pull_bucket.py b/tasks/0077_528_77528261_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_528_77528261_qa_3/environment/pull_bucket.py +++ b/tasks/0077_528_77528261_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_528_77528261_qa_3/task.toml b/tasks/0077_528_77528261_qa_3/task.toml index d706f8457ecceef18fabb6361340fee6f0c19330..3054ce0523b3d01dedc09dffc436af5ba4ea8576 100644 --- a/tasks/0077_528_77528261_qa_3/task.toml +++ b/tasks/0077_528_77528261_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_529_77529364_qa_1/environment/bootstrap.sh b/tasks/0077_529_77529364_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_529_77529364_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_529_77529364_qa_1/environment/pull_bucket.py b/tasks/0077_529_77529364_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_529_77529364_qa_1/environment/pull_bucket.py +++ b/tasks/0077_529_77529364_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_529_77529364_qa_1/task.toml b/tasks/0077_529_77529364_qa_1/task.toml index 7db94ee9fd51b0627a6bbbb36c08b837ae9bb70a..acadfd76b5baa32f5899679f89e897bf3fc23aaf 100644 --- a/tasks/0077_529_77529364_qa_1/task.toml +++ b/tasks/0077_529_77529364_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_529_77529364_qa_3/environment/bootstrap.sh b/tasks/0077_529_77529364_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_529_77529364_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_529_77529364_qa_3/environment/pull_bucket.py b/tasks/0077_529_77529364_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_529_77529364_qa_3/environment/pull_bucket.py +++ b/tasks/0077_529_77529364_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_529_77529364_qa_3/task.toml b/tasks/0077_529_77529364_qa_3/task.toml index fb5b3e7aaa4c3ce8fde5014535d4f5037e45659e..2dbbf77b75c219c53b4ad28fc1c529872a156ea2 100644 --- a/tasks/0077_529_77529364_qa_3/task.toml +++ b/tasks/0077_529_77529364_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_558_77558936_qa_3/environment/bootstrap.sh b/tasks/0077_558_77558936_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_558_77558936_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_558_77558936_qa_3/environment/pull_bucket.py b/tasks/0077_558_77558936_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_558_77558936_qa_3/environment/pull_bucket.py +++ b/tasks/0077_558_77558936_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_558_77558936_qa_3/task.toml b/tasks/0077_558_77558936_qa_3/task.toml index b07daddfd584fad14bb5fb2817963f71d167c075..ad45ef1aab245bb88c55202a2c7293b9576a8a60 100644 --- a/tasks/0077_558_77558936_qa_3/task.toml +++ b/tasks/0077_558_77558936_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_572_77572617_qa_2/environment/bootstrap.sh b/tasks/0077_572_77572617_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_572_77572617_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_572_77572617_qa_2/environment/pull_bucket.py b/tasks/0077_572_77572617_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_572_77572617_qa_2/environment/pull_bucket.py +++ b/tasks/0077_572_77572617_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_572_77572617_qa_2/task.toml b/tasks/0077_572_77572617_qa_2/task.toml index 7f0ef975a1d4e08f3b9973dbbf7d6d8ced2a929f..dab9f5d5bcff00c2a1f01b810fcf746196ab4032 100644 --- a/tasks/0077_572_77572617_qa_2/task.toml +++ b/tasks/0077_572_77572617_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_572_77572617_qa_3/environment/bootstrap.sh b/tasks/0077_572_77572617_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_572_77572617_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_572_77572617_qa_3/environment/pull_bucket.py b/tasks/0077_572_77572617_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_572_77572617_qa_3/environment/pull_bucket.py +++ b/tasks/0077_572_77572617_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_572_77572617_qa_3/task.toml b/tasks/0077_572_77572617_qa_3/task.toml index e24f4de2af89e2205acf52d0d9a839066c51162d..e671fa24232f21fecb5d289d062e94a39b554804 100644 --- a/tasks/0077_572_77572617_qa_3/task.toml +++ b/tasks/0077_572_77572617_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_578_77578267_qa_2/environment/bootstrap.sh b/tasks/0077_578_77578267_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_578_77578267_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_578_77578267_qa_2/environment/pull_bucket.py b/tasks/0077_578_77578267_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_578_77578267_qa_2/environment/pull_bucket.py +++ b/tasks/0077_578_77578267_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_578_77578267_qa_2/task.toml b/tasks/0077_578_77578267_qa_2/task.toml index 742c5338772e6ab34064be4417a686281eefed9d..8f6147a9cf0e66697d90d7755e50b2da31b787ab 100644 --- a/tasks/0077_578_77578267_qa_2/task.toml +++ b/tasks/0077_578_77578267_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_578_77578267_qa_4/environment/bootstrap.sh b/tasks/0077_578_77578267_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_578_77578267_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_578_77578267_qa_4/environment/pull_bucket.py b/tasks/0077_578_77578267_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_578_77578267_qa_4/environment/pull_bucket.py +++ b/tasks/0077_578_77578267_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_578_77578267_qa_4/task.toml b/tasks/0077_578_77578267_qa_4/task.toml index 93b4fe2fba173825ea10d105f490b33fe074436d..4f941bbe83204bbd2224ff549ff07b73f2f0842d 100644 --- a/tasks/0077_578_77578267_qa_4/task.toml +++ b/tasks/0077_578_77578267_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_599_77599751_qa_4/environment/bootstrap.sh b/tasks/0077_599_77599751_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_599_77599751_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_599_77599751_qa_4/environment/pull_bucket.py b/tasks/0077_599_77599751_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_599_77599751_qa_4/environment/pull_bucket.py +++ b/tasks/0077_599_77599751_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_599_77599751_qa_4/task.toml b/tasks/0077_599_77599751_qa_4/task.toml index 90013255f6dc4c4e58c0da7a5a64e66f8371ac95..851eb795d32e3196eb5b23246d3805f95a5b908f 100644 --- a/tasks/0077_599_77599751_qa_4/task.toml +++ b/tasks/0077_599_77599751_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_602_77602560_qa_2/environment/bootstrap.sh b/tasks/0077_602_77602560_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_602_77602560_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_602_77602560_qa_2/environment/pull_bucket.py b/tasks/0077_602_77602560_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_602_77602560_qa_2/environment/pull_bucket.py +++ b/tasks/0077_602_77602560_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_602_77602560_qa_2/task.toml b/tasks/0077_602_77602560_qa_2/task.toml index 75594d16aff84d380646e283d49662ac31bc4c5d..b906f593babbee986a2b77dc02f287ea2b5c921d 100644 --- a/tasks/0077_602_77602560_qa_2/task.toml +++ b/tasks/0077_602_77602560_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_602_77602560_qa_5/environment/bootstrap.sh b/tasks/0077_602_77602560_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_602_77602560_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_602_77602560_qa_5/environment/pull_bucket.py b/tasks/0077_602_77602560_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_602_77602560_qa_5/environment/pull_bucket.py +++ b/tasks/0077_602_77602560_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_602_77602560_qa_5/task.toml b/tasks/0077_602_77602560_qa_5/task.toml index 8fa9b70eef7ea03fe0083da36b000dae787c93d3..6e0b7e1dd1b40bf2232e1a0d8e34253d8f212292 100644 --- a/tasks/0077_602_77602560_qa_5/task.toml +++ b/tasks/0077_602_77602560_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_684_77684454_qa_2/environment/bootstrap.sh b/tasks/0077_684_77684454_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_684_77684454_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_684_77684454_qa_2/environment/pull_bucket.py b/tasks/0077_684_77684454_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_684_77684454_qa_2/environment/pull_bucket.py +++ b/tasks/0077_684_77684454_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_684_77684454_qa_2/task.toml b/tasks/0077_684_77684454_qa_2/task.toml index c594d9fbb5bf8397a5e56634c9d9b7898450fc08..b67d87c2ec43a3ece0d755b65729272d48061ede 100644 --- a/tasks/0077_684_77684454_qa_2/task.toml +++ b/tasks/0077_684_77684454_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_684_77684454_qa_5/environment/bootstrap.sh b/tasks/0077_684_77684454_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_684_77684454_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_684_77684454_qa_5/environment/pull_bucket.py b/tasks/0077_684_77684454_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_684_77684454_qa_5/environment/pull_bucket.py +++ b/tasks/0077_684_77684454_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_684_77684454_qa_5/task.toml b/tasks/0077_684_77684454_qa_5/task.toml index a8d7b203f98b1ca9e92ea0af3e0c8cfac4ea2435..cc52fd8ac7023dc67849a1ab01e1fe5becde3bbd 100644 --- a/tasks/0077_684_77684454_qa_5/task.toml +++ b/tasks/0077_684_77684454_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_724_77724747_qa_3/environment/bootstrap.sh b/tasks/0077_724_77724747_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_724_77724747_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_724_77724747_qa_3/environment/pull_bucket.py b/tasks/0077_724_77724747_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_724_77724747_qa_3/environment/pull_bucket.py +++ b/tasks/0077_724_77724747_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_724_77724747_qa_3/task.toml b/tasks/0077_724_77724747_qa_3/task.toml index fe40b0220770f30c0028dbe2e986077dc7705a5c..b6fe21e7bb884120b4be28ff0eb9d1c9140d711e 100644 --- a/tasks/0077_724_77724747_qa_3/task.toml +++ b/tasks/0077_724_77724747_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_800_77800758_qa_5/environment/bootstrap.sh b/tasks/0077_800_77800758_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_800_77800758_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_800_77800758_qa_5/environment/pull_bucket.py b/tasks/0077_800_77800758_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_800_77800758_qa_5/environment/pull_bucket.py +++ b/tasks/0077_800_77800758_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_800_77800758_qa_5/task.toml b/tasks/0077_800_77800758_qa_5/task.toml index 09e86b81f28b886a9b8ea8281f6db3bd4f1b8bf1..0d8608e63f0d994fe6b14dbc890cc300ee7d195c 100644 --- a/tasks/0077_800_77800758_qa_5/task.toml +++ b/tasks/0077_800_77800758_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_816_77816040_qa_5/environment/bootstrap.sh b/tasks/0077_816_77816040_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_816_77816040_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_816_77816040_qa_5/environment/pull_bucket.py b/tasks/0077_816_77816040_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_816_77816040_qa_5/environment/pull_bucket.py +++ b/tasks/0077_816_77816040_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_816_77816040_qa_5/task.toml b/tasks/0077_816_77816040_qa_5/task.toml index 93e91aabcb094d4c5488d277a4661ce61faf41b9..36ee8c6709e39eb9e7de63f17548308980d6b63a 100644 --- a/tasks/0077_816_77816040_qa_5/task.toml +++ b/tasks/0077_816_77816040_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_845_77845573_qa_5/environment/bootstrap.sh b/tasks/0077_845_77845573_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_845_77845573_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_845_77845573_qa_5/environment/pull_bucket.py b/tasks/0077_845_77845573_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_845_77845573_qa_5/environment/pull_bucket.py +++ b/tasks/0077_845_77845573_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_845_77845573_qa_5/task.toml b/tasks/0077_845_77845573_qa_5/task.toml index dc1989c9c484ffb195878ad4c219bcb27fdb7dce..9f2c6a7490dca5ed05321d3714cfa5d2eb8432df 100644 --- a/tasks/0077_845_77845573_qa_5/task.toml +++ b/tasks/0077_845_77845573_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_854_77854158_qa_2/environment/bootstrap.sh b/tasks/0077_854_77854158_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_854_77854158_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_854_77854158_qa_2/environment/pull_bucket.py b/tasks/0077_854_77854158_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_854_77854158_qa_2/environment/pull_bucket.py +++ b/tasks/0077_854_77854158_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_854_77854158_qa_2/task.toml b/tasks/0077_854_77854158_qa_2/task.toml index de0e0faba647048de625b65a6dc5e790478e5911..def8e0ea480c1d4dbc60834d70760505e25010d9 100644 --- a/tasks/0077_854_77854158_qa_2/task.toml +++ b/tasks/0077_854_77854158_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_889_77889442_qa_1/environment/bootstrap.sh b/tasks/0077_889_77889442_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_889_77889442_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_889_77889442_qa_1/environment/pull_bucket.py b/tasks/0077_889_77889442_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_889_77889442_qa_1/environment/pull_bucket.py +++ b/tasks/0077_889_77889442_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_889_77889442_qa_1/task.toml b/tasks/0077_889_77889442_qa_1/task.toml index 03ed0e3f47f9f06df6b89d168f3133149f8f8e8e..6db1a120a2487b7c2e6ec25f89a414db8cc3c549 100644 --- a/tasks/0077_889_77889442_qa_1/task.toml +++ b/tasks/0077_889_77889442_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_889_77889442_qa_5/environment/bootstrap.sh b/tasks/0077_889_77889442_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_889_77889442_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_889_77889442_qa_5/environment/pull_bucket.py b/tasks/0077_889_77889442_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_889_77889442_qa_5/environment/pull_bucket.py +++ b/tasks/0077_889_77889442_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_889_77889442_qa_5/task.toml b/tasks/0077_889_77889442_qa_5/task.toml index 4f4dd5b945ff47858f43ccedca0311bf0dfe3c7a..54870b1f16a0c92de3b875fd37d17205f8316666 100644 --- a/tasks/0077_889_77889442_qa_5/task.toml +++ b/tasks/0077_889_77889442_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_902_77902994_qa_1/environment/bootstrap.sh b/tasks/0077_902_77902994_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_902_77902994_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_902_77902994_qa_1/environment/pull_bucket.py b/tasks/0077_902_77902994_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_902_77902994_qa_1/environment/pull_bucket.py +++ b/tasks/0077_902_77902994_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_902_77902994_qa_1/task.toml b/tasks/0077_902_77902994_qa_1/task.toml index e2f89cf462e513ad498aa3b569b5691ac8e7391e..0ba70cc5e386f922542e8deb7c7c2060e65cd128 100644 --- a/tasks/0077_902_77902994_qa_1/task.toml +++ b/tasks/0077_902_77902994_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_902_77902994_qa_2/environment/bootstrap.sh b/tasks/0077_902_77902994_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_902_77902994_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_902_77902994_qa_2/environment/pull_bucket.py b/tasks/0077_902_77902994_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_902_77902994_qa_2/environment/pull_bucket.py +++ b/tasks/0077_902_77902994_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_902_77902994_qa_2/task.toml b/tasks/0077_902_77902994_qa_2/task.toml index 65f787cd8265c196ffdcf23459e2813bc3d67159..bd3d31b192643fa3a43cee1174a65960daf145df 100644 --- a/tasks/0077_902_77902994_qa_2/task.toml +++ b/tasks/0077_902_77902994_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_965_77965722_qa_2/environment/bootstrap.sh b/tasks/0077_965_77965722_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_965_77965722_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_965_77965722_qa_2/environment/pull_bucket.py b/tasks/0077_965_77965722_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_965_77965722_qa_2/environment/pull_bucket.py +++ b/tasks/0077_965_77965722_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_965_77965722_qa_2/task.toml b/tasks/0077_965_77965722_qa_2/task.toml index 43dba5b292aded08f5b30b9c7cb2696bb7a4cb94..9cc2c0da540f556d004456823b8c6a19330aacab 100644 --- a/tasks/0077_965_77965722_qa_2/task.toml +++ b/tasks/0077_965_77965722_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0077_978_77978673_qa_3/environment/bootstrap.sh b/tasks/0077_978_77978673_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0077_978_77978673_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0077_978_77978673_qa_3/environment/pull_bucket.py b/tasks/0077_978_77978673_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0077_978_77978673_qa_3/environment/pull_bucket.py +++ b/tasks/0077_978_77978673_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0077_978_77978673_qa_3/task.toml b/tasks/0077_978_77978673_qa_3/task.toml index 5d500603cd39efe6115be4e4a9ccb06d5d82017a..9aac1a35e00285950b4615fc5e052a5c51d06529 100644 --- a/tasks/0077_978_77978673_qa_3/task.toml +++ b/tasks/0077_978_77978673_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_197_78197106_qa_4/environment/bootstrap.sh b/tasks/0078_197_78197106_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_197_78197106_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_197_78197106_qa_4/environment/pull_bucket.py b/tasks/0078_197_78197106_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_197_78197106_qa_4/environment/pull_bucket.py +++ b/tasks/0078_197_78197106_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_197_78197106_qa_4/task.toml b/tasks/0078_197_78197106_qa_4/task.toml index 78fc25e76f3ddbb5d2c6fdd14d24e958e743f85d..e24b64c85b10ee43054b459565c1698d1b72f6a3 100644 --- a/tasks/0078_197_78197106_qa_4/task.toml +++ b/tasks/0078_197_78197106_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_208_78208139_qa_3/environment/bootstrap.sh b/tasks/0078_208_78208139_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_208_78208139_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_208_78208139_qa_3/environment/pull_bucket.py b/tasks/0078_208_78208139_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_208_78208139_qa_3/environment/pull_bucket.py +++ b/tasks/0078_208_78208139_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_208_78208139_qa_3/task.toml b/tasks/0078_208_78208139_qa_3/task.toml index de5a8e9a9d5900cd06c5c9df96f9eba8a761928a..e2815d50f57ddad5280bca75a09af161c1b57e98 100644 --- a/tasks/0078_208_78208139_qa_3/task.toml +++ b/tasks/0078_208_78208139_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_329_78329159_qa_2/environment/bootstrap.sh b/tasks/0078_329_78329159_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_329_78329159_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_329_78329159_qa_2/environment/pull_bucket.py b/tasks/0078_329_78329159_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_329_78329159_qa_2/environment/pull_bucket.py +++ b/tasks/0078_329_78329159_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_329_78329159_qa_2/task.toml b/tasks/0078_329_78329159_qa_2/task.toml index 65363244c59fdf8150661fc0fcd663bedcd96b4b..073179568a00174149e2d09243cb7ddae691cb19 100644 --- a/tasks/0078_329_78329159_qa_2/task.toml +++ b/tasks/0078_329_78329159_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_329_78329159_qa_3/environment/bootstrap.sh b/tasks/0078_329_78329159_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_329_78329159_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_329_78329159_qa_3/environment/pull_bucket.py b/tasks/0078_329_78329159_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_329_78329159_qa_3/environment/pull_bucket.py +++ b/tasks/0078_329_78329159_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_329_78329159_qa_3/task.toml b/tasks/0078_329_78329159_qa_3/task.toml index 5a71b455e6b094ba98cdabc78e4504ec32f23d93..84b412122b065964bdee7ebcb707bab1892f4899 100644 --- a/tasks/0078_329_78329159_qa_3/task.toml +++ b/tasks/0078_329_78329159_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_483_78483410_qa_3/environment/bootstrap.sh b/tasks/0078_483_78483410_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_483_78483410_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_483_78483410_qa_3/environment/pull_bucket.py b/tasks/0078_483_78483410_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_483_78483410_qa_3/environment/pull_bucket.py +++ b/tasks/0078_483_78483410_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_483_78483410_qa_3/task.toml b/tasks/0078_483_78483410_qa_3/task.toml index fc5f273bce69ba3942f0cd6422ba6220d7252be8..2587941a8d54518426f1182f4120581a3b73549a 100644 --- a/tasks/0078_483_78483410_qa_3/task.toml +++ b/tasks/0078_483_78483410_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_655_78655226_qa_3/environment/bootstrap.sh b/tasks/0078_655_78655226_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_655_78655226_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_655_78655226_qa_3/environment/pull_bucket.py b/tasks/0078_655_78655226_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_655_78655226_qa_3/environment/pull_bucket.py +++ b/tasks/0078_655_78655226_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_655_78655226_qa_3/task.toml b/tasks/0078_655_78655226_qa_3/task.toml index 847e6b9f6234624f3a901a1e010f98444f151f84..1502d6f87ec648e9ba7fd39c9a94355bcad9eb7a 100644 --- a/tasks/0078_655_78655226_qa_3/task.toml +++ b/tasks/0078_655_78655226_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_655_78655226_qa_5/environment/bootstrap.sh b/tasks/0078_655_78655226_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_655_78655226_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_655_78655226_qa_5/environment/pull_bucket.py b/tasks/0078_655_78655226_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_655_78655226_qa_5/environment/pull_bucket.py +++ b/tasks/0078_655_78655226_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_655_78655226_qa_5/task.toml b/tasks/0078_655_78655226_qa_5/task.toml index d30551186609153439662fdd507632337c7d6ef6..fcdf6e630cf81931e6362bbd72915f629fffdd83 100644 --- a/tasks/0078_655_78655226_qa_5/task.toml +++ b/tasks/0078_655_78655226_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_661_78661279_qa_1/environment/bootstrap.sh b/tasks/0078_661_78661279_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_661_78661279_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_661_78661279_qa_1/environment/pull_bucket.py b/tasks/0078_661_78661279_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_661_78661279_qa_1/environment/pull_bucket.py +++ b/tasks/0078_661_78661279_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_661_78661279_qa_1/task.toml b/tasks/0078_661_78661279_qa_1/task.toml index f498be03a31dc52e60096cd71d4dd379dcfda552..74132c684d59744894ddeb1ab9f758e279a91783 100644 --- a/tasks/0078_661_78661279_qa_1/task.toml +++ b/tasks/0078_661_78661279_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_661_78661279_qa_3/environment/bootstrap.sh b/tasks/0078_661_78661279_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_661_78661279_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_661_78661279_qa_3/environment/pull_bucket.py b/tasks/0078_661_78661279_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_661_78661279_qa_3/environment/pull_bucket.py +++ b/tasks/0078_661_78661279_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_661_78661279_qa_3/task.toml b/tasks/0078_661_78661279_qa_3/task.toml index 5379081eda6c45070240de98476626e4e1ce7621..e62fd40e4a023cac0f20ea7cf692391531ed27cf 100644 --- a/tasks/0078_661_78661279_qa_3/task.toml +++ b/tasks/0078_661_78661279_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_661_78661279_qa_5/environment/bootstrap.sh b/tasks/0078_661_78661279_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_661_78661279_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_661_78661279_qa_5/environment/pull_bucket.py b/tasks/0078_661_78661279_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_661_78661279_qa_5/environment/pull_bucket.py +++ b/tasks/0078_661_78661279_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_661_78661279_qa_5/task.toml b/tasks/0078_661_78661279_qa_5/task.toml index 62e27d56b30d10707bc1caf69d9ed8f5610eb002..1e7725bf7a5b9766f94dc48a07c66fa29b33f309 100644 --- a/tasks/0078_661_78661279_qa_5/task.toml +++ b/tasks/0078_661_78661279_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_779_78779265_qa_1/environment/bootstrap.sh b/tasks/0078_779_78779265_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_779_78779265_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_779_78779265_qa_1/environment/pull_bucket.py b/tasks/0078_779_78779265_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_779_78779265_qa_1/environment/pull_bucket.py +++ b/tasks/0078_779_78779265_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_779_78779265_qa_1/task.toml b/tasks/0078_779_78779265_qa_1/task.toml index 651339a46b680a0ee9d77c05ae28b90f8e3f6f5e..cfb654b5ace345f018f13f04ec7224ea8afbade5 100644 --- a/tasks/0078_779_78779265_qa_1/task.toml +++ b/tasks/0078_779_78779265_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_857_78857883_qa_1/environment/bootstrap.sh b/tasks/0078_857_78857883_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_857_78857883_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_857_78857883_qa_1/environment/pull_bucket.py b/tasks/0078_857_78857883_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_857_78857883_qa_1/environment/pull_bucket.py +++ b/tasks/0078_857_78857883_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_857_78857883_qa_1/task.toml b/tasks/0078_857_78857883_qa_1/task.toml index 9b8142534964f72276a64b9d80fc2dfe3884c5d2..fd7b14505fa14c358f52df89520d89e50a4a371d 100644 --- a/tasks/0078_857_78857883_qa_1/task.toml +++ b/tasks/0078_857_78857883_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0078_900_78900393_qa_5/environment/bootstrap.sh b/tasks/0078_900_78900393_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0078_900_78900393_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0078_900_78900393_qa_5/environment/pull_bucket.py b/tasks/0078_900_78900393_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0078_900_78900393_qa_5/environment/pull_bucket.py +++ b/tasks/0078_900_78900393_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0078_900_78900393_qa_5/task.toml b/tasks/0078_900_78900393_qa_5/task.toml index 6425c338fd6edbf2b45900b2453135d1af5e26e3..10b82aa97a798cb08a807459417ce3d245f3ce81 100644 --- a/tasks/0078_900_78900393_qa_5/task.toml +++ b/tasks/0078_900_78900393_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_150_79150881_qa_3/environment/bootstrap.sh b/tasks/0079_150_79150881_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_150_79150881_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_150_79150881_qa_3/environment/pull_bucket.py b/tasks/0079_150_79150881_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_150_79150881_qa_3/environment/pull_bucket.py +++ b/tasks/0079_150_79150881_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_150_79150881_qa_3/task.toml b/tasks/0079_150_79150881_qa_3/task.toml index 1db48c80878237d4bb22510198056e61948c9d02..ec3c618e5b01f075ce86e120c31055da127c98ae 100644 --- a/tasks/0079_150_79150881_qa_3/task.toml +++ b/tasks/0079_150_79150881_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_150_79150881_qa_4/environment/bootstrap.sh b/tasks/0079_150_79150881_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_150_79150881_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_150_79150881_qa_4/environment/pull_bucket.py b/tasks/0079_150_79150881_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_150_79150881_qa_4/environment/pull_bucket.py +++ b/tasks/0079_150_79150881_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_150_79150881_qa_4/task.toml b/tasks/0079_150_79150881_qa_4/task.toml index 67977895ae5c26fe5572dbecbd7018aee6176933..d72d0f439af572289613841fe1dda7b4d305be8f 100644 --- a/tasks/0079_150_79150881_qa_4/task.toml +++ b/tasks/0079_150_79150881_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_355_79355803_qa_3/environment/bootstrap.sh b/tasks/0079_355_79355803_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_355_79355803_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_355_79355803_qa_3/environment/pull_bucket.py b/tasks/0079_355_79355803_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_355_79355803_qa_3/environment/pull_bucket.py +++ b/tasks/0079_355_79355803_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_355_79355803_qa_3/task.toml b/tasks/0079_355_79355803_qa_3/task.toml index 8a664c1e577fa5016ba0dde7f96a38d64bff39ce..0525b925a7597f7ad5dd2a218a008ccb5df39702 100644 --- a/tasks/0079_355_79355803_qa_3/task.toml +++ b/tasks/0079_355_79355803_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_355_79355803_qa_4/environment/bootstrap.sh b/tasks/0079_355_79355803_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_355_79355803_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_355_79355803_qa_4/environment/pull_bucket.py b/tasks/0079_355_79355803_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_355_79355803_qa_4/environment/pull_bucket.py +++ b/tasks/0079_355_79355803_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_355_79355803_qa_4/task.toml b/tasks/0079_355_79355803_qa_4/task.toml index 96ffd1f08c03aacdf9963fdfd08cdb5f401a0949..63c6d72fb6b3125085e73ce32a8923367873d04f 100644 --- a/tasks/0079_355_79355803_qa_4/task.toml +++ b/tasks/0079_355_79355803_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_455_79455690_qa_1/environment/bootstrap.sh b/tasks/0079_455_79455690_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_455_79455690_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_455_79455690_qa_1/environment/pull_bucket.py b/tasks/0079_455_79455690_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_455_79455690_qa_1/environment/pull_bucket.py +++ b/tasks/0079_455_79455690_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_455_79455690_qa_1/task.toml b/tasks/0079_455_79455690_qa_1/task.toml index 87746b34d0f34718a1eef19b55df3cac3dee1f29..b985371f043174f4368d443c19490976a1a189e3 100644 --- a/tasks/0079_455_79455690_qa_1/task.toml +++ b/tasks/0079_455_79455690_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_455_79455690_qa_4/environment/bootstrap.sh b/tasks/0079_455_79455690_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_455_79455690_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_455_79455690_qa_4/environment/pull_bucket.py b/tasks/0079_455_79455690_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_455_79455690_qa_4/environment/pull_bucket.py +++ b/tasks/0079_455_79455690_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_455_79455690_qa_4/task.toml b/tasks/0079_455_79455690_qa_4/task.toml index 435f5dbacdc91e38fc0a3ad05a32cc67260ec589..7d3b5e5b943c7f8ffb0cc0f2229e9525a2b29e9e 100644 --- a/tasks/0079_455_79455690_qa_4/task.toml +++ b/tasks/0079_455_79455690_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_455_79455690_qa_5/environment/bootstrap.sh b/tasks/0079_455_79455690_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_455_79455690_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_455_79455690_qa_5/environment/pull_bucket.py b/tasks/0079_455_79455690_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_455_79455690_qa_5/environment/pull_bucket.py +++ b/tasks/0079_455_79455690_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_455_79455690_qa_5/task.toml b/tasks/0079_455_79455690_qa_5/task.toml index 7798986998f83cc05f96fac59d2d8afc83050046..730901f3f42e92d977bbafe8ecdcd7bbbe5dfd8d 100644 --- a/tasks/0079_455_79455690_qa_5/task.toml +++ b/tasks/0079_455_79455690_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_509_79509130_qa_3/environment/bootstrap.sh b/tasks/0079_509_79509130_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_509_79509130_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_509_79509130_qa_3/environment/pull_bucket.py b/tasks/0079_509_79509130_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_509_79509130_qa_3/environment/pull_bucket.py +++ b/tasks/0079_509_79509130_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_509_79509130_qa_3/task.toml b/tasks/0079_509_79509130_qa_3/task.toml index 198779c0b53a7ad0015bb501b526e53c0bab83b0..c6741a2b87d8e5d05b38a9e8963894c73f55686c 100644 --- a/tasks/0079_509_79509130_qa_3/task.toml +++ b/tasks/0079_509_79509130_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_571_79571546_qa_3/environment/bootstrap.sh b/tasks/0079_571_79571546_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_571_79571546_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_571_79571546_qa_3/environment/pull_bucket.py b/tasks/0079_571_79571546_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_571_79571546_qa_3/environment/pull_bucket.py +++ b/tasks/0079_571_79571546_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_571_79571546_qa_3/task.toml b/tasks/0079_571_79571546_qa_3/task.toml index 6b6296fa71c01ab1c22e0e17d432719cf13f6da1..7309f58d1480e5e282072f40752989668b3803b1 100644 --- a/tasks/0079_571_79571546_qa_3/task.toml +++ b/tasks/0079_571_79571546_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_574_79574675_qa_3/environment/bootstrap.sh b/tasks/0079_574_79574675_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_574_79574675_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_574_79574675_qa_3/environment/pull_bucket.py b/tasks/0079_574_79574675_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_574_79574675_qa_3/environment/pull_bucket.py +++ b/tasks/0079_574_79574675_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_574_79574675_qa_3/task.toml b/tasks/0079_574_79574675_qa_3/task.toml index 98fc54141fff2ac3897d418d84650d0c2ec49bef..6e0277bf65a68ea403765552446f38144026e71c 100644 --- a/tasks/0079_574_79574675_qa_3/task.toml +++ b/tasks/0079_574_79574675_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_574_79574675_qa_4/environment/bootstrap.sh b/tasks/0079_574_79574675_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_574_79574675_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_574_79574675_qa_4/environment/pull_bucket.py b/tasks/0079_574_79574675_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_574_79574675_qa_4/environment/pull_bucket.py +++ b/tasks/0079_574_79574675_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_574_79574675_qa_4/task.toml b/tasks/0079_574_79574675_qa_4/task.toml index 957f988e9d23a4c1ae3ee669c62484fa092833fc..e2f5317dcff88f3daf19bb46181ecc4d5ccfee19 100644 --- a/tasks/0079_574_79574675_qa_4/task.toml +++ b/tasks/0079_574_79574675_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_597_79597687_qa_2/environment/bootstrap.sh b/tasks/0079_597_79597687_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_597_79597687_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_597_79597687_qa_2/environment/pull_bucket.py b/tasks/0079_597_79597687_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_597_79597687_qa_2/environment/pull_bucket.py +++ b/tasks/0079_597_79597687_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_597_79597687_qa_2/task.toml b/tasks/0079_597_79597687_qa_2/task.toml index 4cadaf8aa8a1888a31d503819c77ce26eaf2f63e..fd1e4639cd8e948611cf17cc467086087b8d18e7 100644 --- a/tasks/0079_597_79597687_qa_2/task.toml +++ b/tasks/0079_597_79597687_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_597_79597687_qa_5/environment/bootstrap.sh b/tasks/0079_597_79597687_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_597_79597687_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_597_79597687_qa_5/environment/pull_bucket.py b/tasks/0079_597_79597687_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_597_79597687_qa_5/environment/pull_bucket.py +++ b/tasks/0079_597_79597687_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_597_79597687_qa_5/task.toml b/tasks/0079_597_79597687_qa_5/task.toml index d6cec1d2546806878a9501022c1591ea795b7de1..d6c4940cda4a2deac2301dba504322dede6384f0 100644 --- a/tasks/0079_597_79597687_qa_5/task.toml +++ b/tasks/0079_597_79597687_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_606_79606942_qa_1/environment/bootstrap.sh b/tasks/0079_606_79606942_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_606_79606942_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_606_79606942_qa_1/environment/pull_bucket.py b/tasks/0079_606_79606942_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_606_79606942_qa_1/environment/pull_bucket.py +++ b/tasks/0079_606_79606942_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_606_79606942_qa_1/task.toml b/tasks/0079_606_79606942_qa_1/task.toml index 1e393b1578d82fc87168524b1d332bb9efa80f4a..a1a59151f6c81c3b1515099ded3f7c6463b70adc 100644 --- a/tasks/0079_606_79606942_qa_1/task.toml +++ b/tasks/0079_606_79606942_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_606_79606942_qa_5/environment/bootstrap.sh b/tasks/0079_606_79606942_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_606_79606942_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_606_79606942_qa_5/environment/pull_bucket.py b/tasks/0079_606_79606942_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_606_79606942_qa_5/environment/pull_bucket.py +++ b/tasks/0079_606_79606942_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_606_79606942_qa_5/task.toml b/tasks/0079_606_79606942_qa_5/task.toml index 77518e6a55fbc0a253503d8c81d5a77028f83429..a14fae885933fc7147b745bdb5c281f226b97379 100644 --- a/tasks/0079_606_79606942_qa_5/task.toml +++ b/tasks/0079_606_79606942_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_677_79677746_qa_2/environment/bootstrap.sh b/tasks/0079_677_79677746_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_677_79677746_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_677_79677746_qa_2/environment/pull_bucket.py b/tasks/0079_677_79677746_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_677_79677746_qa_2/environment/pull_bucket.py +++ b/tasks/0079_677_79677746_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_677_79677746_qa_2/task.toml b/tasks/0079_677_79677746_qa_2/task.toml index e2ffcbde568c10ca450d1f0cc6e58bb18631648a..7c2dbeb0fbc79f54b9e8281b76b86efc665a36f4 100644 --- a/tasks/0079_677_79677746_qa_2/task.toml +++ b/tasks/0079_677_79677746_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_677_79677746_qa_3/environment/bootstrap.sh b/tasks/0079_677_79677746_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_677_79677746_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_677_79677746_qa_3/environment/pull_bucket.py b/tasks/0079_677_79677746_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_677_79677746_qa_3/environment/pull_bucket.py +++ b/tasks/0079_677_79677746_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_677_79677746_qa_3/task.toml b/tasks/0079_677_79677746_qa_3/task.toml index 608bbbfa3da5e249fbe2d2d87b6c65944fac0524..15e6e3275e3b3c4675e375d368ded9ccec0b7811 100644 --- a/tasks/0079_677_79677746_qa_3/task.toml +++ b/tasks/0079_677_79677746_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_677_79677746_qa_4/environment/bootstrap.sh b/tasks/0079_677_79677746_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_677_79677746_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_677_79677746_qa_4/environment/pull_bucket.py b/tasks/0079_677_79677746_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_677_79677746_qa_4/environment/pull_bucket.py +++ b/tasks/0079_677_79677746_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_677_79677746_qa_4/task.toml b/tasks/0079_677_79677746_qa_4/task.toml index 81e2cd9d6aca612f76b3d7f06073dc354416b76e..fba4a3470deb0682c00a6d55782d5bb45bf3ebdd 100644 --- a/tasks/0079_677_79677746_qa_4/task.toml +++ b/tasks/0079_677_79677746_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_677_79677746_qa_5/environment/bootstrap.sh b/tasks/0079_677_79677746_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_677_79677746_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_677_79677746_qa_5/environment/pull_bucket.py b/tasks/0079_677_79677746_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_677_79677746_qa_5/environment/pull_bucket.py +++ b/tasks/0079_677_79677746_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_677_79677746_qa_5/task.toml b/tasks/0079_677_79677746_qa_5/task.toml index 1e28d70134ad0022d1cf3d0c1e70c9dd69f1caa0..d12789cc237d996bbcd2b579fade7e4d81fea2e0 100644 --- a/tasks/0079_677_79677746_qa_5/task.toml +++ b/tasks/0079_677_79677746_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_706_79706209_qa_1/environment/bootstrap.sh b/tasks/0079_706_79706209_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_706_79706209_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_706_79706209_qa_1/environment/pull_bucket.py b/tasks/0079_706_79706209_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_706_79706209_qa_1/environment/pull_bucket.py +++ b/tasks/0079_706_79706209_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_706_79706209_qa_1/task.toml b/tasks/0079_706_79706209_qa_1/task.toml index 169625fa810f583fa2f6e72c71c33fa62905926e..d40ef673b1733c05678500ffe19e1e9fecf4147c 100644 --- a/tasks/0079_706_79706209_qa_1/task.toml +++ b/tasks/0079_706_79706209_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_726_79726462_qa_1/environment/bootstrap.sh b/tasks/0079_726_79726462_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_726_79726462_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_726_79726462_qa_1/environment/pull_bucket.py b/tasks/0079_726_79726462_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_726_79726462_qa_1/environment/pull_bucket.py +++ b/tasks/0079_726_79726462_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_726_79726462_qa_1/task.toml b/tasks/0079_726_79726462_qa_1/task.toml index f0fbde5e62c2b929020aafd50c9d7cdb6d013f91..ff469d2585f749ad1f262d99bd1eccf297f94784 100644 --- a/tasks/0079_726_79726462_qa_1/task.toml +++ b/tasks/0079_726_79726462_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_852_79852470_qa_3/environment/bootstrap.sh b/tasks/0079_852_79852470_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_852_79852470_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_852_79852470_qa_3/environment/pull_bucket.py b/tasks/0079_852_79852470_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_852_79852470_qa_3/environment/pull_bucket.py +++ b/tasks/0079_852_79852470_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_852_79852470_qa_3/task.toml b/tasks/0079_852_79852470_qa_3/task.toml index f4478702aa15867062a92d2114372aa8bc3394d2..e8eb2fb126bd5b5091d82ce898ca43005a8418c9 100644 --- a/tasks/0079_852_79852470_qa_3/task.toml +++ b/tasks/0079_852_79852470_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_852_79852470_qa_4/environment/bootstrap.sh b/tasks/0079_852_79852470_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_852_79852470_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_852_79852470_qa_4/environment/pull_bucket.py b/tasks/0079_852_79852470_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_852_79852470_qa_4/environment/pull_bucket.py +++ b/tasks/0079_852_79852470_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_852_79852470_qa_4/task.toml b/tasks/0079_852_79852470_qa_4/task.toml index 0f8d697222de07f2a886337ed076b8bee2820084..fbbf465f969fc0997fbd8051a498ed8394318d94 100644 --- a/tasks/0079_852_79852470_qa_4/task.toml +++ b/tasks/0079_852_79852470_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_947_79947828_qa_3/environment/bootstrap.sh b/tasks/0079_947_79947828_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_947_79947828_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_947_79947828_qa_3/environment/pull_bucket.py b/tasks/0079_947_79947828_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_947_79947828_qa_3/environment/pull_bucket.py +++ b/tasks/0079_947_79947828_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_947_79947828_qa_3/task.toml b/tasks/0079_947_79947828_qa_3/task.toml index 8e0be34625ad5f509541b2ca91d2f2183c0b4e8a..b550d75787baff68336b79e0a9df73b1a7a52c52 100644 --- a/tasks/0079_947_79947828_qa_3/task.toml +++ b/tasks/0079_947_79947828_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0079_974_79974124_qa_2/environment/bootstrap.sh b/tasks/0079_974_79974124_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0079_974_79974124_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0079_974_79974124_qa_2/environment/pull_bucket.py b/tasks/0079_974_79974124_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0079_974_79974124_qa_2/environment/pull_bucket.py +++ b/tasks/0079_974_79974124_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0079_974_79974124_qa_2/task.toml b/tasks/0079_974_79974124_qa_2/task.toml index 98e2d3e738884aa92344619dafdf1a11b69e9ab4..c2249ff436181f2396e510f8519389d2862d34ac 100644 --- a/tasks/0079_974_79974124_qa_2/task.toml +++ b/tasks/0079_974_79974124_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_011_80011409_qa_1/environment/bootstrap.sh b/tasks/0080_011_80011409_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_011_80011409_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_011_80011409_qa_1/environment/pull_bucket.py b/tasks/0080_011_80011409_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_011_80011409_qa_1/environment/pull_bucket.py +++ b/tasks/0080_011_80011409_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_011_80011409_qa_1/task.toml b/tasks/0080_011_80011409_qa_1/task.toml index 8e09be8450e84e7f5840a933a47cf05b1eb7c9a6..a6d03e78fec446d4ecef366351faa039efb8056f 100644 --- a/tasks/0080_011_80011409_qa_1/task.toml +++ b/tasks/0080_011_80011409_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_011_80011409_qa_2/environment/bootstrap.sh b/tasks/0080_011_80011409_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_011_80011409_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_011_80011409_qa_2/environment/pull_bucket.py b/tasks/0080_011_80011409_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_011_80011409_qa_2/environment/pull_bucket.py +++ b/tasks/0080_011_80011409_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_011_80011409_qa_2/task.toml b/tasks/0080_011_80011409_qa_2/task.toml index 7bd1dc004f4cdfd03b39d685180261d361941927..3857d14e5a9790466ba8e4eaa69a73feb5a8bc13 100644 --- a/tasks/0080_011_80011409_qa_2/task.toml +++ b/tasks/0080_011_80011409_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_011_80011409_qa_3/environment/bootstrap.sh b/tasks/0080_011_80011409_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_011_80011409_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_011_80011409_qa_3/environment/pull_bucket.py b/tasks/0080_011_80011409_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_011_80011409_qa_3/environment/pull_bucket.py +++ b/tasks/0080_011_80011409_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_011_80011409_qa_3/task.toml b/tasks/0080_011_80011409_qa_3/task.toml index 7ad86847393e3de43c607cad55ac7f1638b8da1a..880f3e4474fd1ccbaee233e2cb64254ce3b88839 100644 --- a/tasks/0080_011_80011409_qa_3/task.toml +++ b/tasks/0080_011_80011409_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_011_80011409_qa_4/environment/bootstrap.sh b/tasks/0080_011_80011409_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_011_80011409_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_011_80011409_qa_4/environment/pull_bucket.py b/tasks/0080_011_80011409_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_011_80011409_qa_4/environment/pull_bucket.py +++ b/tasks/0080_011_80011409_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_011_80011409_qa_4/task.toml b/tasks/0080_011_80011409_qa_4/task.toml index 4b9ee8b46aa57ccea53e4331a7079d065c53f6eb..cbf94c982e06b80e8192079df9eb3292c3ef50b9 100644 --- a/tasks/0080_011_80011409_qa_4/task.toml +++ b/tasks/0080_011_80011409_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_011_80011409_qa_5/environment/bootstrap.sh b/tasks/0080_011_80011409_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_011_80011409_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_011_80011409_qa_5/environment/pull_bucket.py b/tasks/0080_011_80011409_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_011_80011409_qa_5/environment/pull_bucket.py +++ b/tasks/0080_011_80011409_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_011_80011409_qa_5/task.toml b/tasks/0080_011_80011409_qa_5/task.toml index dbb4110a80bb5fad3fda4b961d32814a6d841e0a..a980df4ca4f82614cb805c38e10e997052ada74b 100644 --- a/tasks/0080_011_80011409_qa_5/task.toml +++ b/tasks/0080_011_80011409_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_200_80200515_qa_1/environment/bootstrap.sh b/tasks/0080_200_80200515_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_200_80200515_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_200_80200515_qa_1/environment/pull_bucket.py b/tasks/0080_200_80200515_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_200_80200515_qa_1/environment/pull_bucket.py +++ b/tasks/0080_200_80200515_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_200_80200515_qa_1/task.toml b/tasks/0080_200_80200515_qa_1/task.toml index 30f66b0b1a31be1095516adc13c9815493705c3b..d09a04c41292e5dee503af11db4b7defcf1a08fc 100644 --- a/tasks/0080_200_80200515_qa_1/task.toml +++ b/tasks/0080_200_80200515_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_200_80200515_qa_3/environment/bootstrap.sh b/tasks/0080_200_80200515_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_200_80200515_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_200_80200515_qa_3/environment/pull_bucket.py b/tasks/0080_200_80200515_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_200_80200515_qa_3/environment/pull_bucket.py +++ b/tasks/0080_200_80200515_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_200_80200515_qa_3/task.toml b/tasks/0080_200_80200515_qa_3/task.toml index fa987401c5007e60045eb8a849a3f133f756a0b1..b999143a97d265b3dd1ea30d97096a2ae6fbc468 100644 --- a/tasks/0080_200_80200515_qa_3/task.toml +++ b/tasks/0080_200_80200515_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_229_80229186_qa_3/environment/bootstrap.sh b/tasks/0080_229_80229186_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_229_80229186_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_229_80229186_qa_3/environment/pull_bucket.py b/tasks/0080_229_80229186_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_229_80229186_qa_3/environment/pull_bucket.py +++ b/tasks/0080_229_80229186_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_229_80229186_qa_3/task.toml b/tasks/0080_229_80229186_qa_3/task.toml index 102fa2da0ed64bf2749b0ff4e5edf278815dd4bf..aad2d24220cd155081393a73dd65e36869d4cf2d 100644 --- a/tasks/0080_229_80229186_qa_3/task.toml +++ b/tasks/0080_229_80229186_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_304_80304821_qa_1/environment/bootstrap.sh b/tasks/0080_304_80304821_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_304_80304821_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_304_80304821_qa_1/environment/pull_bucket.py b/tasks/0080_304_80304821_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_304_80304821_qa_1/environment/pull_bucket.py +++ b/tasks/0080_304_80304821_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_304_80304821_qa_1/task.toml b/tasks/0080_304_80304821_qa_1/task.toml index 11167feb84f63f567e7cefe0b4c7c6caaf86d9a3..8bfc458fe6bd3087d378f890abb6b41a2eb5afb1 100644 --- a/tasks/0080_304_80304821_qa_1/task.toml +++ b/tasks/0080_304_80304821_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_564_80564946_qa_4/environment/bootstrap.sh b/tasks/0080_564_80564946_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_564_80564946_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_564_80564946_qa_4/environment/pull_bucket.py b/tasks/0080_564_80564946_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_564_80564946_qa_4/environment/pull_bucket.py +++ b/tasks/0080_564_80564946_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_564_80564946_qa_4/task.toml b/tasks/0080_564_80564946_qa_4/task.toml index 66a4f0959def0b531ff12e1a34902bca340a3708..9f860f7dc4466ad18c8c6160f565891a9dd37fa7 100644 --- a/tasks/0080_564_80564946_qa_4/task.toml +++ b/tasks/0080_564_80564946_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_564_80564946_qa_5/environment/bootstrap.sh b/tasks/0080_564_80564946_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_564_80564946_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_564_80564946_qa_5/environment/pull_bucket.py b/tasks/0080_564_80564946_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_564_80564946_qa_5/environment/pull_bucket.py +++ b/tasks/0080_564_80564946_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_564_80564946_qa_5/task.toml b/tasks/0080_564_80564946_qa_5/task.toml index 80b4bf5f36b09cde300d165c919f97b085a4d1e5..fa829016608c3d5392d33f56ad38f586314f5cbd 100644 --- a/tasks/0080_564_80564946_qa_5/task.toml +++ b/tasks/0080_564_80564946_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_653_80653569_qa_2/environment/bootstrap.sh b/tasks/0080_653_80653569_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_653_80653569_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_653_80653569_qa_2/environment/pull_bucket.py b/tasks/0080_653_80653569_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_653_80653569_qa_2/environment/pull_bucket.py +++ b/tasks/0080_653_80653569_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_653_80653569_qa_2/task.toml b/tasks/0080_653_80653569_qa_2/task.toml index 147df9de12f2c200a68baf2178c9f0d98a3026dc..25226faa533555d41b351c09b70aab3659e57c3e 100644 --- a/tasks/0080_653_80653569_qa_2/task.toml +++ b/tasks/0080_653_80653569_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_686_80686195_qa_3/environment/bootstrap.sh b/tasks/0080_686_80686195_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_686_80686195_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_686_80686195_qa_3/environment/pull_bucket.py b/tasks/0080_686_80686195_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_686_80686195_qa_3/environment/pull_bucket.py +++ b/tasks/0080_686_80686195_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_686_80686195_qa_3/task.toml b/tasks/0080_686_80686195_qa_3/task.toml index 55196d822a196816eb21b1df0d0c38855f7f1fb6..01f20298044d43aebaac7fddf49e6bd538335609 100644 --- a/tasks/0080_686_80686195_qa_3/task.toml +++ b/tasks/0080_686_80686195_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_705_80705394_qa_1/environment/bootstrap.sh b/tasks/0080_705_80705394_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_705_80705394_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_705_80705394_qa_1/environment/pull_bucket.py b/tasks/0080_705_80705394_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_705_80705394_qa_1/environment/pull_bucket.py +++ b/tasks/0080_705_80705394_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_705_80705394_qa_1/task.toml b/tasks/0080_705_80705394_qa_1/task.toml index 18bc0c7769f7f7a58980732fa52e5e70707805f4..b8a78c85090fa93253198890e96252b345e5cb2d 100644 --- a/tasks/0080_705_80705394_qa_1/task.toml +++ b/tasks/0080_705_80705394_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_705_80705394_qa_5/environment/bootstrap.sh b/tasks/0080_705_80705394_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_705_80705394_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_705_80705394_qa_5/environment/pull_bucket.py b/tasks/0080_705_80705394_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_705_80705394_qa_5/environment/pull_bucket.py +++ b/tasks/0080_705_80705394_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_705_80705394_qa_5/task.toml b/tasks/0080_705_80705394_qa_5/task.toml index 77445a6278a39815c2b543be12073e9854f1a787..f7ba6a943541b9df353c93eb0ba8b23b5339956f 100644 --- a/tasks/0080_705_80705394_qa_5/task.toml +++ b/tasks/0080_705_80705394_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_832_80832047_qa_1/environment/bootstrap.sh b/tasks/0080_832_80832047_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_832_80832047_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_832_80832047_qa_1/environment/pull_bucket.py b/tasks/0080_832_80832047_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_832_80832047_qa_1/environment/pull_bucket.py +++ b/tasks/0080_832_80832047_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_832_80832047_qa_1/task.toml b/tasks/0080_832_80832047_qa_1/task.toml index ac16eb642e093cda858084ea08eb7d9e00cb06ed..ecd11ee44cde8bcbc537046f3df0f3e4c49666a7 100644 --- a/tasks/0080_832_80832047_qa_1/task.toml +++ b/tasks/0080_832_80832047_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_832_80832047_qa_5/environment/bootstrap.sh b/tasks/0080_832_80832047_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_832_80832047_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_832_80832047_qa_5/environment/pull_bucket.py b/tasks/0080_832_80832047_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_832_80832047_qa_5/environment/pull_bucket.py +++ b/tasks/0080_832_80832047_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_832_80832047_qa_5/task.toml b/tasks/0080_832_80832047_qa_5/task.toml index 73543f94fa1b31d6ee33e423f4a5db09e6fc9a18..68c4ad275bef23388b2543326516fc928b24e062 100644 --- a/tasks/0080_832_80832047_qa_5/task.toml +++ b/tasks/0080_832_80832047_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_863_80863637_qa_4/environment/bootstrap.sh b/tasks/0080_863_80863637_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_863_80863637_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_863_80863637_qa_4/environment/pull_bucket.py b/tasks/0080_863_80863637_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_863_80863637_qa_4/environment/pull_bucket.py +++ b/tasks/0080_863_80863637_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_863_80863637_qa_4/task.toml b/tasks/0080_863_80863637_qa_4/task.toml index ad838e875a3e8dadd9dd546266c341d3ec43c565..e5531a04206750ae13aa9d84962898d6087ec3e2 100644 --- a/tasks/0080_863_80863637_qa_4/task.toml +++ b/tasks/0080_863_80863637_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_863_80863637_qa_5/environment/bootstrap.sh b/tasks/0080_863_80863637_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_863_80863637_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_863_80863637_qa_5/environment/pull_bucket.py b/tasks/0080_863_80863637_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_863_80863637_qa_5/environment/pull_bucket.py +++ b/tasks/0080_863_80863637_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_863_80863637_qa_5/task.toml b/tasks/0080_863_80863637_qa_5/task.toml index 0c31f4962b19b384718f6023ba04832cbf4cd5d0..7c0a4684d2238f95508f7db69b7c4b1d5f65f633 100644 --- a/tasks/0080_863_80863637_qa_5/task.toml +++ b/tasks/0080_863_80863637_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_918_80918497_qa_3/environment/bootstrap.sh b/tasks/0080_918_80918497_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_918_80918497_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_918_80918497_qa_3/environment/pull_bucket.py b/tasks/0080_918_80918497_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_918_80918497_qa_3/environment/pull_bucket.py +++ b/tasks/0080_918_80918497_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_918_80918497_qa_3/task.toml b/tasks/0080_918_80918497_qa_3/task.toml index 137eda79c688753ee553ee0cfea292e451cf5e8a..48017400704caf55749297ebf2712ce25659aea2 100644 --- a/tasks/0080_918_80918497_qa_3/task.toml +++ b/tasks/0080_918_80918497_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0080_970_80970482_qa_1/environment/bootstrap.sh b/tasks/0080_970_80970482_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0080_970_80970482_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0080_970_80970482_qa_1/environment/pull_bucket.py b/tasks/0080_970_80970482_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0080_970_80970482_qa_1/environment/pull_bucket.py +++ b/tasks/0080_970_80970482_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0080_970_80970482_qa_1/task.toml b/tasks/0080_970_80970482_qa_1/task.toml index 0e9fa23ce88b8aa55d2fa5335cf4dd5a7a5fab85..0fd7d3576706e12d711fb556b6a4f3512edb43c4 100644 --- a/tasks/0080_970_80970482_qa_1/task.toml +++ b/tasks/0080_970_80970482_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_020_81020564_qa_2/environment/bootstrap.sh b/tasks/0081_020_81020564_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_020_81020564_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_020_81020564_qa_2/environment/pull_bucket.py b/tasks/0081_020_81020564_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_020_81020564_qa_2/environment/pull_bucket.py +++ b/tasks/0081_020_81020564_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_020_81020564_qa_2/task.toml b/tasks/0081_020_81020564_qa_2/task.toml index 81319eee54beaaad8ea015f97edbb37ef6103b39..eccbbc8f9b608875433087858d87646e91155139 100644 --- a/tasks/0081_020_81020564_qa_2/task.toml +++ b/tasks/0081_020_81020564_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_173_81173353_qa_1/environment/bootstrap.sh b/tasks/0081_173_81173353_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_173_81173353_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_173_81173353_qa_1/environment/pull_bucket.py b/tasks/0081_173_81173353_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_173_81173353_qa_1/environment/pull_bucket.py +++ b/tasks/0081_173_81173353_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_173_81173353_qa_1/task.toml b/tasks/0081_173_81173353_qa_1/task.toml index b270720440c9305cb95cde52cdd8df609459d77b..af3d9243062ab47408f5f7e0baa44daccee22881 100644 --- a/tasks/0081_173_81173353_qa_1/task.toml +++ b/tasks/0081_173_81173353_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_173_81173353_qa_2/environment/bootstrap.sh b/tasks/0081_173_81173353_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_173_81173353_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_173_81173353_qa_2/environment/pull_bucket.py b/tasks/0081_173_81173353_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_173_81173353_qa_2/environment/pull_bucket.py +++ b/tasks/0081_173_81173353_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_173_81173353_qa_2/task.toml b/tasks/0081_173_81173353_qa_2/task.toml index 650def40b47323faa9eaca22c4b0f370dcd4f63d..ec2a8beb9a66fedc6d0dfbe71e4b87803c02b085 100644 --- a/tasks/0081_173_81173353_qa_2/task.toml +++ b/tasks/0081_173_81173353_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_173_81173353_qa_3/environment/bootstrap.sh b/tasks/0081_173_81173353_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_173_81173353_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_173_81173353_qa_3/environment/pull_bucket.py b/tasks/0081_173_81173353_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_173_81173353_qa_3/environment/pull_bucket.py +++ b/tasks/0081_173_81173353_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_173_81173353_qa_3/task.toml b/tasks/0081_173_81173353_qa_3/task.toml index d28e4b98a79b2c01eb88588bc14e3f5614502fac..0fc0cd83dd6f02f3f19a2102ceb22ead8040bf57 100644 --- a/tasks/0081_173_81173353_qa_3/task.toml +++ b/tasks/0081_173_81173353_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_332_81332828_qa_4/environment/bootstrap.sh b/tasks/0081_332_81332828_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_332_81332828_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_332_81332828_qa_4/environment/pull_bucket.py b/tasks/0081_332_81332828_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_332_81332828_qa_4/environment/pull_bucket.py +++ b/tasks/0081_332_81332828_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_332_81332828_qa_4/task.toml b/tasks/0081_332_81332828_qa_4/task.toml index 5c35c68e4b50c1fab29e8b8ad5306f20b1b46d2f..751658146ab9257f44f990f1c96200fea4131020 100644 --- a/tasks/0081_332_81332828_qa_4/task.toml +++ b/tasks/0081_332_81332828_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_332_81332828_qa_5/environment/bootstrap.sh b/tasks/0081_332_81332828_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_332_81332828_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_332_81332828_qa_5/environment/pull_bucket.py b/tasks/0081_332_81332828_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_332_81332828_qa_5/environment/pull_bucket.py +++ b/tasks/0081_332_81332828_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_332_81332828_qa_5/task.toml b/tasks/0081_332_81332828_qa_5/task.toml index 392d93c6bb4574d1823989df02fd757c14220122..36195f2540494f69bd23638c144eb41e1ccfc2e1 100644 --- a/tasks/0081_332_81332828_qa_5/task.toml +++ b/tasks/0081_332_81332828_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_459_81459159_qa_1/environment/bootstrap.sh b/tasks/0081_459_81459159_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_459_81459159_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_459_81459159_qa_1/environment/pull_bucket.py b/tasks/0081_459_81459159_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_459_81459159_qa_1/environment/pull_bucket.py +++ b/tasks/0081_459_81459159_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_459_81459159_qa_1/task.toml b/tasks/0081_459_81459159_qa_1/task.toml index 96844a8908815f2c2c8932d053a7c7d0d1491d42..7de1fea283027e8277aee6c0e270852c0c1c5aec 100644 --- a/tasks/0081_459_81459159_qa_1/task.toml +++ b/tasks/0081_459_81459159_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_459_81459159_qa_2/environment/bootstrap.sh b/tasks/0081_459_81459159_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_459_81459159_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_459_81459159_qa_2/environment/pull_bucket.py b/tasks/0081_459_81459159_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_459_81459159_qa_2/environment/pull_bucket.py +++ b/tasks/0081_459_81459159_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_459_81459159_qa_2/task.toml b/tasks/0081_459_81459159_qa_2/task.toml index a2b28215f82166ce2b141f42a7253625f5980dd9..9171a79d72bb8c4f114fac7f000d5b061d4c7344 100644 --- a/tasks/0081_459_81459159_qa_2/task.toml +++ b/tasks/0081_459_81459159_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_459_81459159_qa_3/environment/bootstrap.sh b/tasks/0081_459_81459159_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_459_81459159_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_459_81459159_qa_3/environment/pull_bucket.py b/tasks/0081_459_81459159_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_459_81459159_qa_3/environment/pull_bucket.py +++ b/tasks/0081_459_81459159_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_459_81459159_qa_3/task.toml b/tasks/0081_459_81459159_qa_3/task.toml index 5562bf2bc4ebcd68558147e2ccfb935edc84884e..b35b0b2bcb4ce378cdf91958a4326801941f2fb4 100644 --- a/tasks/0081_459_81459159_qa_3/task.toml +++ b/tasks/0081_459_81459159_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_468_81468620_qa_2/environment/bootstrap.sh b/tasks/0081_468_81468620_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_468_81468620_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_468_81468620_qa_2/environment/pull_bucket.py b/tasks/0081_468_81468620_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_468_81468620_qa_2/environment/pull_bucket.py +++ b/tasks/0081_468_81468620_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_468_81468620_qa_2/task.toml b/tasks/0081_468_81468620_qa_2/task.toml index 4a5da1e2e39631179f269076e49be4826986e20e..e12d7494fc468f6ef9934c7dde013d6d31ca8391 100644 --- a/tasks/0081_468_81468620_qa_2/task.toml +++ b/tasks/0081_468_81468620_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_468_81468620_qa_4/environment/bootstrap.sh b/tasks/0081_468_81468620_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_468_81468620_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_468_81468620_qa_4/environment/pull_bucket.py b/tasks/0081_468_81468620_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_468_81468620_qa_4/environment/pull_bucket.py +++ b/tasks/0081_468_81468620_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_468_81468620_qa_4/task.toml b/tasks/0081_468_81468620_qa_4/task.toml index 55b114702138e02ca6c7c8efffef1c7714dcaea7..4b39a83e344a82a139590cdf535d1ad9089d9253 100644 --- a/tasks/0081_468_81468620_qa_4/task.toml +++ b/tasks/0081_468_81468620_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_472_81472707_qa_1/environment/bootstrap.sh b/tasks/0081_472_81472707_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_472_81472707_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_472_81472707_qa_1/environment/pull_bucket.py b/tasks/0081_472_81472707_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_472_81472707_qa_1/environment/pull_bucket.py +++ b/tasks/0081_472_81472707_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_472_81472707_qa_1/task.toml b/tasks/0081_472_81472707_qa_1/task.toml index af22c78212c0afb73838c852a782ff434949242d..0b8060c84d938e4d40a1a85bc87cfa3d67a5be17 100644 --- a/tasks/0081_472_81472707_qa_1/task.toml +++ b/tasks/0081_472_81472707_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_472_81472707_qa_3/environment/bootstrap.sh b/tasks/0081_472_81472707_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_472_81472707_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_472_81472707_qa_3/environment/pull_bucket.py b/tasks/0081_472_81472707_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_472_81472707_qa_3/environment/pull_bucket.py +++ b/tasks/0081_472_81472707_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_472_81472707_qa_3/task.toml b/tasks/0081_472_81472707_qa_3/task.toml index f84ecf1b56212aa054b1733debb3308cc639f8e8..5f299498a6cafdefa2ec2eebec8a22e01433ae16 100644 --- a/tasks/0081_472_81472707_qa_3/task.toml +++ b/tasks/0081_472_81472707_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_477_81477923_qa_2/environment/bootstrap.sh b/tasks/0081_477_81477923_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_477_81477923_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_477_81477923_qa_2/environment/pull_bucket.py b/tasks/0081_477_81477923_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_477_81477923_qa_2/environment/pull_bucket.py +++ b/tasks/0081_477_81477923_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_477_81477923_qa_2/task.toml b/tasks/0081_477_81477923_qa_2/task.toml index 48f5bf902c4c23037c5bebb5cd46cfa73fa502c1..fab364f194d19aaaa722c08090cd833e21f4895a 100644 --- a/tasks/0081_477_81477923_qa_2/task.toml +++ b/tasks/0081_477_81477923_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_485_81485574_qa_1/environment/bootstrap.sh b/tasks/0081_485_81485574_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_485_81485574_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_485_81485574_qa_1/environment/pull_bucket.py b/tasks/0081_485_81485574_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_485_81485574_qa_1/environment/pull_bucket.py +++ b/tasks/0081_485_81485574_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_485_81485574_qa_1/task.toml b/tasks/0081_485_81485574_qa_1/task.toml index 087529e170ba58891383c38d57fa80addfe7ff6d..619f51f52759c618fd5300c5cfa964d285828a59 100644 --- a/tasks/0081_485_81485574_qa_1/task.toml +++ b/tasks/0081_485_81485574_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_600_81600626_qa_2/environment/bootstrap.sh b/tasks/0081_600_81600626_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_600_81600626_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_600_81600626_qa_2/environment/pull_bucket.py b/tasks/0081_600_81600626_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_600_81600626_qa_2/environment/pull_bucket.py +++ b/tasks/0081_600_81600626_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_600_81600626_qa_2/task.toml b/tasks/0081_600_81600626_qa_2/task.toml index 08ed416f6cd29dbf8518e214133c7f8599964ce5..1f293b91f4e5bd783b2c6c226070fb90159f38d0 100644 --- a/tasks/0081_600_81600626_qa_2/task.toml +++ b/tasks/0081_600_81600626_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_615_81615013_qa_3/environment/bootstrap.sh b/tasks/0081_615_81615013_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_615_81615013_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_615_81615013_qa_3/environment/pull_bucket.py b/tasks/0081_615_81615013_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_615_81615013_qa_3/environment/pull_bucket.py +++ b/tasks/0081_615_81615013_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_615_81615013_qa_3/task.toml b/tasks/0081_615_81615013_qa_3/task.toml index 1f76bca10cca9db10b6139b4e8d03d83709c681b..265fcf301db3f80ca58914a677be24630f626aba 100644 --- a/tasks/0081_615_81615013_qa_3/task.toml +++ b/tasks/0081_615_81615013_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_615_81615013_qa_4/environment/bootstrap.sh b/tasks/0081_615_81615013_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_615_81615013_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_615_81615013_qa_4/environment/pull_bucket.py b/tasks/0081_615_81615013_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_615_81615013_qa_4/environment/pull_bucket.py +++ b/tasks/0081_615_81615013_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_615_81615013_qa_4/task.toml b/tasks/0081_615_81615013_qa_4/task.toml index 02342a81fe276c688728626c7576d05f4b5e9957..f29ca5a1e2b8fc66d424a0a88709f7b2dade95f7 100644 --- a/tasks/0081_615_81615013_qa_4/task.toml +++ b/tasks/0081_615_81615013_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_701_81701476_qa_3/environment/bootstrap.sh b/tasks/0081_701_81701476_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_701_81701476_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_701_81701476_qa_3/environment/pull_bucket.py b/tasks/0081_701_81701476_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_701_81701476_qa_3/environment/pull_bucket.py +++ b/tasks/0081_701_81701476_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_701_81701476_qa_3/task.toml b/tasks/0081_701_81701476_qa_3/task.toml index 532f0b9bbb766ce8f3d7ff5d31cb028cb68780e7..e99e21f23bed3691deaaf5cb783b6441e18600f0 100644 --- a/tasks/0081_701_81701476_qa_3/task.toml +++ b/tasks/0081_701_81701476_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_701_81701476_qa_5/environment/bootstrap.sh b/tasks/0081_701_81701476_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_701_81701476_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_701_81701476_qa_5/environment/pull_bucket.py b/tasks/0081_701_81701476_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_701_81701476_qa_5/environment/pull_bucket.py +++ b/tasks/0081_701_81701476_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_701_81701476_qa_5/task.toml b/tasks/0081_701_81701476_qa_5/task.toml index c5522be40251c1e86a56d6e8f5d3d547ae0d1948..4d9f6f52a92f1fde2e57c65d9f2ed32c45debd0b 100644 --- a/tasks/0081_701_81701476_qa_5/task.toml +++ b/tasks/0081_701_81701476_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_799_81799453_qa_4/environment/bootstrap.sh b/tasks/0081_799_81799453_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_799_81799453_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_799_81799453_qa_4/environment/pull_bucket.py b/tasks/0081_799_81799453_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_799_81799453_qa_4/environment/pull_bucket.py +++ b/tasks/0081_799_81799453_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_799_81799453_qa_4/task.toml b/tasks/0081_799_81799453_qa_4/task.toml index b7d94db24afadd9660ecb8fa7f9498d227e07ae9..75fe888442cbac0a40a5d3e5b52c0a45571763ec 100644 --- a/tasks/0081_799_81799453_qa_4/task.toml +++ b/tasks/0081_799_81799453_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_833_81833134_qa_4/environment/bootstrap.sh b/tasks/0081_833_81833134_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_833_81833134_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_833_81833134_qa_4/environment/pull_bucket.py b/tasks/0081_833_81833134_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_833_81833134_qa_4/environment/pull_bucket.py +++ b/tasks/0081_833_81833134_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_833_81833134_qa_4/task.toml b/tasks/0081_833_81833134_qa_4/task.toml index cb39db299dff47ada175d9056e19574d3dd70efa..c3b9d4a651f9a91ef2f6b37d3f9819277382b33b 100644 --- a/tasks/0081_833_81833134_qa_4/task.toml +++ b/tasks/0081_833_81833134_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_836_81836619_qa_3/environment/bootstrap.sh b/tasks/0081_836_81836619_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_836_81836619_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_836_81836619_qa_3/environment/pull_bucket.py b/tasks/0081_836_81836619_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_836_81836619_qa_3/environment/pull_bucket.py +++ b/tasks/0081_836_81836619_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_836_81836619_qa_3/task.toml b/tasks/0081_836_81836619_qa_3/task.toml index 8cacc41224babdd114cc2800a28c6703313a5089..af77a5371c0bdcbe5b37821bf5c5b406144f9392 100644 --- a/tasks/0081_836_81836619_qa_3/task.toml +++ b/tasks/0081_836_81836619_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_873_81873111_qa_2/environment/bootstrap.sh b/tasks/0081_873_81873111_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_873_81873111_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_873_81873111_qa_2/environment/pull_bucket.py b/tasks/0081_873_81873111_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_873_81873111_qa_2/environment/pull_bucket.py +++ b/tasks/0081_873_81873111_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_873_81873111_qa_2/task.toml b/tasks/0081_873_81873111_qa_2/task.toml index 88f6ad8c75abb6c724e3eaedd307ed5f27297dfe..06edc34ea0795e216afac42b51242eaba4027d06 100644 --- a/tasks/0081_873_81873111_qa_2/task.toml +++ b/tasks/0081_873_81873111_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_879_81879993_qa_2/environment/bootstrap.sh b/tasks/0081_879_81879993_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_879_81879993_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_879_81879993_qa_2/environment/pull_bucket.py b/tasks/0081_879_81879993_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_879_81879993_qa_2/environment/pull_bucket.py +++ b/tasks/0081_879_81879993_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_879_81879993_qa_2/task.toml b/tasks/0081_879_81879993_qa_2/task.toml index b4cd41f4a27c17a29a77d91405df663ebb97f24f..40a166f753f57d06e0844290b56ecc321035ba9d 100644 --- a/tasks/0081_879_81879993_qa_2/task.toml +++ b/tasks/0081_879_81879993_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0081_967_81967576_qa_2/environment/bootstrap.sh b/tasks/0081_967_81967576_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0081_967_81967576_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0081_967_81967576_qa_2/environment/pull_bucket.py b/tasks/0081_967_81967576_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0081_967_81967576_qa_2/environment/pull_bucket.py +++ b/tasks/0081_967_81967576_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0081_967_81967576_qa_2/task.toml b/tasks/0081_967_81967576_qa_2/task.toml index abe56dc82acef28bcb70b17398398a193e9453ad..b833dad4eda5c11f080a254f298a3c1d7d7a34ca 100644 --- a/tasks/0081_967_81967576_qa_2/task.toml +++ b/tasks/0081_967_81967576_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_302_82302927_qa_3/environment/bootstrap.sh b/tasks/0082_302_82302927_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_302_82302927_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_302_82302927_qa_3/environment/pull_bucket.py b/tasks/0082_302_82302927_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_302_82302927_qa_3/environment/pull_bucket.py +++ b/tasks/0082_302_82302927_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_302_82302927_qa_3/task.toml b/tasks/0082_302_82302927_qa_3/task.toml index 0d85d553528b11a32173dc164f62efa2675ea81d..d46c5e42db4f7cf10515acb2ff61f5bfe97b0d01 100644 --- a/tasks/0082_302_82302927_qa_3/task.toml +++ b/tasks/0082_302_82302927_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_332_82332185_qa_2/environment/bootstrap.sh b/tasks/0082_332_82332185_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_332_82332185_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_332_82332185_qa_2/environment/pull_bucket.py b/tasks/0082_332_82332185_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_332_82332185_qa_2/environment/pull_bucket.py +++ b/tasks/0082_332_82332185_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_332_82332185_qa_2/task.toml b/tasks/0082_332_82332185_qa_2/task.toml index 47dc9d811fef93f0b7e8c315b4092e892b0b16fd..850e5a017bf4d4b8bdfd60afbbd2ef2d126996cb 100644 --- a/tasks/0082_332_82332185_qa_2/task.toml +++ b/tasks/0082_332_82332185_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_332_82332185_qa_5/environment/bootstrap.sh b/tasks/0082_332_82332185_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_332_82332185_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_332_82332185_qa_5/environment/pull_bucket.py b/tasks/0082_332_82332185_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_332_82332185_qa_5/environment/pull_bucket.py +++ b/tasks/0082_332_82332185_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_332_82332185_qa_5/task.toml b/tasks/0082_332_82332185_qa_5/task.toml index 2cd2dd7223c0c6d7cff130c9ba88015952e96eb1..06970396d4d03455981babda4acce4e89a724d92 100644 --- a/tasks/0082_332_82332185_qa_5/task.toml +++ b/tasks/0082_332_82332185_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_373_82373986_qa_1/environment/bootstrap.sh b/tasks/0082_373_82373986_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_373_82373986_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_373_82373986_qa_1/environment/pull_bucket.py b/tasks/0082_373_82373986_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_373_82373986_qa_1/environment/pull_bucket.py +++ b/tasks/0082_373_82373986_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_373_82373986_qa_1/task.toml b/tasks/0082_373_82373986_qa_1/task.toml index 687afff3d5ea2df572cf45f4a2f7f805492bb2ca..6e5bf16aac4014e5c7d32845b7bc98ed589076b2 100644 --- a/tasks/0082_373_82373986_qa_1/task.toml +++ b/tasks/0082_373_82373986_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_384_82384588_qa_1/environment/bootstrap.sh b/tasks/0082_384_82384588_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_384_82384588_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_384_82384588_qa_1/environment/pull_bucket.py b/tasks/0082_384_82384588_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_384_82384588_qa_1/environment/pull_bucket.py +++ b/tasks/0082_384_82384588_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_384_82384588_qa_1/task.toml b/tasks/0082_384_82384588_qa_1/task.toml index 01f439e4a6996fcbb11a32ffc26fc45c2ca8b6ad..43656caf1fcc4857c414502f65457f8d99b0a52f 100644 --- a/tasks/0082_384_82384588_qa_1/task.toml +++ b/tasks/0082_384_82384588_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_384_82384588_qa_5/environment/bootstrap.sh b/tasks/0082_384_82384588_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_384_82384588_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_384_82384588_qa_5/environment/pull_bucket.py b/tasks/0082_384_82384588_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_384_82384588_qa_5/environment/pull_bucket.py +++ b/tasks/0082_384_82384588_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_384_82384588_qa_5/task.toml b/tasks/0082_384_82384588_qa_5/task.toml index 32e71df0d3e08bb6f974ec0df36905fe1e1dcf8e..ace0457913aaf29ad9e300e248c5667ca5a7d486 100644 --- a/tasks/0082_384_82384588_qa_5/task.toml +++ b/tasks/0082_384_82384588_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_385_82385327_qa_3/environment/bootstrap.sh b/tasks/0082_385_82385327_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_385_82385327_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_385_82385327_qa_3/environment/pull_bucket.py b/tasks/0082_385_82385327_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_385_82385327_qa_3/environment/pull_bucket.py +++ b/tasks/0082_385_82385327_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_385_82385327_qa_3/task.toml b/tasks/0082_385_82385327_qa_3/task.toml index 4c51efaf5455ca8d7b839174718ec8363b58c4c4..8ae083eeef1724cc4a469cb772bf56b0e19c71b7 100644 --- a/tasks/0082_385_82385327_qa_3/task.toml +++ b/tasks/0082_385_82385327_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_385_82385327_qa_5/environment/bootstrap.sh b/tasks/0082_385_82385327_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_385_82385327_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_385_82385327_qa_5/environment/pull_bucket.py b/tasks/0082_385_82385327_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_385_82385327_qa_5/environment/pull_bucket.py +++ b/tasks/0082_385_82385327_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_385_82385327_qa_5/task.toml b/tasks/0082_385_82385327_qa_5/task.toml index f194e2c6e9ab16b07c3c86be710e696f8070ff52..907a3fbde8e02b1868f53873eff7196e9aecaad3 100644 --- a/tasks/0082_385_82385327_qa_5/task.toml +++ b/tasks/0082_385_82385327_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_498_82498397_qa_1/environment/bootstrap.sh b/tasks/0082_498_82498397_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_498_82498397_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_498_82498397_qa_1/environment/pull_bucket.py b/tasks/0082_498_82498397_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_498_82498397_qa_1/environment/pull_bucket.py +++ b/tasks/0082_498_82498397_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_498_82498397_qa_1/task.toml b/tasks/0082_498_82498397_qa_1/task.toml index ff71d288678dcc0d1830c10f6c27124a1a3ffcd3..9afc180ebbb8a8a58691cbab8f32fda05a476481 100644 --- a/tasks/0082_498_82498397_qa_1/task.toml +++ b/tasks/0082_498_82498397_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_498_82498397_qa_3/environment/bootstrap.sh b/tasks/0082_498_82498397_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_498_82498397_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_498_82498397_qa_3/environment/pull_bucket.py b/tasks/0082_498_82498397_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_498_82498397_qa_3/environment/pull_bucket.py +++ b/tasks/0082_498_82498397_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_498_82498397_qa_3/task.toml b/tasks/0082_498_82498397_qa_3/task.toml index 64a4a0a0292610d95523779eda542bb40068c81f..f29043c25865124e90e6e62233ea84a765df60b9 100644 --- a/tasks/0082_498_82498397_qa_3/task.toml +++ b/tasks/0082_498_82498397_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_498_82498397_qa_4/environment/bootstrap.sh b/tasks/0082_498_82498397_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_498_82498397_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_498_82498397_qa_4/environment/pull_bucket.py b/tasks/0082_498_82498397_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_498_82498397_qa_4/environment/pull_bucket.py +++ b/tasks/0082_498_82498397_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_498_82498397_qa_4/task.toml b/tasks/0082_498_82498397_qa_4/task.toml index 03b202b8db07d38b7e51d5a215a17f6a6e1e86b1..c52ede36440bb1d1cd4afeb948b7d75701cc2362 100644 --- a/tasks/0082_498_82498397_qa_4/task.toml +++ b/tasks/0082_498_82498397_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_498_82498397_qa_5/environment/bootstrap.sh b/tasks/0082_498_82498397_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_498_82498397_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_498_82498397_qa_5/environment/pull_bucket.py b/tasks/0082_498_82498397_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_498_82498397_qa_5/environment/pull_bucket.py +++ b/tasks/0082_498_82498397_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_498_82498397_qa_5/task.toml b/tasks/0082_498_82498397_qa_5/task.toml index ad9b8a271c36121f0ecab37997b266a9863eb36d..87d7f933581ad056ea56a074200f5c5274e1a771 100644 --- a/tasks/0082_498_82498397_qa_5/task.toml +++ b/tasks/0082_498_82498397_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_619_82619539_qa_1/environment/bootstrap.sh b/tasks/0082_619_82619539_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_619_82619539_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_619_82619539_qa_1/environment/pull_bucket.py b/tasks/0082_619_82619539_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_619_82619539_qa_1/environment/pull_bucket.py +++ b/tasks/0082_619_82619539_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_619_82619539_qa_1/task.toml b/tasks/0082_619_82619539_qa_1/task.toml index 5b65ed921743a662ccf58dc03d9d9383dc6f7284..de89e4d0025117b226b3acee0988721321eadf18 100644 --- a/tasks/0082_619_82619539_qa_1/task.toml +++ b/tasks/0082_619_82619539_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_619_82619539_qa_4/environment/bootstrap.sh b/tasks/0082_619_82619539_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_619_82619539_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_619_82619539_qa_4/environment/pull_bucket.py b/tasks/0082_619_82619539_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_619_82619539_qa_4/environment/pull_bucket.py +++ b/tasks/0082_619_82619539_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_619_82619539_qa_4/task.toml b/tasks/0082_619_82619539_qa_4/task.toml index b62646a179d2bdb5bcf000246438061313d2475e..5daae40ac1daf7623362a002a3c3d1e97ee0a6d2 100644 --- a/tasks/0082_619_82619539_qa_4/task.toml +++ b/tasks/0082_619_82619539_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_646_82646090_qa_2/environment/bootstrap.sh b/tasks/0082_646_82646090_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_646_82646090_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_646_82646090_qa_2/environment/pull_bucket.py b/tasks/0082_646_82646090_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_646_82646090_qa_2/environment/pull_bucket.py +++ b/tasks/0082_646_82646090_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_646_82646090_qa_2/task.toml b/tasks/0082_646_82646090_qa_2/task.toml index 873cc5dc50139e1386a0d0fb1f1f31e9fde618e9..18a6b5cac9558e859846b850721a3671b8d3e4df 100644 --- a/tasks/0082_646_82646090_qa_2/task.toml +++ b/tasks/0082_646_82646090_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_646_82646090_qa_3/environment/bootstrap.sh b/tasks/0082_646_82646090_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_646_82646090_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_646_82646090_qa_3/environment/pull_bucket.py b/tasks/0082_646_82646090_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_646_82646090_qa_3/environment/pull_bucket.py +++ b/tasks/0082_646_82646090_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_646_82646090_qa_3/task.toml b/tasks/0082_646_82646090_qa_3/task.toml index 05557b707d55427b386b86279263c23abcd4f587..da6cbf4e8acbdacc06c9d568cddf2a93cf6cb00b 100644 --- a/tasks/0082_646_82646090_qa_3/task.toml +++ b/tasks/0082_646_82646090_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_658_82658184_qa_1/environment/bootstrap.sh b/tasks/0082_658_82658184_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_658_82658184_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_658_82658184_qa_1/environment/pull_bucket.py b/tasks/0082_658_82658184_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_658_82658184_qa_1/environment/pull_bucket.py +++ b/tasks/0082_658_82658184_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_658_82658184_qa_1/task.toml b/tasks/0082_658_82658184_qa_1/task.toml index d9f482c86ceac25cb480b0b9b5f0d4bf00cf7dd9..0ccb3211bbfa611f8566c5be00b0a7d567e044c7 100644 --- a/tasks/0082_658_82658184_qa_1/task.toml +++ b/tasks/0082_658_82658184_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_759_82759610_qa_3/environment/bootstrap.sh b/tasks/0082_759_82759610_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_759_82759610_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_759_82759610_qa_3/environment/pull_bucket.py b/tasks/0082_759_82759610_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_759_82759610_qa_3/environment/pull_bucket.py +++ b/tasks/0082_759_82759610_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_759_82759610_qa_3/task.toml b/tasks/0082_759_82759610_qa_3/task.toml index a84b1555e7287355109a488aa69d1ebcb1e04933..35b9dfe5e742d1a196765d1adad4f0e117bdac2b 100644 --- a/tasks/0082_759_82759610_qa_3/task.toml +++ b/tasks/0082_759_82759610_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_759_82759610_qa_5/environment/bootstrap.sh b/tasks/0082_759_82759610_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_759_82759610_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_759_82759610_qa_5/environment/pull_bucket.py b/tasks/0082_759_82759610_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_759_82759610_qa_5/environment/pull_bucket.py +++ b/tasks/0082_759_82759610_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_759_82759610_qa_5/task.toml b/tasks/0082_759_82759610_qa_5/task.toml index 4e7ec153b877e24b8c310c5c193530ebdb889ff9..b31265d5260df7c941e8d91d922b35383b3ae90b 100644 --- a/tasks/0082_759_82759610_qa_5/task.toml +++ b/tasks/0082_759_82759610_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_858_82858946_qa_5/environment/bootstrap.sh b/tasks/0082_858_82858946_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_858_82858946_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_858_82858946_qa_5/environment/pull_bucket.py b/tasks/0082_858_82858946_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_858_82858946_qa_5/environment/pull_bucket.py +++ b/tasks/0082_858_82858946_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_858_82858946_qa_5/task.toml b/tasks/0082_858_82858946_qa_5/task.toml index 1dcdb870a18ec275bc8ec57105ebcd1479d57120..d645fb25af59a6824055b890a5fe2f7b7f5ae3e6 100644 --- a/tasks/0082_858_82858946_qa_5/task.toml +++ b/tasks/0082_858_82858946_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_935_82935300_qa_2/environment/bootstrap.sh b/tasks/0082_935_82935300_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_935_82935300_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_935_82935300_qa_2/environment/pull_bucket.py b/tasks/0082_935_82935300_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_935_82935300_qa_2/environment/pull_bucket.py +++ b/tasks/0082_935_82935300_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_935_82935300_qa_2/task.toml b/tasks/0082_935_82935300_qa_2/task.toml index ec93f8368e8e3584398e74b0b2124c7350e0db12..7a9d4656426adffd880429ce04ff22e59d333bbe 100644 --- a/tasks/0082_935_82935300_qa_2/task.toml +++ b/tasks/0082_935_82935300_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_939_82939452_qa_1/environment/bootstrap.sh b/tasks/0082_939_82939452_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_939_82939452_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_939_82939452_qa_1/environment/pull_bucket.py b/tasks/0082_939_82939452_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_939_82939452_qa_1/environment/pull_bucket.py +++ b/tasks/0082_939_82939452_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_939_82939452_qa_1/task.toml b/tasks/0082_939_82939452_qa_1/task.toml index fdd87b2264bec171585ed60ec7f3f20b33b05511..4490f4d2fc2cf9abf8a6d6843571284be684decb 100644 --- a/tasks/0082_939_82939452_qa_1/task.toml +++ b/tasks/0082_939_82939452_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_939_82939452_qa_3/environment/bootstrap.sh b/tasks/0082_939_82939452_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_939_82939452_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_939_82939452_qa_3/environment/pull_bucket.py b/tasks/0082_939_82939452_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_939_82939452_qa_3/environment/pull_bucket.py +++ b/tasks/0082_939_82939452_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_939_82939452_qa_3/task.toml b/tasks/0082_939_82939452_qa_3/task.toml index 5d57e641f7505d23b2f0140e0e85078b33f1660d..ae9f0f16f454fb77d16d5182510e0d13ad4fc614 100644 --- a/tasks/0082_939_82939452_qa_3/task.toml +++ b/tasks/0082_939_82939452_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_955_82955964_qa_2/environment/bootstrap.sh b/tasks/0082_955_82955964_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_955_82955964_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_955_82955964_qa_2/environment/pull_bucket.py b/tasks/0082_955_82955964_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_955_82955964_qa_2/environment/pull_bucket.py +++ b/tasks/0082_955_82955964_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_955_82955964_qa_2/task.toml b/tasks/0082_955_82955964_qa_2/task.toml index 12cabaed135b268478ea047e489ba7fe416d6f89..6165da727234f9c43d9dc28341936f1c75946216 100644 --- a/tasks/0082_955_82955964_qa_2/task.toml +++ b/tasks/0082_955_82955964_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_955_82955964_qa_3/environment/bootstrap.sh b/tasks/0082_955_82955964_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_955_82955964_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_955_82955964_qa_3/environment/pull_bucket.py b/tasks/0082_955_82955964_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_955_82955964_qa_3/environment/pull_bucket.py +++ b/tasks/0082_955_82955964_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_955_82955964_qa_3/task.toml b/tasks/0082_955_82955964_qa_3/task.toml index 1f0aade5d84726b58b03a15f34d8bc65b055ca9e..d54c05e188a880bc3ece11abf605539cea1604db 100644 --- a/tasks/0082_955_82955964_qa_3/task.toml +++ b/tasks/0082_955_82955964_qa_3/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_960_82960295_qa_4/environment/bootstrap.sh b/tasks/0082_960_82960295_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_960_82960295_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_960_82960295_qa_4/environment/pull_bucket.py b/tasks/0082_960_82960295_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_960_82960295_qa_4/environment/pull_bucket.py +++ b/tasks/0082_960_82960295_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_960_82960295_qa_4/task.toml b/tasks/0082_960_82960295_qa_4/task.toml index ad9fba99ffd81809e6f8d0d8681bc21ac5441ae4..f6e28bfe2a60469ca9cea868aa59784ca31ba5b0 100644 --- a/tasks/0082_960_82960295_qa_4/task.toml +++ b/tasks/0082_960_82960295_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0082_994_82994330_qa_5/environment/bootstrap.sh b/tasks/0082_994_82994330_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0082_994_82994330_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0082_994_82994330_qa_5/environment/pull_bucket.py b/tasks/0082_994_82994330_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0082_994_82994330_qa_5/environment/pull_bucket.py +++ b/tasks/0082_994_82994330_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0082_994_82994330_qa_5/task.toml b/tasks/0082_994_82994330_qa_5/task.toml index d77f1208e24f5a141552fe4f58a15100c5951749..d96dc35f23396153c9970e5434125eb23266faeb 100644 --- a/tasks/0082_994_82994330_qa_5/task.toml +++ b/tasks/0082_994_82994330_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_022_83022280_qa_3/environment/bootstrap.sh b/tasks/0083_022_83022280_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_022_83022280_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_022_83022280_qa_3/environment/pull_bucket.py b/tasks/0083_022_83022280_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_022_83022280_qa_3/environment/pull_bucket.py +++ b/tasks/0083_022_83022280_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_022_83022280_qa_3/task.toml b/tasks/0083_022_83022280_qa_3/task.toml index d47e42f6865c382707f5589c3602696e019288de..0b8448af7f7feb4f2488f7e2b0000a82887e7348 100644 --- a/tasks/0083_022_83022280_qa_3/task.toml +++ b/tasks/0083_022_83022280_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_022_83022280_qa_4/environment/bootstrap.sh b/tasks/0083_022_83022280_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_022_83022280_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_022_83022280_qa_4/environment/pull_bucket.py b/tasks/0083_022_83022280_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_022_83022280_qa_4/environment/pull_bucket.py +++ b/tasks/0083_022_83022280_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_022_83022280_qa_4/task.toml b/tasks/0083_022_83022280_qa_4/task.toml index 97698d2d17895ec0f8dc3ae00261111f92d65a7c..268543c969e9001058379a39fe4dab33c5fa35f3 100644 --- a/tasks/0083_022_83022280_qa_4/task.toml +++ b/tasks/0083_022_83022280_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_063_83063460_qa_3/environment/bootstrap.sh b/tasks/0083_063_83063460_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_063_83063460_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_063_83063460_qa_3/environment/pull_bucket.py b/tasks/0083_063_83063460_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_063_83063460_qa_3/environment/pull_bucket.py +++ b/tasks/0083_063_83063460_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_063_83063460_qa_3/task.toml b/tasks/0083_063_83063460_qa_3/task.toml index 52c28f3e78cd658197c72c09fd462ff409c549f2..d89256d09e0170d0f699ecbde8ca1b11dfa5a1ec 100644 --- a/tasks/0083_063_83063460_qa_3/task.toml +++ b/tasks/0083_063_83063460_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_063_83063460_qa_4/environment/bootstrap.sh b/tasks/0083_063_83063460_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_063_83063460_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_063_83063460_qa_4/environment/pull_bucket.py b/tasks/0083_063_83063460_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_063_83063460_qa_4/environment/pull_bucket.py +++ b/tasks/0083_063_83063460_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_063_83063460_qa_4/task.toml b/tasks/0083_063_83063460_qa_4/task.toml index 61501138e41b5c73051fc06d7c1742a0eae9cabb..2ee532cccbb200905e887613d747d0083fddea20 100644 --- a/tasks/0083_063_83063460_qa_4/task.toml +++ b/tasks/0083_063_83063460_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_063_83063460_qa_5/environment/bootstrap.sh b/tasks/0083_063_83063460_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_063_83063460_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_063_83063460_qa_5/environment/pull_bucket.py b/tasks/0083_063_83063460_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_063_83063460_qa_5/environment/pull_bucket.py +++ b/tasks/0083_063_83063460_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_063_83063460_qa_5/task.toml b/tasks/0083_063_83063460_qa_5/task.toml index 0e7691c9ef01b0c1aaa8896ae64a5f586e741f5b..317b2f98f10e4eb435fb98d70fa92fb92140ee30 100644 --- a/tasks/0083_063_83063460_qa_5/task.toml +++ b/tasks/0083_063_83063460_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_069_83069370_qa_2/environment/bootstrap.sh b/tasks/0083_069_83069370_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_069_83069370_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_069_83069370_qa_2/environment/pull_bucket.py b/tasks/0083_069_83069370_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_069_83069370_qa_2/environment/pull_bucket.py +++ b/tasks/0083_069_83069370_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_069_83069370_qa_2/task.toml b/tasks/0083_069_83069370_qa_2/task.toml index 0a9fd487ca9f9b4cd102b44b9452e448b11594e9..9bfd67344ee6ec8a4517a317f28ce9d6ed9e61d2 100644 --- a/tasks/0083_069_83069370_qa_2/task.toml +++ b/tasks/0083_069_83069370_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_113_83113866_qa_4/environment/bootstrap.sh b/tasks/0083_113_83113866_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_113_83113866_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_113_83113866_qa_4/environment/pull_bucket.py b/tasks/0083_113_83113866_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_113_83113866_qa_4/environment/pull_bucket.py +++ b/tasks/0083_113_83113866_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_113_83113866_qa_4/task.toml b/tasks/0083_113_83113866_qa_4/task.toml index 7bb79267b0bc7a7ab7e82b84864fc34efebec19a..be6d52a98c01fb452d1d29155e32f7bb760256af 100644 --- a/tasks/0083_113_83113866_qa_4/task.toml +++ b/tasks/0083_113_83113866_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_138_83138273_qa_5/environment/bootstrap.sh b/tasks/0083_138_83138273_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_138_83138273_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_138_83138273_qa_5/environment/pull_bucket.py b/tasks/0083_138_83138273_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_138_83138273_qa_5/environment/pull_bucket.py +++ b/tasks/0083_138_83138273_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_138_83138273_qa_5/task.toml b/tasks/0083_138_83138273_qa_5/task.toml index 0ae47b1a34d75450081e8362d9eae36a8fdc54b1..21af57ad95f1f17bee7df47a01384ba34251c3fd 100644 --- a/tasks/0083_138_83138273_qa_5/task.toml +++ b/tasks/0083_138_83138273_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_191_83191425_qa_1/environment/bootstrap.sh b/tasks/0083_191_83191425_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_191_83191425_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_191_83191425_qa_1/environment/pull_bucket.py b/tasks/0083_191_83191425_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_191_83191425_qa_1/environment/pull_bucket.py +++ b/tasks/0083_191_83191425_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_191_83191425_qa_1/task.toml b/tasks/0083_191_83191425_qa_1/task.toml index 6f0de4c84ac9b67537d3bcb19b0bf552bbc300f1..8335cf07bf0ab1176458ee24b696e856b1c8ff73 100644 --- a/tasks/0083_191_83191425_qa_1/task.toml +++ b/tasks/0083_191_83191425_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_191_83191425_qa_3/environment/bootstrap.sh b/tasks/0083_191_83191425_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_191_83191425_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_191_83191425_qa_3/environment/pull_bucket.py b/tasks/0083_191_83191425_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_191_83191425_qa_3/environment/pull_bucket.py +++ b/tasks/0083_191_83191425_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_191_83191425_qa_3/task.toml b/tasks/0083_191_83191425_qa_3/task.toml index 13914654c07f4a3018ac61ace036dc997e84119b..6d683e637a67c75c6b6dc1a44b552dcf8471aca1 100644 --- a/tasks/0083_191_83191425_qa_3/task.toml +++ b/tasks/0083_191_83191425_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_191_83191425_qa_5/environment/bootstrap.sh b/tasks/0083_191_83191425_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_191_83191425_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_191_83191425_qa_5/environment/pull_bucket.py b/tasks/0083_191_83191425_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_191_83191425_qa_5/environment/pull_bucket.py +++ b/tasks/0083_191_83191425_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_191_83191425_qa_5/task.toml b/tasks/0083_191_83191425_qa_5/task.toml index 8252f8b054973a46dc52cead0bc8dfcddb689753..843b4024617062bcafc65de832a607eacd7f6da9 100644 --- a/tasks/0083_191_83191425_qa_5/task.toml +++ b/tasks/0083_191_83191425_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_238_83238182_qa_2/environment/bootstrap.sh b/tasks/0083_238_83238182_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_238_83238182_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_238_83238182_qa_2/environment/pull_bucket.py b/tasks/0083_238_83238182_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_238_83238182_qa_2/environment/pull_bucket.py +++ b/tasks/0083_238_83238182_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_238_83238182_qa_2/task.toml b/tasks/0083_238_83238182_qa_2/task.toml index 0061dcb1951eab67116989d90236204bbe3243b8..2933d86c5d5d061ef00e0566bc618f2f74977a2b 100644 --- a/tasks/0083_238_83238182_qa_2/task.toml +++ b/tasks/0083_238_83238182_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_317_83317900_qa_1/environment/bootstrap.sh b/tasks/0083_317_83317900_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_317_83317900_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_317_83317900_qa_1/environment/pull_bucket.py b/tasks/0083_317_83317900_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_317_83317900_qa_1/environment/pull_bucket.py +++ b/tasks/0083_317_83317900_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_317_83317900_qa_1/task.toml b/tasks/0083_317_83317900_qa_1/task.toml index e603f3264cd9854a484290b6380acb74adfd64b8..e647c078deae8a2a29ff28b0abcc328d692934cb 100644 --- a/tasks/0083_317_83317900_qa_1/task.toml +++ b/tasks/0083_317_83317900_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_618_83618078_qa_4/environment/bootstrap.sh b/tasks/0083_618_83618078_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_618_83618078_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_618_83618078_qa_4/environment/pull_bucket.py b/tasks/0083_618_83618078_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_618_83618078_qa_4/environment/pull_bucket.py +++ b/tasks/0083_618_83618078_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_618_83618078_qa_4/task.toml b/tasks/0083_618_83618078_qa_4/task.toml index f75e9a8a0ef21f521a576b02c1d0bc56f9082c0a..e8faefa5eed41a68f840ef377d8ff4b1f0089979 100644 --- a/tasks/0083_618_83618078_qa_4/task.toml +++ b/tasks/0083_618_83618078_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_620_83620010_qa_4/environment/bootstrap.sh b/tasks/0083_620_83620010_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_620_83620010_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_620_83620010_qa_4/environment/pull_bucket.py b/tasks/0083_620_83620010_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_620_83620010_qa_4/environment/pull_bucket.py +++ b/tasks/0083_620_83620010_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_620_83620010_qa_4/task.toml b/tasks/0083_620_83620010_qa_4/task.toml index dba9b147302a6ef401aff4e0bb809245e0719b77..7ddd9edc6434c05e61145272c66479158198232c 100644 --- a/tasks/0083_620_83620010_qa_4/task.toml +++ b/tasks/0083_620_83620010_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_648_83648661_qa_1/environment/bootstrap.sh b/tasks/0083_648_83648661_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_648_83648661_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_648_83648661_qa_1/environment/pull_bucket.py b/tasks/0083_648_83648661_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_648_83648661_qa_1/environment/pull_bucket.py +++ b/tasks/0083_648_83648661_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_648_83648661_qa_1/task.toml b/tasks/0083_648_83648661_qa_1/task.toml index 6520e2a08eb3961e24f674ed87a2925b41add9eb..d628ec2521feccff4c5059efb29d823455a6cbb6 100644 --- a/tasks/0083_648_83648661_qa_1/task.toml +++ b/tasks/0083_648_83648661_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_648_83648661_qa_3/environment/bootstrap.sh b/tasks/0083_648_83648661_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_648_83648661_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_648_83648661_qa_3/environment/pull_bucket.py b/tasks/0083_648_83648661_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_648_83648661_qa_3/environment/pull_bucket.py +++ b/tasks/0083_648_83648661_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_648_83648661_qa_3/task.toml b/tasks/0083_648_83648661_qa_3/task.toml index ce4837d8676174f5419af54e06de0a2aec791e13..052188a1c2a8c9760e9d761fb2e4d5a8851d3bc0 100644 --- a/tasks/0083_648_83648661_qa_3/task.toml +++ b/tasks/0083_648_83648661_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_938_83938085_qa_5/environment/bootstrap.sh b/tasks/0083_938_83938085_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_938_83938085_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_938_83938085_qa_5/environment/pull_bucket.py b/tasks/0083_938_83938085_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_938_83938085_qa_5/environment/pull_bucket.py +++ b/tasks/0083_938_83938085_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_938_83938085_qa_5/task.toml b/tasks/0083_938_83938085_qa_5/task.toml index b867f8a8e93898bd2bb41f5e339d52f573548c75..bc7027026cb839619be0b18f97c2e2219ea450f6 100644 --- a/tasks/0083_938_83938085_qa_5/task.toml +++ b/tasks/0083_938_83938085_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0083_989_83989999_qa_2/environment/bootstrap.sh b/tasks/0083_989_83989999_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0083_989_83989999_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0083_989_83989999_qa_2/environment/pull_bucket.py b/tasks/0083_989_83989999_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0083_989_83989999_qa_2/environment/pull_bucket.py +++ b/tasks/0083_989_83989999_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0083_989_83989999_qa_2/task.toml b/tasks/0083_989_83989999_qa_2/task.toml index 49b475e86afc02450c48a89ac991cb7e30fbf165..87983acf48b1c2db664e9eb97a743551e68c7c72 100644 --- a/tasks/0083_989_83989999_qa_2/task.toml +++ b/tasks/0083_989_83989999_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_132_84132638_qa_1/environment/bootstrap.sh b/tasks/0084_132_84132638_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_132_84132638_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_132_84132638_qa_1/environment/pull_bucket.py b/tasks/0084_132_84132638_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_132_84132638_qa_1/environment/pull_bucket.py +++ b/tasks/0084_132_84132638_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_132_84132638_qa_1/task.toml b/tasks/0084_132_84132638_qa_1/task.toml index 7d3689b1108f691f24fe618b91de6f055961dbea..54b2d178af1c0db0bc157d812cd4ac870056f95d 100644 --- a/tasks/0084_132_84132638_qa_1/task.toml +++ b/tasks/0084_132_84132638_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_135_84135613_qa_1/environment/bootstrap.sh b/tasks/0084_135_84135613_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_135_84135613_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_135_84135613_qa_1/environment/pull_bucket.py b/tasks/0084_135_84135613_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_135_84135613_qa_1/environment/pull_bucket.py +++ b/tasks/0084_135_84135613_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_135_84135613_qa_1/task.toml b/tasks/0084_135_84135613_qa_1/task.toml index e2d67b09c3ad1140f06eb564dfa67a03abf757aa..d04bd15409bd091a8c2623ffacc113079656d26f 100644 --- a/tasks/0084_135_84135613_qa_1/task.toml +++ b/tasks/0084_135_84135613_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_135_84135613_qa_4/environment/bootstrap.sh b/tasks/0084_135_84135613_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_135_84135613_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_135_84135613_qa_4/environment/pull_bucket.py b/tasks/0084_135_84135613_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_135_84135613_qa_4/environment/pull_bucket.py +++ b/tasks/0084_135_84135613_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_135_84135613_qa_4/task.toml b/tasks/0084_135_84135613_qa_4/task.toml index 3a4664d887a969486a5e36332cb68a267d2f9e55..d4df552ed77ef102abae4d55e104801067189c4d 100644 --- a/tasks/0084_135_84135613_qa_4/task.toml +++ b/tasks/0084_135_84135613_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_148_84148842_qa_5/environment/bootstrap.sh b/tasks/0084_148_84148842_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_148_84148842_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_148_84148842_qa_5/environment/pull_bucket.py b/tasks/0084_148_84148842_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_148_84148842_qa_5/environment/pull_bucket.py +++ b/tasks/0084_148_84148842_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_148_84148842_qa_5/task.toml b/tasks/0084_148_84148842_qa_5/task.toml index f5ac20572d03bd1f11709ac53c3af82223aa4334..5f11851d258ece8d261c4f12a112674e0526cf63 100644 --- a/tasks/0084_148_84148842_qa_5/task.toml +++ b/tasks/0084_148_84148842_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_293_84293465_qa_2/environment/bootstrap.sh b/tasks/0084_293_84293465_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_293_84293465_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_293_84293465_qa_2/environment/pull_bucket.py b/tasks/0084_293_84293465_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_293_84293465_qa_2/environment/pull_bucket.py +++ b/tasks/0084_293_84293465_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_293_84293465_qa_2/task.toml b/tasks/0084_293_84293465_qa_2/task.toml index f0bef8ce249da91ab93df9952f52a3717642c320..8f104d8c72a77d8879f70d42cc8f13e35aa68f14 100644 --- a/tasks/0084_293_84293465_qa_2/task.toml +++ b/tasks/0084_293_84293465_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_297_84297732_qa_2/environment/bootstrap.sh b/tasks/0084_297_84297732_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_297_84297732_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_297_84297732_qa_2/environment/pull_bucket.py b/tasks/0084_297_84297732_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_297_84297732_qa_2/environment/pull_bucket.py +++ b/tasks/0084_297_84297732_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_297_84297732_qa_2/task.toml b/tasks/0084_297_84297732_qa_2/task.toml index dd5de754d9344c1a5aef93ba218ab8deb2c0cfd0..bff3fa0634ed7e0bbb834976dd6204a96172e99a 100644 --- a/tasks/0084_297_84297732_qa_2/task.toml +++ b/tasks/0084_297_84297732_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_297_84297732_qa_3/environment/bootstrap.sh b/tasks/0084_297_84297732_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_297_84297732_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_297_84297732_qa_3/environment/pull_bucket.py b/tasks/0084_297_84297732_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_297_84297732_qa_3/environment/pull_bucket.py +++ b/tasks/0084_297_84297732_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_297_84297732_qa_3/task.toml b/tasks/0084_297_84297732_qa_3/task.toml index 6843347ecc6bb1a8f32d50b37730fdbd278afecd..a4d744467e657a15d0a14f8f3db3f836517e6a76 100644 --- a/tasks/0084_297_84297732_qa_3/task.toml +++ b/tasks/0084_297_84297732_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_297_84297732_qa_4/environment/bootstrap.sh b/tasks/0084_297_84297732_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_297_84297732_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_297_84297732_qa_4/environment/pull_bucket.py b/tasks/0084_297_84297732_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_297_84297732_qa_4/environment/pull_bucket.py +++ b/tasks/0084_297_84297732_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_297_84297732_qa_4/task.toml b/tasks/0084_297_84297732_qa_4/task.toml index 13545aa67b72e37fc86ec01e016eeca44d21e206..143f9d6a80d65a4bc111c52f5049d8ee89abedd2 100644 --- a/tasks/0084_297_84297732_qa_4/task.toml +++ b/tasks/0084_297_84297732_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_320_84320235_qa_1/environment/bootstrap.sh b/tasks/0084_320_84320235_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_320_84320235_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_320_84320235_qa_1/environment/pull_bucket.py b/tasks/0084_320_84320235_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_320_84320235_qa_1/environment/pull_bucket.py +++ b/tasks/0084_320_84320235_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_320_84320235_qa_1/task.toml b/tasks/0084_320_84320235_qa_1/task.toml index e4cf2b30ab0edee556fd3cc33cd8aa4d61b75d9b..dbd2382b965c54ef224eb12049493ce2d2173056 100644 --- a/tasks/0084_320_84320235_qa_1/task.toml +++ b/tasks/0084_320_84320235_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_320_84320235_qa_4/environment/bootstrap.sh b/tasks/0084_320_84320235_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_320_84320235_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_320_84320235_qa_4/environment/pull_bucket.py b/tasks/0084_320_84320235_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_320_84320235_qa_4/environment/pull_bucket.py +++ b/tasks/0084_320_84320235_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_320_84320235_qa_4/task.toml b/tasks/0084_320_84320235_qa_4/task.toml index ba0b621a954a3354021c53be32bb34af2c0561f9..34a11db7b4586036a05063e95deaa75ed3862a0b 100644 --- a/tasks/0084_320_84320235_qa_4/task.toml +++ b/tasks/0084_320_84320235_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_326_84326025_qa_3/environment/bootstrap.sh b/tasks/0084_326_84326025_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_326_84326025_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_326_84326025_qa_3/environment/pull_bucket.py b/tasks/0084_326_84326025_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_326_84326025_qa_3/environment/pull_bucket.py +++ b/tasks/0084_326_84326025_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_326_84326025_qa_3/task.toml b/tasks/0084_326_84326025_qa_3/task.toml index 95d249119b93df2c7a6b395584bb87994945e376..7460d793c3a1fecbb061a193a6ae44c92855129a 100644 --- a/tasks/0084_326_84326025_qa_3/task.toml +++ b/tasks/0084_326_84326025_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_326_84326025_qa_5/environment/bootstrap.sh b/tasks/0084_326_84326025_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_326_84326025_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_326_84326025_qa_5/environment/pull_bucket.py b/tasks/0084_326_84326025_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_326_84326025_qa_5/environment/pull_bucket.py +++ b/tasks/0084_326_84326025_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_326_84326025_qa_5/task.toml b/tasks/0084_326_84326025_qa_5/task.toml index 10e56e2e32d4f96869cf7a665b15e35df510be48..64e307f91bb9a0fb50d9a34cd21966df2be723f3 100644 --- a/tasks/0084_326_84326025_qa_5/task.toml +++ b/tasks/0084_326_84326025_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_460_84460847_qa_2/environment/bootstrap.sh b/tasks/0084_460_84460847_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_460_84460847_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_460_84460847_qa_2/environment/pull_bucket.py b/tasks/0084_460_84460847_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_460_84460847_qa_2/environment/pull_bucket.py +++ b/tasks/0084_460_84460847_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_460_84460847_qa_2/task.toml b/tasks/0084_460_84460847_qa_2/task.toml index 64b5b10e90e06bc54f4e83b58ba7ed90508fe33b..0bce93bfcd9b3b8b59b6080ce80c71b38f8244c7 100644 --- a/tasks/0084_460_84460847_qa_2/task.toml +++ b/tasks/0084_460_84460847_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_523_84523209_qa_1/environment/bootstrap.sh b/tasks/0084_523_84523209_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_523_84523209_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_523_84523209_qa_1/environment/pull_bucket.py b/tasks/0084_523_84523209_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_523_84523209_qa_1/environment/pull_bucket.py +++ b/tasks/0084_523_84523209_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_523_84523209_qa_1/task.toml b/tasks/0084_523_84523209_qa_1/task.toml index d1b04eaf2e59ffbc51658824b5601cf8d897f48e..415dffd37cea629154c39634cc907862429ba6a0 100644 --- a/tasks/0084_523_84523209_qa_1/task.toml +++ b/tasks/0084_523_84523209_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_523_84523209_qa_5/environment/bootstrap.sh b/tasks/0084_523_84523209_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_523_84523209_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_523_84523209_qa_5/environment/pull_bucket.py b/tasks/0084_523_84523209_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_523_84523209_qa_5/environment/pull_bucket.py +++ b/tasks/0084_523_84523209_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_523_84523209_qa_5/task.toml b/tasks/0084_523_84523209_qa_5/task.toml index 4813d45926611ececa7264bc90a6491a7e956cfd..b8e0a7ab65781551cf6f0d094068b387e14637ed 100644 --- a/tasks/0084_523_84523209_qa_5/task.toml +++ b/tasks/0084_523_84523209_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_536_84536587_qa_1/environment/bootstrap.sh b/tasks/0084_536_84536587_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_536_84536587_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_536_84536587_qa_1/environment/pull_bucket.py b/tasks/0084_536_84536587_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_536_84536587_qa_1/environment/pull_bucket.py +++ b/tasks/0084_536_84536587_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_536_84536587_qa_1/task.toml b/tasks/0084_536_84536587_qa_1/task.toml index 738260d957f50402f756a209f510ceab1cb19c58..7f59adf59371cae95ca6a43d9ea2255e4dbf70a9 100644 --- a/tasks/0084_536_84536587_qa_1/task.toml +++ b/tasks/0084_536_84536587_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_634_84634252_qa_2/environment/bootstrap.sh b/tasks/0084_634_84634252_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_634_84634252_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_634_84634252_qa_2/environment/pull_bucket.py b/tasks/0084_634_84634252_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_634_84634252_qa_2/environment/pull_bucket.py +++ b/tasks/0084_634_84634252_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_634_84634252_qa_2/task.toml b/tasks/0084_634_84634252_qa_2/task.toml index 7f4e7617f9b9e6ec80b1afbf1f1decef4f2c8401..fe2716e6650ccfef679b2ae328d7a7ad5a3f4194 100644 --- a/tasks/0084_634_84634252_qa_2/task.toml +++ b/tasks/0084_634_84634252_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_634_84634252_qa_4/environment/bootstrap.sh b/tasks/0084_634_84634252_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_634_84634252_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_634_84634252_qa_4/environment/pull_bucket.py b/tasks/0084_634_84634252_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_634_84634252_qa_4/environment/pull_bucket.py +++ b/tasks/0084_634_84634252_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_634_84634252_qa_4/task.toml b/tasks/0084_634_84634252_qa_4/task.toml index e98461557cab93e8568bc076bff59d38bad1aaf1..74d9eb75d72e7cf36f209b42c9904de997da81eb 100644 --- a/tasks/0084_634_84634252_qa_4/task.toml +++ b/tasks/0084_634_84634252_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_727_84727011_qa_2/environment/bootstrap.sh b/tasks/0084_727_84727011_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_727_84727011_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_727_84727011_qa_2/environment/pull_bucket.py b/tasks/0084_727_84727011_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_727_84727011_qa_2/environment/pull_bucket.py +++ b/tasks/0084_727_84727011_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_727_84727011_qa_2/task.toml b/tasks/0084_727_84727011_qa_2/task.toml index a8d94e6d39d43e6d7b2eb19b3c6142ef13d8343f..f7863188a55b9eb491fcf6fe3269751fe70e94db 100644 --- a/tasks/0084_727_84727011_qa_2/task.toml +++ b/tasks/0084_727_84727011_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_727_84727011_qa_5/environment/bootstrap.sh b/tasks/0084_727_84727011_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_727_84727011_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_727_84727011_qa_5/environment/pull_bucket.py b/tasks/0084_727_84727011_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_727_84727011_qa_5/environment/pull_bucket.py +++ b/tasks/0084_727_84727011_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_727_84727011_qa_5/task.toml b/tasks/0084_727_84727011_qa_5/task.toml index e375ff102a8fb8391e74b2a5412bc3e09b1f8468..872b605c2b7aeba6a88bf83617243690a02615d8 100644 --- a/tasks/0084_727_84727011_qa_5/task.toml +++ b/tasks/0084_727_84727011_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_727_84727795_qa_2/environment/bootstrap.sh b/tasks/0084_727_84727795_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_727_84727795_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_727_84727795_qa_2/environment/pull_bucket.py b/tasks/0084_727_84727795_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_727_84727795_qa_2/environment/pull_bucket.py +++ b/tasks/0084_727_84727795_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_727_84727795_qa_2/task.toml b/tasks/0084_727_84727795_qa_2/task.toml index 2ab71e916de2e60b151076077d2235e01c0b6ac3..1e4cc1849ff17e395f4ba1d25077ec48e65a39ef 100644 --- a/tasks/0084_727_84727795_qa_2/task.toml +++ b/tasks/0084_727_84727795_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_727_84727795_qa_4/environment/bootstrap.sh b/tasks/0084_727_84727795_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_727_84727795_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_727_84727795_qa_4/environment/pull_bucket.py b/tasks/0084_727_84727795_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_727_84727795_qa_4/environment/pull_bucket.py +++ b/tasks/0084_727_84727795_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_727_84727795_qa_4/task.toml b/tasks/0084_727_84727795_qa_4/task.toml index 7ac3327bb7053a007b5346598c9dc932fa2b2d0e..01257d439700847c6031c12c7ccbfc404eb5dad0 100644 --- a/tasks/0084_727_84727795_qa_4/task.toml +++ b/tasks/0084_727_84727795_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_727_84727795_qa_5/environment/bootstrap.sh b/tasks/0084_727_84727795_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_727_84727795_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_727_84727795_qa_5/environment/pull_bucket.py b/tasks/0084_727_84727795_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_727_84727795_qa_5/environment/pull_bucket.py +++ b/tasks/0084_727_84727795_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_727_84727795_qa_5/task.toml b/tasks/0084_727_84727795_qa_5/task.toml index e3ec7c408d97dd95b9be98775210e945ddbf6ee7..03d657bd14a6548d1fb53722d52039246c3f06c1 100644 --- a/tasks/0084_727_84727795_qa_5/task.toml +++ b/tasks/0084_727_84727795_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_737_84737869_qa_2/environment/bootstrap.sh b/tasks/0084_737_84737869_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_737_84737869_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_737_84737869_qa_2/environment/pull_bucket.py b/tasks/0084_737_84737869_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_737_84737869_qa_2/environment/pull_bucket.py +++ b/tasks/0084_737_84737869_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_737_84737869_qa_2/task.toml b/tasks/0084_737_84737869_qa_2/task.toml index 4b9f3fbd1863af1a7a7e66b1dea2b1c371861d54..7104a0b83accc1c06f5ad19eaa8c8ab6095cdb22 100644 --- a/tasks/0084_737_84737869_qa_2/task.toml +++ b/tasks/0084_737_84737869_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_737_84737869_qa_3/environment/bootstrap.sh b/tasks/0084_737_84737869_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_737_84737869_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_737_84737869_qa_3/environment/pull_bucket.py b/tasks/0084_737_84737869_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_737_84737869_qa_3/environment/pull_bucket.py +++ b/tasks/0084_737_84737869_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_737_84737869_qa_3/task.toml b/tasks/0084_737_84737869_qa_3/task.toml index 6b2ed04eec9216c869ffa175b7173b038054d14a..05e6f208b356732fe38e5f43a5b6b62435a7c71b 100644 --- a/tasks/0084_737_84737869_qa_3/task.toml +++ b/tasks/0084_737_84737869_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_747_84747621_qa_5/environment/bootstrap.sh b/tasks/0084_747_84747621_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_747_84747621_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_747_84747621_qa_5/environment/pull_bucket.py b/tasks/0084_747_84747621_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_747_84747621_qa_5/environment/pull_bucket.py +++ b/tasks/0084_747_84747621_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_747_84747621_qa_5/task.toml b/tasks/0084_747_84747621_qa_5/task.toml index 5cb59247668dec13f9e4258520a452a43ba21727..0630550a2d13ad0171deabdee0063f3b3b5b7b74 100644 --- a/tasks/0084_747_84747621_qa_5/task.toml +++ b/tasks/0084_747_84747621_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_772_84772070_qa_5/environment/bootstrap.sh b/tasks/0084_772_84772070_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_772_84772070_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_772_84772070_qa_5/environment/pull_bucket.py b/tasks/0084_772_84772070_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_772_84772070_qa_5/environment/pull_bucket.py +++ b/tasks/0084_772_84772070_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_772_84772070_qa_5/task.toml b/tasks/0084_772_84772070_qa_5/task.toml index b91f3875689fa02161622bce3c624e028409c9a5..98adf64b988c31bf21ea20309d147a71107b828b 100644 --- a/tasks/0084_772_84772070_qa_5/task.toml +++ b/tasks/0084_772_84772070_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_821_84821146_qa_1/environment/bootstrap.sh b/tasks/0084_821_84821146_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_821_84821146_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_821_84821146_qa_1/environment/pull_bucket.py b/tasks/0084_821_84821146_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_821_84821146_qa_1/environment/pull_bucket.py +++ b/tasks/0084_821_84821146_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_821_84821146_qa_1/task.toml b/tasks/0084_821_84821146_qa_1/task.toml index 080e327552e69ffd90fd7afed5178379dfe1bda2..3ac10cc600e2ce9216d9d4741391c5ab1e57f7e1 100644 --- a/tasks/0084_821_84821146_qa_1/task.toml +++ b/tasks/0084_821_84821146_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_827_84827302_qa_2/environment/bootstrap.sh b/tasks/0084_827_84827302_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_827_84827302_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_827_84827302_qa_2/environment/pull_bucket.py b/tasks/0084_827_84827302_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_827_84827302_qa_2/environment/pull_bucket.py +++ b/tasks/0084_827_84827302_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_827_84827302_qa_2/task.toml b/tasks/0084_827_84827302_qa_2/task.toml index ec5839fa990e4b432963537313964c2ddd5a187c..752fe4e008e52cc98fc4e36f3be1bbe205f58087 100644 --- a/tasks/0084_827_84827302_qa_2/task.toml +++ b/tasks/0084_827_84827302_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_834_84834261_qa_3/environment/bootstrap.sh b/tasks/0084_834_84834261_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_834_84834261_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_834_84834261_qa_3/environment/pull_bucket.py b/tasks/0084_834_84834261_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_834_84834261_qa_3/environment/pull_bucket.py +++ b/tasks/0084_834_84834261_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_834_84834261_qa_3/task.toml b/tasks/0084_834_84834261_qa_3/task.toml index d94891a4c06990c42a862a857ac8480d57de016f..4069d7c6cdf301bda1d0d5369cd1ff5fc48c4923 100644 --- a/tasks/0084_834_84834261_qa_3/task.toml +++ b/tasks/0084_834_84834261_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_834_84834261_qa_4/environment/bootstrap.sh b/tasks/0084_834_84834261_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_834_84834261_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_834_84834261_qa_4/environment/pull_bucket.py b/tasks/0084_834_84834261_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_834_84834261_qa_4/environment/pull_bucket.py +++ b/tasks/0084_834_84834261_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_834_84834261_qa_4/task.toml b/tasks/0084_834_84834261_qa_4/task.toml index ed412e9c8a7ca1ff512ac4d2185f7af50c301bb5..c4d39eda5dba042a5ac9c39df83d44a4e932df0a 100644 --- a/tasks/0084_834_84834261_qa_4/task.toml +++ b/tasks/0084_834_84834261_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_843_84843553_qa_3/environment/bootstrap.sh b/tasks/0084_843_84843553_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_843_84843553_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_843_84843553_qa_3/environment/pull_bucket.py b/tasks/0084_843_84843553_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_843_84843553_qa_3/environment/pull_bucket.py +++ b/tasks/0084_843_84843553_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_843_84843553_qa_3/task.toml b/tasks/0084_843_84843553_qa_3/task.toml index d99289b2f8d76ee3a8114964e381dbe2b13d40ca..3535094fbca0375e28db348af6737396c434cc99 100644 --- a/tasks/0084_843_84843553_qa_3/task.toml +++ b/tasks/0084_843_84843553_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_900_84900004_qa_1/environment/bootstrap.sh b/tasks/0084_900_84900004_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_900_84900004_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_900_84900004_qa_1/environment/pull_bucket.py b/tasks/0084_900_84900004_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_900_84900004_qa_1/environment/pull_bucket.py +++ b/tasks/0084_900_84900004_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_900_84900004_qa_1/task.toml b/tasks/0084_900_84900004_qa_1/task.toml index db8c9b507c90d35a5443491f6e31e3959672912e..ad6d799b588e6a870a32dd5a2fa038bd81b8ec0c 100644 --- a/tasks/0084_900_84900004_qa_1/task.toml +++ b/tasks/0084_900_84900004_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_932_84932987_qa_5/environment/bootstrap.sh b/tasks/0084_932_84932987_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_932_84932987_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_932_84932987_qa_5/environment/pull_bucket.py b/tasks/0084_932_84932987_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_932_84932987_qa_5/environment/pull_bucket.py +++ b/tasks/0084_932_84932987_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_932_84932987_qa_5/task.toml b/tasks/0084_932_84932987_qa_5/task.toml index 1259f79bf20216faedf1774abe3bc931c73a9fb0..29858fb653a9429f69a52b3c92c76b5df2210e4a 100644 --- a/tasks/0084_932_84932987_qa_5/task.toml +++ b/tasks/0084_932_84932987_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_953_84953718_qa_1/environment/bootstrap.sh b/tasks/0084_953_84953718_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_953_84953718_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_953_84953718_qa_1/environment/pull_bucket.py b/tasks/0084_953_84953718_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_953_84953718_qa_1/environment/pull_bucket.py +++ b/tasks/0084_953_84953718_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_953_84953718_qa_1/task.toml b/tasks/0084_953_84953718_qa_1/task.toml index f5c527ec83f656dd526188d2f18fc85c92bd0703..9e4e75a151ab46349c2e4728e7e7fed9d692f1f0 100644 --- a/tasks/0084_953_84953718_qa_1/task.toml +++ b/tasks/0084_953_84953718_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_964_84964347_qa_1/environment/bootstrap.sh b/tasks/0084_964_84964347_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_964_84964347_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_964_84964347_qa_1/environment/pull_bucket.py b/tasks/0084_964_84964347_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_964_84964347_qa_1/environment/pull_bucket.py +++ b/tasks/0084_964_84964347_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_964_84964347_qa_1/task.toml b/tasks/0084_964_84964347_qa_1/task.toml index 3898fee7adb0870aa5c4540d49e2a76265e19c02..1f9cb8c486beb0e17a6891984b203dc84108de66 100644 --- a/tasks/0084_964_84964347_qa_1/task.toml +++ b/tasks/0084_964_84964347_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_977_84977670_qa_3/environment/bootstrap.sh b/tasks/0084_977_84977670_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_977_84977670_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_977_84977670_qa_3/environment/pull_bucket.py b/tasks/0084_977_84977670_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_977_84977670_qa_3/environment/pull_bucket.py +++ b/tasks/0084_977_84977670_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_977_84977670_qa_3/task.toml b/tasks/0084_977_84977670_qa_3/task.toml index 4a431e0f04acd09a3f975292640b9c91ebee43cf..af31c6a27fb6fd48fbde8291d303f4f0986bf5ef 100644 --- a/tasks/0084_977_84977670_qa_3/task.toml +++ b/tasks/0084_977_84977670_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_979_84979426_qa_5/environment/bootstrap.sh b/tasks/0084_979_84979426_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_979_84979426_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_979_84979426_qa_5/environment/pull_bucket.py b/tasks/0084_979_84979426_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_979_84979426_qa_5/environment/pull_bucket.py +++ b/tasks/0084_979_84979426_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_979_84979426_qa_5/task.toml b/tasks/0084_979_84979426_qa_5/task.toml index 7d6749b64f82c5dfa2c07cf8a8934f94c5a8cc39..0a579aceb1d6b5ebe335846a44707e00d54615bf 100644 --- a/tasks/0084_979_84979426_qa_5/task.toml +++ b/tasks/0084_979_84979426_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_981_84981806_qa_1/environment/bootstrap.sh b/tasks/0084_981_84981806_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_981_84981806_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_981_84981806_qa_1/environment/pull_bucket.py b/tasks/0084_981_84981806_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_981_84981806_qa_1/environment/pull_bucket.py +++ b/tasks/0084_981_84981806_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_981_84981806_qa_1/task.toml b/tasks/0084_981_84981806_qa_1/task.toml index f41764a1ed834f223a60655e917d655f404158ad..0bea53731e9ddb3830a55a07a4aadcd3e0b80396 100644 --- a/tasks/0084_981_84981806_qa_1/task.toml +++ b/tasks/0084_981_84981806_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_985_84985340_qa_2/environment/bootstrap.sh b/tasks/0084_985_84985340_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_985_84985340_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_985_84985340_qa_2/environment/pull_bucket.py b/tasks/0084_985_84985340_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_985_84985340_qa_2/environment/pull_bucket.py +++ b/tasks/0084_985_84985340_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_985_84985340_qa_2/task.toml b/tasks/0084_985_84985340_qa_2/task.toml index 9e03c0bb736ca39823c973311f9239de8c8db71f..93164894afdd6106ab88eac72af172bb25516343 100644 --- a/tasks/0084_985_84985340_qa_2/task.toml +++ b/tasks/0084_985_84985340_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0084_985_84985340_qa_4/environment/bootstrap.sh b/tasks/0084_985_84985340_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0084_985_84985340_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0084_985_84985340_qa_4/environment/pull_bucket.py b/tasks/0084_985_84985340_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0084_985_84985340_qa_4/environment/pull_bucket.py +++ b/tasks/0084_985_84985340_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0084_985_84985340_qa_4/task.toml b/tasks/0084_985_84985340_qa_4/task.toml index 40673422fa08a42729b4637e49cd89b295b3ce33..1eeb5be0e21ef1862da51fa8e9a87f914e72b4df 100644 --- a/tasks/0084_985_84985340_qa_4/task.toml +++ b/tasks/0084_985_84985340_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_130_85130981_qa_2/environment/bootstrap.sh b/tasks/0085_130_85130981_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_130_85130981_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_130_85130981_qa_2/environment/pull_bucket.py b/tasks/0085_130_85130981_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_130_85130981_qa_2/environment/pull_bucket.py +++ b/tasks/0085_130_85130981_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_130_85130981_qa_2/task.toml b/tasks/0085_130_85130981_qa_2/task.toml index aa30ac7da0c4966be47869844bfa01587e38a4b7..ac7053f30cf9a7b8047b9805ce1ace2ae7c73b24 100644 --- a/tasks/0085_130_85130981_qa_2/task.toml +++ b/tasks/0085_130_85130981_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_130_85130981_qa_4/environment/bootstrap.sh b/tasks/0085_130_85130981_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_130_85130981_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_130_85130981_qa_4/environment/pull_bucket.py b/tasks/0085_130_85130981_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_130_85130981_qa_4/environment/pull_bucket.py +++ b/tasks/0085_130_85130981_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_130_85130981_qa_4/task.toml b/tasks/0085_130_85130981_qa_4/task.toml index 25a4b2e1227a1922b4bb8e14d22e89685a945ad0..96dd3a7976c7e9424bc44f622764c51b360a998c 100644 --- a/tasks/0085_130_85130981_qa_4/task.toml +++ b/tasks/0085_130_85130981_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_151_85151836_qa_1/environment/bootstrap.sh b/tasks/0085_151_85151836_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_151_85151836_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_151_85151836_qa_1/environment/pull_bucket.py b/tasks/0085_151_85151836_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_151_85151836_qa_1/environment/pull_bucket.py +++ b/tasks/0085_151_85151836_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_151_85151836_qa_1/task.toml b/tasks/0085_151_85151836_qa_1/task.toml index 831ffc6ac7ed1c5510a1551ea4abdaf0c19df62a..96dd0e05d38f7f80710153a18b51ebe0733a71dc 100644 --- a/tasks/0085_151_85151836_qa_1/task.toml +++ b/tasks/0085_151_85151836_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_154_85154775_qa_2/environment/bootstrap.sh b/tasks/0085_154_85154775_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_154_85154775_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_154_85154775_qa_2/environment/pull_bucket.py b/tasks/0085_154_85154775_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_154_85154775_qa_2/environment/pull_bucket.py +++ b/tasks/0085_154_85154775_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_154_85154775_qa_2/task.toml b/tasks/0085_154_85154775_qa_2/task.toml index 18fbf29ea0bbdde8163d7e02361deef0d83ce685..cb1976fca9c1c26f450e265d67b4f167cb6b4e39 100644 --- a/tasks/0085_154_85154775_qa_2/task.toml +++ b/tasks/0085_154_85154775_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_154_85154775_qa_3/environment/bootstrap.sh b/tasks/0085_154_85154775_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_154_85154775_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_154_85154775_qa_3/environment/pull_bucket.py b/tasks/0085_154_85154775_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_154_85154775_qa_3/environment/pull_bucket.py +++ b/tasks/0085_154_85154775_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_154_85154775_qa_3/task.toml b/tasks/0085_154_85154775_qa_3/task.toml index 53a5be304b80e762161851479ee37ad978c71238..19806ed0de3cace5715efe6524ffc0d689d82c05 100644 --- a/tasks/0085_154_85154775_qa_3/task.toml +++ b/tasks/0085_154_85154775_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_154_85154775_qa_5/environment/bootstrap.sh b/tasks/0085_154_85154775_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_154_85154775_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_154_85154775_qa_5/environment/pull_bucket.py b/tasks/0085_154_85154775_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_154_85154775_qa_5/environment/pull_bucket.py +++ b/tasks/0085_154_85154775_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_154_85154775_qa_5/task.toml b/tasks/0085_154_85154775_qa_5/task.toml index cbd8a665c1cfec90fb89dfb54d235f39d91e51b6..8c0e1866c20330aaa3797c8fa03bef0d777ef652 100644 --- a/tasks/0085_154_85154775_qa_5/task.toml +++ b/tasks/0085_154_85154775_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_167_85167417_qa_2/environment/bootstrap.sh b/tasks/0085_167_85167417_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_167_85167417_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_167_85167417_qa_2/environment/pull_bucket.py b/tasks/0085_167_85167417_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_167_85167417_qa_2/environment/pull_bucket.py +++ b/tasks/0085_167_85167417_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_167_85167417_qa_2/task.toml b/tasks/0085_167_85167417_qa_2/task.toml index 945586a9b8669453892a622889a05616103908df..01600bcc907e639ef93498b81d98f4d1d45e4515 100644 --- a/tasks/0085_167_85167417_qa_2/task.toml +++ b/tasks/0085_167_85167417_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_232_85232231_qa_3/environment/bootstrap.sh b/tasks/0085_232_85232231_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_232_85232231_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_232_85232231_qa_3/environment/pull_bucket.py b/tasks/0085_232_85232231_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_232_85232231_qa_3/environment/pull_bucket.py +++ b/tasks/0085_232_85232231_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_232_85232231_qa_3/task.toml b/tasks/0085_232_85232231_qa_3/task.toml index 72622cc04a186cb55a639761db91d4eb843f31cc..1ed44f919ff9239a4dcc48729a06d6fc6f6433c3 100644 --- a/tasks/0085_232_85232231_qa_3/task.toml +++ b/tasks/0085_232_85232231_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_240_85240003_qa_3/environment/bootstrap.sh b/tasks/0085_240_85240003_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_240_85240003_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_240_85240003_qa_3/environment/pull_bucket.py b/tasks/0085_240_85240003_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_240_85240003_qa_3/environment/pull_bucket.py +++ b/tasks/0085_240_85240003_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_240_85240003_qa_3/task.toml b/tasks/0085_240_85240003_qa_3/task.toml index 8ce9e31d3056b43a726ce6d1787dbf714c00b77e..9f01483b1e919a5cf09901900b8b4ce46b066721 100644 --- a/tasks/0085_240_85240003_qa_3/task.toml +++ b/tasks/0085_240_85240003_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_243_85243443_qa_1/environment/bootstrap.sh b/tasks/0085_243_85243443_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_243_85243443_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_243_85243443_qa_1/environment/pull_bucket.py b/tasks/0085_243_85243443_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_243_85243443_qa_1/environment/pull_bucket.py +++ b/tasks/0085_243_85243443_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_243_85243443_qa_1/task.toml b/tasks/0085_243_85243443_qa_1/task.toml index fa5603478cdf0d822522cef7e90dc45ddb9e27f8..f2005e0dda89420d08bde274fdfd1b9459f725e8 100644 --- a/tasks/0085_243_85243443_qa_1/task.toml +++ b/tasks/0085_243_85243443_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_309_85309051_qa_1/environment/bootstrap.sh b/tasks/0085_309_85309051_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_309_85309051_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_309_85309051_qa_1/environment/pull_bucket.py b/tasks/0085_309_85309051_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_309_85309051_qa_1/environment/pull_bucket.py +++ b/tasks/0085_309_85309051_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_309_85309051_qa_1/task.toml b/tasks/0085_309_85309051_qa_1/task.toml index 3f79058cad55a61a9c593492b002c6aa23a70d57..562935ededa7f7f43f47f29cad862bbcbad8a636 100644 --- a/tasks/0085_309_85309051_qa_1/task.toml +++ b/tasks/0085_309_85309051_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_343_85343577_qa_3/environment/bootstrap.sh b/tasks/0085_343_85343577_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_343_85343577_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_343_85343577_qa_3/environment/pull_bucket.py b/tasks/0085_343_85343577_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_343_85343577_qa_3/environment/pull_bucket.py +++ b/tasks/0085_343_85343577_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_343_85343577_qa_3/task.toml b/tasks/0085_343_85343577_qa_3/task.toml index 73209ca250d9e4c4088cbb7dd1302afcaa248ed4..861307ba7fa75b846f7ba660e5120c8d63c571fc 100644 --- a/tasks/0085_343_85343577_qa_3/task.toml +++ b/tasks/0085_343_85343577_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_343_85343577_qa_5/environment/bootstrap.sh b/tasks/0085_343_85343577_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_343_85343577_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_343_85343577_qa_5/environment/pull_bucket.py b/tasks/0085_343_85343577_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_343_85343577_qa_5/environment/pull_bucket.py +++ b/tasks/0085_343_85343577_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_343_85343577_qa_5/task.toml b/tasks/0085_343_85343577_qa_5/task.toml index 8e6918d96529456841a36a52d9027e7ce5e11d33..2ecb890352303f5ebb39e7b34c9c0b0da4996d31 100644 --- a/tasks/0085_343_85343577_qa_5/task.toml +++ b/tasks/0085_343_85343577_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_359_85359585_qa_5/environment/bootstrap.sh b/tasks/0085_359_85359585_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_359_85359585_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_359_85359585_qa_5/environment/pull_bucket.py b/tasks/0085_359_85359585_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_359_85359585_qa_5/environment/pull_bucket.py +++ b/tasks/0085_359_85359585_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_359_85359585_qa_5/task.toml b/tasks/0085_359_85359585_qa_5/task.toml index 830d73722865db3d916d782304adae80880c7e99..5715e55208751c22524e3b3cbf60369ab969fb52 100644 --- a/tasks/0085_359_85359585_qa_5/task.toml +++ b/tasks/0085_359_85359585_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_373_85373330_qa_2/environment/bootstrap.sh b/tasks/0085_373_85373330_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_373_85373330_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_373_85373330_qa_2/environment/pull_bucket.py b/tasks/0085_373_85373330_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_373_85373330_qa_2/environment/pull_bucket.py +++ b/tasks/0085_373_85373330_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_373_85373330_qa_2/task.toml b/tasks/0085_373_85373330_qa_2/task.toml index dd96913a452de12d8e7d36aa4057534a57df6bc1..e9f740daf02ff64e1d84b3c1a122d8759816d9bf 100644 --- a/tasks/0085_373_85373330_qa_2/task.toml +++ b/tasks/0085_373_85373330_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_383_85383242_qa_5/environment/bootstrap.sh b/tasks/0085_383_85383242_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_383_85383242_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_383_85383242_qa_5/environment/pull_bucket.py b/tasks/0085_383_85383242_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_383_85383242_qa_5/environment/pull_bucket.py +++ b/tasks/0085_383_85383242_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_383_85383242_qa_5/task.toml b/tasks/0085_383_85383242_qa_5/task.toml index feb6493e6ab2a93853a10bbeeb86609fb0116fe2..2eeca4bbfca59f413d8da582352c4185a23c67fc 100644 --- a/tasks/0085_383_85383242_qa_5/task.toml +++ b/tasks/0085_383_85383242_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_451_85451661_qa_2/environment/bootstrap.sh b/tasks/0085_451_85451661_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_451_85451661_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_451_85451661_qa_2/environment/pull_bucket.py b/tasks/0085_451_85451661_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_451_85451661_qa_2/environment/pull_bucket.py +++ b/tasks/0085_451_85451661_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_451_85451661_qa_2/task.toml b/tasks/0085_451_85451661_qa_2/task.toml index a9dc4669356349e9583c6a50ad1b5c3be2661833..e68709adcdf8107ef28bd31058772ab7c302ea1e 100644 --- a/tasks/0085_451_85451661_qa_2/task.toml +++ b/tasks/0085_451_85451661_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_555_85555570_qa_4/environment/bootstrap.sh b/tasks/0085_555_85555570_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_555_85555570_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_555_85555570_qa_4/environment/pull_bucket.py b/tasks/0085_555_85555570_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_555_85555570_qa_4/environment/pull_bucket.py +++ b/tasks/0085_555_85555570_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_555_85555570_qa_4/task.toml b/tasks/0085_555_85555570_qa_4/task.toml index d3ced619fc55ca4ac2e0c9d78936586c9625e4fa..3e0d0105d6ee84e44f84df4d6d2d69de952f67b0 100644 --- a/tasks/0085_555_85555570_qa_4/task.toml +++ b/tasks/0085_555_85555570_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_583_85583016_qa_1/environment/bootstrap.sh b/tasks/0085_583_85583016_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_583_85583016_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_583_85583016_qa_1/environment/pull_bucket.py b/tasks/0085_583_85583016_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_583_85583016_qa_1/environment/pull_bucket.py +++ b/tasks/0085_583_85583016_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_583_85583016_qa_1/task.toml b/tasks/0085_583_85583016_qa_1/task.toml index 07cf894875c468aecccdd2075067b82f3bf86183..57006e5e2c0a01549567affacdf037d918a2aa85 100644 --- a/tasks/0085_583_85583016_qa_1/task.toml +++ b/tasks/0085_583_85583016_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_583_85583016_qa_5/environment/bootstrap.sh b/tasks/0085_583_85583016_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_583_85583016_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_583_85583016_qa_5/environment/pull_bucket.py b/tasks/0085_583_85583016_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_583_85583016_qa_5/environment/pull_bucket.py +++ b/tasks/0085_583_85583016_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_583_85583016_qa_5/task.toml b/tasks/0085_583_85583016_qa_5/task.toml index 3a1fc6cae6609dd40726d43df9609b8c2a1f7260..1c40633d1f220fa18da39f2427863275a617dc61 100644 --- a/tasks/0085_583_85583016_qa_5/task.toml +++ b/tasks/0085_583_85583016_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_618_85618243_qa_2/environment/bootstrap.sh b/tasks/0085_618_85618243_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_618_85618243_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_618_85618243_qa_2/environment/pull_bucket.py b/tasks/0085_618_85618243_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_618_85618243_qa_2/environment/pull_bucket.py +++ b/tasks/0085_618_85618243_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_618_85618243_qa_2/task.toml b/tasks/0085_618_85618243_qa_2/task.toml index 508fb6acfbaab622c3f9e8cc1fc1662a6ec944f8..1d7b6eb717bd72e66fe25436764162d6cf5aab9f 100644 --- a/tasks/0085_618_85618243_qa_2/task.toml +++ b/tasks/0085_618_85618243_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_678_85678308_qa_1/environment/bootstrap.sh b/tasks/0085_678_85678308_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_678_85678308_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_678_85678308_qa_1/environment/pull_bucket.py b/tasks/0085_678_85678308_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_678_85678308_qa_1/environment/pull_bucket.py +++ b/tasks/0085_678_85678308_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_678_85678308_qa_1/task.toml b/tasks/0085_678_85678308_qa_1/task.toml index e2226ca486990db26e13713e082a9456a5951943..01eb16ee4bb6f0fcff777076ca870a0abd3b21d9 100644 --- a/tasks/0085_678_85678308_qa_1/task.toml +++ b/tasks/0085_678_85678308_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_678_85678308_qa_2/environment/bootstrap.sh b/tasks/0085_678_85678308_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_678_85678308_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_678_85678308_qa_2/environment/pull_bucket.py b/tasks/0085_678_85678308_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_678_85678308_qa_2/environment/pull_bucket.py +++ b/tasks/0085_678_85678308_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_678_85678308_qa_2/task.toml b/tasks/0085_678_85678308_qa_2/task.toml index 8f610c9912608722b14afaeddafa91188aae9778..d65a7d74bf5e161906b251182f80c1ee4603123c 100644 --- a/tasks/0085_678_85678308_qa_2/task.toml +++ b/tasks/0085_678_85678308_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_687_85687102_qa_1/environment/bootstrap.sh b/tasks/0085_687_85687102_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_687_85687102_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_687_85687102_qa_1/environment/pull_bucket.py b/tasks/0085_687_85687102_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_687_85687102_qa_1/environment/pull_bucket.py +++ b/tasks/0085_687_85687102_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_687_85687102_qa_1/task.toml b/tasks/0085_687_85687102_qa_1/task.toml index 7eb059afe0af5ae433997ee2ee34538251c9c0f0..e92a14fe36ba3b49f226ddaf26cb9fd39d8ebcf0 100644 --- a/tasks/0085_687_85687102_qa_1/task.toml +++ b/tasks/0085_687_85687102_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_706_85706685_qa_2/environment/bootstrap.sh b/tasks/0085_706_85706685_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_706_85706685_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_706_85706685_qa_2/environment/pull_bucket.py b/tasks/0085_706_85706685_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_706_85706685_qa_2/environment/pull_bucket.py +++ b/tasks/0085_706_85706685_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_706_85706685_qa_2/task.toml b/tasks/0085_706_85706685_qa_2/task.toml index 87cec5669fde3986d0813737aafed0d0dc648c48..3671abb54ca51baf98b0786460a61d0a92d7cedf 100644 --- a/tasks/0085_706_85706685_qa_2/task.toml +++ b/tasks/0085_706_85706685_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_729_85729561_qa_4/environment/bootstrap.sh b/tasks/0085_729_85729561_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_729_85729561_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_729_85729561_qa_4/environment/pull_bucket.py b/tasks/0085_729_85729561_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_729_85729561_qa_4/environment/pull_bucket.py +++ b/tasks/0085_729_85729561_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_729_85729561_qa_4/task.toml b/tasks/0085_729_85729561_qa_4/task.toml index 5739f7eb550a500e7be75debf937af6fabab6f92..d51425093b6aba89315b7895de3a854d8d1c08cb 100644 --- a/tasks/0085_729_85729561_qa_4/task.toml +++ b/tasks/0085_729_85729561_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_729_85729561_qa_5/environment/bootstrap.sh b/tasks/0085_729_85729561_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_729_85729561_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_729_85729561_qa_5/environment/pull_bucket.py b/tasks/0085_729_85729561_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_729_85729561_qa_5/environment/pull_bucket.py +++ b/tasks/0085_729_85729561_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_729_85729561_qa_5/task.toml b/tasks/0085_729_85729561_qa_5/task.toml index ce01477a27e562f8f8c0b7db1c2da37a490a77df..702195efef27fc5e1c1660780ae70ec11b78421e 100644 --- a/tasks/0085_729_85729561_qa_5/task.toml +++ b/tasks/0085_729_85729561_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_734_85734545_qa_1/environment/bootstrap.sh b/tasks/0085_734_85734545_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_734_85734545_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_734_85734545_qa_1/environment/pull_bucket.py b/tasks/0085_734_85734545_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_734_85734545_qa_1/environment/pull_bucket.py +++ b/tasks/0085_734_85734545_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_734_85734545_qa_1/task.toml b/tasks/0085_734_85734545_qa_1/task.toml index b7d32f5497306d6afd6640636a96b772aed12212..25da593c719bc40919a8634400ed4978f0cd497e 100644 --- a/tasks/0085_734_85734545_qa_1/task.toml +++ b/tasks/0085_734_85734545_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_736_85736582_qa_4/environment/bootstrap.sh b/tasks/0085_736_85736582_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_736_85736582_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_736_85736582_qa_4/environment/pull_bucket.py b/tasks/0085_736_85736582_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_736_85736582_qa_4/environment/pull_bucket.py +++ b/tasks/0085_736_85736582_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_736_85736582_qa_4/task.toml b/tasks/0085_736_85736582_qa_4/task.toml index f26eae7060300fd338df21e9b5796305c02767df..075a5a34df10c75456466db94b0ed127c1f83fb0 100644 --- a/tasks/0085_736_85736582_qa_4/task.toml +++ b/tasks/0085_736_85736582_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_736_85736582_qa_5/environment/bootstrap.sh b/tasks/0085_736_85736582_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_736_85736582_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_736_85736582_qa_5/environment/pull_bucket.py b/tasks/0085_736_85736582_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_736_85736582_qa_5/environment/pull_bucket.py +++ b/tasks/0085_736_85736582_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_736_85736582_qa_5/task.toml b/tasks/0085_736_85736582_qa_5/task.toml index b99495275d61a521c85ee17acf8495c78a46a8d6..9cfdf951390746093654d6800668eeb46e81b1da 100644 --- a/tasks/0085_736_85736582_qa_5/task.toml +++ b/tasks/0085_736_85736582_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_741_85741385_qa_1/environment/bootstrap.sh b/tasks/0085_741_85741385_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_741_85741385_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_741_85741385_qa_1/environment/pull_bucket.py b/tasks/0085_741_85741385_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_741_85741385_qa_1/environment/pull_bucket.py +++ b/tasks/0085_741_85741385_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_741_85741385_qa_1/task.toml b/tasks/0085_741_85741385_qa_1/task.toml index 50d8b4a32d3c83f01fec315370e9e799da102b4f..25e0e6f56c671fdd4341746d217c89a2d2739cd5 100644 --- a/tasks/0085_741_85741385_qa_1/task.toml +++ b/tasks/0085_741_85741385_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_750_85750552_qa_2/environment/bootstrap.sh b/tasks/0085_750_85750552_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_750_85750552_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_750_85750552_qa_2/environment/pull_bucket.py b/tasks/0085_750_85750552_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_750_85750552_qa_2/environment/pull_bucket.py +++ b/tasks/0085_750_85750552_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_750_85750552_qa_2/task.toml b/tasks/0085_750_85750552_qa_2/task.toml index 4e57d88d63c61271fa130f3434b268c84a083b2f..01fdbec5550160511fc731eab37605de670dab2e 100644 --- a/tasks/0085_750_85750552_qa_2/task.toml +++ b/tasks/0085_750_85750552_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_750_85750552_qa_4/environment/bootstrap.sh b/tasks/0085_750_85750552_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_750_85750552_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_750_85750552_qa_4/environment/pull_bucket.py b/tasks/0085_750_85750552_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_750_85750552_qa_4/environment/pull_bucket.py +++ b/tasks/0085_750_85750552_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_750_85750552_qa_4/task.toml b/tasks/0085_750_85750552_qa_4/task.toml index 8b4d5e15621540c4d4f018680c97fdfdd2b6b71a..945116d8035c7309205e20cf6a1d21f80a657a08 100644 --- a/tasks/0085_750_85750552_qa_4/task.toml +++ b/tasks/0085_750_85750552_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_804_85804318_qa_1/environment/bootstrap.sh b/tasks/0085_804_85804318_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_804_85804318_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_804_85804318_qa_1/environment/pull_bucket.py b/tasks/0085_804_85804318_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_804_85804318_qa_1/environment/pull_bucket.py +++ b/tasks/0085_804_85804318_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_804_85804318_qa_1/task.toml b/tasks/0085_804_85804318_qa_1/task.toml index 000303567efba006f5c662bb2e697a6e55588d7f..46e53759dcf936222e91e4c801a156f1f84787bc 100644 --- a/tasks/0085_804_85804318_qa_1/task.toml +++ b/tasks/0085_804_85804318_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_804_85804318_qa_2/environment/bootstrap.sh b/tasks/0085_804_85804318_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_804_85804318_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_804_85804318_qa_2/environment/pull_bucket.py b/tasks/0085_804_85804318_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_804_85804318_qa_2/environment/pull_bucket.py +++ b/tasks/0085_804_85804318_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_804_85804318_qa_2/task.toml b/tasks/0085_804_85804318_qa_2/task.toml index 9950525551f796cb6789ad985467e13ea38618ee..ed0e08303a91034ae08e099cc347c9cb89491476 100644 --- a/tasks/0085_804_85804318_qa_2/task.toml +++ b/tasks/0085_804_85804318_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_804_85804318_qa_3/environment/bootstrap.sh b/tasks/0085_804_85804318_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_804_85804318_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_804_85804318_qa_3/environment/pull_bucket.py b/tasks/0085_804_85804318_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_804_85804318_qa_3/environment/pull_bucket.py +++ b/tasks/0085_804_85804318_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_804_85804318_qa_3/task.toml b/tasks/0085_804_85804318_qa_3/task.toml index 7099331f25d3ffc729af2c348caf700ab5499776..827a4f5e226598ccd324d8be8e40dc16d5532ad6 100644 --- a/tasks/0085_804_85804318_qa_3/task.toml +++ b/tasks/0085_804_85804318_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_898_85898462_qa_1/environment/bootstrap.sh b/tasks/0085_898_85898462_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_898_85898462_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_898_85898462_qa_1/environment/pull_bucket.py b/tasks/0085_898_85898462_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_898_85898462_qa_1/environment/pull_bucket.py +++ b/tasks/0085_898_85898462_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_898_85898462_qa_1/task.toml b/tasks/0085_898_85898462_qa_1/task.toml index e736a981eccb60b3d4e323bc7d8b947836bfced8..1bf08041432b78a02da82314440de1d0cc362342 100644 --- a/tasks/0085_898_85898462_qa_1/task.toml +++ b/tasks/0085_898_85898462_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_903_85903531_qa_1/environment/bootstrap.sh b/tasks/0085_903_85903531_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_903_85903531_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_903_85903531_qa_1/environment/pull_bucket.py b/tasks/0085_903_85903531_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_903_85903531_qa_1/environment/pull_bucket.py +++ b/tasks/0085_903_85903531_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_903_85903531_qa_1/task.toml b/tasks/0085_903_85903531_qa_1/task.toml index 3ed236cbc7f7dbda0dd9c2e2a116cd4e47662100..295da378cf116b1f3436b1b226c19a5b0414c2f9 100644 --- a/tasks/0085_903_85903531_qa_1/task.toml +++ b/tasks/0085_903_85903531_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_903_85903605_qa_2/environment/bootstrap.sh b/tasks/0085_903_85903605_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_903_85903605_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_903_85903605_qa_2/environment/pull_bucket.py b/tasks/0085_903_85903605_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_903_85903605_qa_2/environment/pull_bucket.py +++ b/tasks/0085_903_85903605_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_903_85903605_qa_2/task.toml b/tasks/0085_903_85903605_qa_2/task.toml index 1508c654d4df3af1f02e4567dc4d388561ae4ae9..7954bece99015a4cd37d81f3eca58e45f4db13f2 100644 --- a/tasks/0085_903_85903605_qa_2/task.toml +++ b/tasks/0085_903_85903605_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_903_85903605_qa_3/environment/bootstrap.sh b/tasks/0085_903_85903605_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_903_85903605_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_903_85903605_qa_3/environment/pull_bucket.py b/tasks/0085_903_85903605_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_903_85903605_qa_3/environment/pull_bucket.py +++ b/tasks/0085_903_85903605_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_903_85903605_qa_3/task.toml b/tasks/0085_903_85903605_qa_3/task.toml index d4cae62c337182fdc6c526ad4848ac57e2f1e59e..244d8fe609cab11bb8a684c3bc60e109fe1845c0 100644 --- a/tasks/0085_903_85903605_qa_3/task.toml +++ b/tasks/0085_903_85903605_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_903_85903605_qa_5/environment/bootstrap.sh b/tasks/0085_903_85903605_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_903_85903605_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_903_85903605_qa_5/environment/pull_bucket.py b/tasks/0085_903_85903605_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_903_85903605_qa_5/environment/pull_bucket.py +++ b/tasks/0085_903_85903605_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_903_85903605_qa_5/task.toml b/tasks/0085_903_85903605_qa_5/task.toml index 9706a45b4c6b3b7ba44d268787b9817491d549cb..e3ac97d15b347a3305f6468abf322320843c1f6d 100644 --- a/tasks/0085_903_85903605_qa_5/task.toml +++ b/tasks/0085_903_85903605_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_952_85952796_qa_1/environment/bootstrap.sh b/tasks/0085_952_85952796_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_952_85952796_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_952_85952796_qa_1/environment/pull_bucket.py b/tasks/0085_952_85952796_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_952_85952796_qa_1/environment/pull_bucket.py +++ b/tasks/0085_952_85952796_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_952_85952796_qa_1/task.toml b/tasks/0085_952_85952796_qa_1/task.toml index 12df4bf7d3ebf04ead4cc16dfc984f76cd569b42..6ee8d5423cef6f55d44cb6ba303625c20623d583 100644 --- a/tasks/0085_952_85952796_qa_1/task.toml +++ b/tasks/0085_952_85952796_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_952_85952796_qa_2/environment/bootstrap.sh b/tasks/0085_952_85952796_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_952_85952796_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_952_85952796_qa_2/environment/pull_bucket.py b/tasks/0085_952_85952796_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_952_85952796_qa_2/environment/pull_bucket.py +++ b/tasks/0085_952_85952796_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_952_85952796_qa_2/task.toml b/tasks/0085_952_85952796_qa_2/task.toml index bddb2c05d1b8d80134c22f5156a9784eab5a7a5b..4a7d0a2b904dba404eb3f865e3ac5ee4897df4d8 100644 --- a/tasks/0085_952_85952796_qa_2/task.toml +++ b/tasks/0085_952_85952796_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0085_958_85958060_qa_1/environment/bootstrap.sh b/tasks/0085_958_85958060_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0085_958_85958060_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0085_958_85958060_qa_1/environment/pull_bucket.py b/tasks/0085_958_85958060_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0085_958_85958060_qa_1/environment/pull_bucket.py +++ b/tasks/0085_958_85958060_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0085_958_85958060_qa_1/task.toml b/tasks/0085_958_85958060_qa_1/task.toml index 8555f95d42f033560cf35ab7c45267a4eb6ab3e6..81ba232b316a38103b2ad1e59779b4f55e110687 100644 --- a/tasks/0085_958_85958060_qa_1/task.toml +++ b/tasks/0085_958_85958060_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_025_86025267_qa_5/environment/bootstrap.sh b/tasks/0086_025_86025267_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_025_86025267_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_025_86025267_qa_5/environment/pull_bucket.py b/tasks/0086_025_86025267_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_025_86025267_qa_5/environment/pull_bucket.py +++ b/tasks/0086_025_86025267_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_025_86025267_qa_5/task.toml b/tasks/0086_025_86025267_qa_5/task.toml index 61ad4557686bbd15062382aaf59db02bd666a299..db684db6873f9eff5b077cc736f21c885a691262 100644 --- a/tasks/0086_025_86025267_qa_5/task.toml +++ b/tasks/0086_025_86025267_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_057_86057959_qa_1/environment/bootstrap.sh b/tasks/0086_057_86057959_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_057_86057959_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_057_86057959_qa_1/environment/pull_bucket.py b/tasks/0086_057_86057959_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_057_86057959_qa_1/environment/pull_bucket.py +++ b/tasks/0086_057_86057959_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_057_86057959_qa_1/task.toml b/tasks/0086_057_86057959_qa_1/task.toml index 48ce50716a044477d65252b6fd3f769e54df45a6..c7109c3c5a2daa6a30dad0500931ad9bdafef982 100644 --- a/tasks/0086_057_86057959_qa_1/task.toml +++ b/tasks/0086_057_86057959_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_139_86139092_qa_4/environment/bootstrap.sh b/tasks/0086_139_86139092_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_139_86139092_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_139_86139092_qa_4/environment/pull_bucket.py b/tasks/0086_139_86139092_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_139_86139092_qa_4/environment/pull_bucket.py +++ b/tasks/0086_139_86139092_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_139_86139092_qa_4/task.toml b/tasks/0086_139_86139092_qa_4/task.toml index 2609c81492ebdc1467288ee138b737c9ed6aca34..118aabcf6d6329277a2d14748e5288106ca07d5a 100644 --- a/tasks/0086_139_86139092_qa_4/task.toml +++ b/tasks/0086_139_86139092_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_158_86158878_qa_4/environment/bootstrap.sh b/tasks/0086_158_86158878_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_158_86158878_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_158_86158878_qa_4/environment/pull_bucket.py b/tasks/0086_158_86158878_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_158_86158878_qa_4/environment/pull_bucket.py +++ b/tasks/0086_158_86158878_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_158_86158878_qa_4/task.toml b/tasks/0086_158_86158878_qa_4/task.toml index 34ab601cf5a3dd2c824c8a244a07fdb2830ec9ae..7af327318120a0fddee8b9692dbf9f4ee31d0ea5 100644 --- a/tasks/0086_158_86158878_qa_4/task.toml +++ b/tasks/0086_158_86158878_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_170_86170046_qa_3/environment/bootstrap.sh b/tasks/0086_170_86170046_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_170_86170046_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_170_86170046_qa_3/environment/pull_bucket.py b/tasks/0086_170_86170046_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_170_86170046_qa_3/environment/pull_bucket.py +++ b/tasks/0086_170_86170046_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_170_86170046_qa_3/task.toml b/tasks/0086_170_86170046_qa_3/task.toml index 936b82087b6274e6d8c895ce03f69f03ff7c1681..1e9e7f5d628944a5eae1306d4e9e8e0298ccd2b2 100644 --- a/tasks/0086_170_86170046_qa_3/task.toml +++ b/tasks/0086_170_86170046_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_173_86173099_qa_3/environment/bootstrap.sh b/tasks/0086_173_86173099_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_173_86173099_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_173_86173099_qa_3/environment/pull_bucket.py b/tasks/0086_173_86173099_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_173_86173099_qa_3/environment/pull_bucket.py +++ b/tasks/0086_173_86173099_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_173_86173099_qa_3/task.toml b/tasks/0086_173_86173099_qa_3/task.toml index 9a6f2637ea55cc51d8516c894a1f5e48d11bb556..306fa05e65b75f898887c74e0e59ec121d4e1874 100644 --- a/tasks/0086_173_86173099_qa_3/task.toml +++ b/tasks/0086_173_86173099_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_221_86221222_qa_1/environment/bootstrap.sh b/tasks/0086_221_86221222_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_221_86221222_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_221_86221222_qa_1/environment/pull_bucket.py b/tasks/0086_221_86221222_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_221_86221222_qa_1/environment/pull_bucket.py +++ b/tasks/0086_221_86221222_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_221_86221222_qa_1/task.toml b/tasks/0086_221_86221222_qa_1/task.toml index 630cd831ce935da65bfa15033f321320df0d2c7f..d4d6ea346c1d51ed600f8356143bb0f36152e9fe 100644 --- a/tasks/0086_221_86221222_qa_1/task.toml +++ b/tasks/0086_221_86221222_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_221_86221222_qa_3/environment/bootstrap.sh b/tasks/0086_221_86221222_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_221_86221222_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_221_86221222_qa_3/environment/pull_bucket.py b/tasks/0086_221_86221222_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_221_86221222_qa_3/environment/pull_bucket.py +++ b/tasks/0086_221_86221222_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_221_86221222_qa_3/task.toml b/tasks/0086_221_86221222_qa_3/task.toml index ee029a563e8a74986561cbba9aa08cc2fe2bc3b3..9ec78bb7719f970f675a8b197162642282ca2b19 100644 --- a/tasks/0086_221_86221222_qa_3/task.toml +++ b/tasks/0086_221_86221222_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_267_86267950_qa_4/environment/bootstrap.sh b/tasks/0086_267_86267950_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_267_86267950_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_267_86267950_qa_4/environment/pull_bucket.py b/tasks/0086_267_86267950_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_267_86267950_qa_4/environment/pull_bucket.py +++ b/tasks/0086_267_86267950_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_267_86267950_qa_4/task.toml b/tasks/0086_267_86267950_qa_4/task.toml index 57d243cf0b731177c1a8209d8c75c80dfb5d31a7..6c582ec00ad6a5bd26c7e629999cf15616be1e18 100644 --- a/tasks/0086_267_86267950_qa_4/task.toml +++ b/tasks/0086_267_86267950_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_271_86271835_qa_1/environment/bootstrap.sh b/tasks/0086_271_86271835_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_271_86271835_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_271_86271835_qa_1/environment/pull_bucket.py b/tasks/0086_271_86271835_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_271_86271835_qa_1/environment/pull_bucket.py +++ b/tasks/0086_271_86271835_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_271_86271835_qa_1/task.toml b/tasks/0086_271_86271835_qa_1/task.toml index 2d9b01b879cb85ea341481a00a2c41faa82eb014..2f0c0718607f80acf7e710f25258ea0a1f1e1d6b 100644 --- a/tasks/0086_271_86271835_qa_1/task.toml +++ b/tasks/0086_271_86271835_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_271_86271835_qa_2/environment/bootstrap.sh b/tasks/0086_271_86271835_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_271_86271835_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_271_86271835_qa_2/environment/pull_bucket.py b/tasks/0086_271_86271835_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_271_86271835_qa_2/environment/pull_bucket.py +++ b/tasks/0086_271_86271835_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_271_86271835_qa_2/task.toml b/tasks/0086_271_86271835_qa_2/task.toml index 98754d44e3519b159f366d041efdd23141dd7286..22629320a038d274fac474d86fa17ab34362511a 100644 --- a/tasks/0086_271_86271835_qa_2/task.toml +++ b/tasks/0086_271_86271835_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_358_86358959_qa_2/environment/bootstrap.sh b/tasks/0086_358_86358959_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_358_86358959_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_358_86358959_qa_2/environment/pull_bucket.py b/tasks/0086_358_86358959_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_358_86358959_qa_2/environment/pull_bucket.py +++ b/tasks/0086_358_86358959_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_358_86358959_qa_2/task.toml b/tasks/0086_358_86358959_qa_2/task.toml index cd0ad73fcea7b2960f923ead4ae1636fef12d09a..22fa3e44de32a56cb39cffb9d3109089b3e2bb11 100644 --- a/tasks/0086_358_86358959_qa_2/task.toml +++ b/tasks/0086_358_86358959_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_381_86381271_qa_1/environment/bootstrap.sh b/tasks/0086_381_86381271_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_381_86381271_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_381_86381271_qa_1/environment/pull_bucket.py b/tasks/0086_381_86381271_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_381_86381271_qa_1/environment/pull_bucket.py +++ b/tasks/0086_381_86381271_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_381_86381271_qa_1/task.toml b/tasks/0086_381_86381271_qa_1/task.toml index 43c8002a31ee58be3aba6b55818f64a6f23e1d8f..3371594fd40f9c8a0a6dd410c5bdb2043829a1f6 100644 --- a/tasks/0086_381_86381271_qa_1/task.toml +++ b/tasks/0086_381_86381271_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_400_86400737_qa_1/environment/bootstrap.sh b/tasks/0086_400_86400737_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_400_86400737_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_400_86400737_qa_1/environment/pull_bucket.py b/tasks/0086_400_86400737_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_400_86400737_qa_1/environment/pull_bucket.py +++ b/tasks/0086_400_86400737_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_400_86400737_qa_1/task.toml b/tasks/0086_400_86400737_qa_1/task.toml index e574c9c67cf47de41bd0779695874ab0061159fa..157951a4e311db6d76e250bc9aeac6ed57586ae7 100644 --- a/tasks/0086_400_86400737_qa_1/task.toml +++ b/tasks/0086_400_86400737_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_499_86499791_qa_5/environment/bootstrap.sh b/tasks/0086_499_86499791_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_499_86499791_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_499_86499791_qa_5/environment/pull_bucket.py b/tasks/0086_499_86499791_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_499_86499791_qa_5/environment/pull_bucket.py +++ b/tasks/0086_499_86499791_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_499_86499791_qa_5/task.toml b/tasks/0086_499_86499791_qa_5/task.toml index 7df67332f1b9f644d79635e313b4c2f4b6aa406e..ec28484c12f48291c338a4d06b181a19d391ac5c 100644 --- a/tasks/0086_499_86499791_qa_5/task.toml +++ b/tasks/0086_499_86499791_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_529_86529090_qa_1/environment/bootstrap.sh b/tasks/0086_529_86529090_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_529_86529090_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_529_86529090_qa_1/environment/pull_bucket.py b/tasks/0086_529_86529090_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_529_86529090_qa_1/environment/pull_bucket.py +++ b/tasks/0086_529_86529090_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_529_86529090_qa_1/task.toml b/tasks/0086_529_86529090_qa_1/task.toml index 73c5b36f98106b79c33a8c227d37ce023b9454b6..78711c4454ddba797c10d390f834253b68b07e9c 100644 --- a/tasks/0086_529_86529090_qa_1/task.toml +++ b/tasks/0086_529_86529090_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_529_86529090_qa_3/environment/bootstrap.sh b/tasks/0086_529_86529090_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_529_86529090_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_529_86529090_qa_3/environment/pull_bucket.py b/tasks/0086_529_86529090_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_529_86529090_qa_3/environment/pull_bucket.py +++ b/tasks/0086_529_86529090_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_529_86529090_qa_3/task.toml b/tasks/0086_529_86529090_qa_3/task.toml index b9f9332ebaccb1fed8f652fc62c67f60837f1b5e..e0a16d5e5d2e9ca5a3165f7d04959ad497db3015 100644 --- a/tasks/0086_529_86529090_qa_3/task.toml +++ b/tasks/0086_529_86529090_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_529_86529090_qa_5/environment/bootstrap.sh b/tasks/0086_529_86529090_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_529_86529090_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_529_86529090_qa_5/environment/pull_bucket.py b/tasks/0086_529_86529090_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_529_86529090_qa_5/environment/pull_bucket.py +++ b/tasks/0086_529_86529090_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_529_86529090_qa_5/task.toml b/tasks/0086_529_86529090_qa_5/task.toml index a5e4a32b9078527542b81988a3f9c29fbee29127..b962e7363c81d8dd69052fe3c2f8d02f22aed1d2 100644 --- a/tasks/0086_529_86529090_qa_5/task.toml +++ b/tasks/0086_529_86529090_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_531_86531254_qa_1/environment/bootstrap.sh b/tasks/0086_531_86531254_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_531_86531254_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_531_86531254_qa_1/environment/pull_bucket.py b/tasks/0086_531_86531254_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_531_86531254_qa_1/environment/pull_bucket.py +++ b/tasks/0086_531_86531254_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_531_86531254_qa_1/task.toml b/tasks/0086_531_86531254_qa_1/task.toml index 912a89759fd4daa8f251caa9c78d81b84c16d0de..e106bdbd369061e8310bd024eff729d98a45f4d1 100644 --- a/tasks/0086_531_86531254_qa_1/task.toml +++ b/tasks/0086_531_86531254_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_531_86531254_qa_3/environment/bootstrap.sh b/tasks/0086_531_86531254_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_531_86531254_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_531_86531254_qa_3/environment/pull_bucket.py b/tasks/0086_531_86531254_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_531_86531254_qa_3/environment/pull_bucket.py +++ b/tasks/0086_531_86531254_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_531_86531254_qa_3/task.toml b/tasks/0086_531_86531254_qa_3/task.toml index 6687b0f8ba69270f500e3ac143c3566920213e45..7d9c502838e39578a962bfa10f193b71f97e186f 100644 --- a/tasks/0086_531_86531254_qa_3/task.toml +++ b/tasks/0086_531_86531254_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_531_86531254_qa_5/environment/bootstrap.sh b/tasks/0086_531_86531254_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_531_86531254_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_531_86531254_qa_5/environment/pull_bucket.py b/tasks/0086_531_86531254_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_531_86531254_qa_5/environment/pull_bucket.py +++ b/tasks/0086_531_86531254_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_531_86531254_qa_5/task.toml b/tasks/0086_531_86531254_qa_5/task.toml index fc99a2c3f195e649f076eac2856b298c283e29d2..c30e33ae0d13f6b624725b0e098adce583203bb0 100644 --- a/tasks/0086_531_86531254_qa_5/task.toml +++ b/tasks/0086_531_86531254_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_608_86608703_qa_3/environment/bootstrap.sh b/tasks/0086_608_86608703_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_608_86608703_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_608_86608703_qa_3/environment/pull_bucket.py b/tasks/0086_608_86608703_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_608_86608703_qa_3/environment/pull_bucket.py +++ b/tasks/0086_608_86608703_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_608_86608703_qa_3/task.toml b/tasks/0086_608_86608703_qa_3/task.toml index 6ad31d8bd95d83014e23770b8738808b3ac0c34b..9b59e1b6e6ce43e7a7fd8326b2fb3ab4591e4d8d 100644 --- a/tasks/0086_608_86608703_qa_3/task.toml +++ b/tasks/0086_608_86608703_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_608_86608703_qa_4/environment/bootstrap.sh b/tasks/0086_608_86608703_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_608_86608703_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_608_86608703_qa_4/environment/pull_bucket.py b/tasks/0086_608_86608703_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_608_86608703_qa_4/environment/pull_bucket.py +++ b/tasks/0086_608_86608703_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_608_86608703_qa_4/task.toml b/tasks/0086_608_86608703_qa_4/task.toml index 0dbe58e88301a5d27dc422cc4de7f2ebeeb6181a..afc5d4ef6629f56e9a23722c3605e9a2013095aa 100644 --- a/tasks/0086_608_86608703_qa_4/task.toml +++ b/tasks/0086_608_86608703_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_644_86644069_qa_3/environment/bootstrap.sh b/tasks/0086_644_86644069_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_644_86644069_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_644_86644069_qa_3/environment/pull_bucket.py b/tasks/0086_644_86644069_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_644_86644069_qa_3/environment/pull_bucket.py +++ b/tasks/0086_644_86644069_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_644_86644069_qa_3/task.toml b/tasks/0086_644_86644069_qa_3/task.toml index 55f170c8397f4808706141ee896aa86776b8c41e..94f0fecec782bc33a886a4bf851e0cacc4e21527 100644 --- a/tasks/0086_644_86644069_qa_3/task.toml +++ b/tasks/0086_644_86644069_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_817_86817986_qa_4/environment/bootstrap.sh b/tasks/0086_817_86817986_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_817_86817986_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_817_86817986_qa_4/environment/pull_bucket.py b/tasks/0086_817_86817986_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_817_86817986_qa_4/environment/pull_bucket.py +++ b/tasks/0086_817_86817986_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_817_86817986_qa_4/task.toml b/tasks/0086_817_86817986_qa_4/task.toml index 42d20161bd3d48f53f7fb06d9acda6270efe7d17..c149b6a651cd3190aec1598a94a2be312aaafa9f 100644 --- a/tasks/0086_817_86817986_qa_4/task.toml +++ b/tasks/0086_817_86817986_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_821_86821577_qa_3/environment/bootstrap.sh b/tasks/0086_821_86821577_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_821_86821577_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_821_86821577_qa_3/environment/pull_bucket.py b/tasks/0086_821_86821577_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_821_86821577_qa_3/environment/pull_bucket.py +++ b/tasks/0086_821_86821577_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_821_86821577_qa_3/task.toml b/tasks/0086_821_86821577_qa_3/task.toml index 0f3bb597ee1d1d8ade736b7047d3a1d426710779..3142e31c9c3231506b68c21ed0eab3d1f579e446 100644 --- a/tasks/0086_821_86821577_qa_3/task.toml +++ b/tasks/0086_821_86821577_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_824_86824902_qa_2/environment/bootstrap.sh b/tasks/0086_824_86824902_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_824_86824902_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_824_86824902_qa_2/environment/pull_bucket.py b/tasks/0086_824_86824902_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_824_86824902_qa_2/environment/pull_bucket.py +++ b/tasks/0086_824_86824902_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_824_86824902_qa_2/task.toml b/tasks/0086_824_86824902_qa_2/task.toml index 81e6770bdc113b483e8f967aed3b9b10eb6ced4f..504b152c12e4e9b214c2024949893676ec1f7c8a 100644 --- a/tasks/0086_824_86824902_qa_2/task.toml +++ b/tasks/0086_824_86824902_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0086_933_86933978_qa_2/environment/bootstrap.sh b/tasks/0086_933_86933978_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0086_933_86933978_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0086_933_86933978_qa_2/environment/pull_bucket.py b/tasks/0086_933_86933978_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0086_933_86933978_qa_2/environment/pull_bucket.py +++ b/tasks/0086_933_86933978_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0086_933_86933978_qa_2/task.toml b/tasks/0086_933_86933978_qa_2/task.toml index e37f61910b2c34d25fbf849c9bcaad5195bd1680..fd0b8906145f24bfbe61ff893180581ce8025acc 100644 --- a/tasks/0086_933_86933978_qa_2/task.toml +++ b/tasks/0086_933_86933978_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_024_87024626_qa_4/environment/bootstrap.sh b/tasks/0087_024_87024626_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_024_87024626_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_024_87024626_qa_4/environment/pull_bucket.py b/tasks/0087_024_87024626_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_024_87024626_qa_4/environment/pull_bucket.py +++ b/tasks/0087_024_87024626_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_024_87024626_qa_4/task.toml b/tasks/0087_024_87024626_qa_4/task.toml index 4195d342fa75258705903215b6dcd374d41ea790..c950f84b0b9ecbde21050da6186f8f1039e6aec3 100644 --- a/tasks/0087_024_87024626_qa_4/task.toml +++ b/tasks/0087_024_87024626_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_136_87136363_qa_3/environment/bootstrap.sh b/tasks/0087_136_87136363_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_136_87136363_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_136_87136363_qa_3/environment/pull_bucket.py b/tasks/0087_136_87136363_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_136_87136363_qa_3/environment/pull_bucket.py +++ b/tasks/0087_136_87136363_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_136_87136363_qa_3/task.toml b/tasks/0087_136_87136363_qa_3/task.toml index 731bd4b1b65850d60d5634533ae84e6cf003ef97..99e84f5dba3e451adf1373b84754208e7c411954 100644 --- a/tasks/0087_136_87136363_qa_3/task.toml +++ b/tasks/0087_136_87136363_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_136_87136363_qa_5/environment/bootstrap.sh b/tasks/0087_136_87136363_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_136_87136363_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_136_87136363_qa_5/environment/pull_bucket.py b/tasks/0087_136_87136363_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_136_87136363_qa_5/environment/pull_bucket.py +++ b/tasks/0087_136_87136363_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_136_87136363_qa_5/task.toml b/tasks/0087_136_87136363_qa_5/task.toml index d0f1e14a52eed121a86a4d1b1ff9023d65e821ad..121f63d7ebf06c1b84a141ca9f0ab81edfc43920 100644 --- a/tasks/0087_136_87136363_qa_5/task.toml +++ b/tasks/0087_136_87136363_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_137_87137747_qa_3/environment/bootstrap.sh b/tasks/0087_137_87137747_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_137_87137747_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_137_87137747_qa_3/environment/pull_bucket.py b/tasks/0087_137_87137747_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_137_87137747_qa_3/environment/pull_bucket.py +++ b/tasks/0087_137_87137747_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_137_87137747_qa_3/task.toml b/tasks/0087_137_87137747_qa_3/task.toml index 52f16f4c8c2801955a89b00bf97131f03cde2fc9..c348e8efb45dce82ff5d3156f2535fb2bcac91aa 100644 --- a/tasks/0087_137_87137747_qa_3/task.toml +++ b/tasks/0087_137_87137747_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_174_87174947_qa_1/environment/bootstrap.sh b/tasks/0087_174_87174947_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_174_87174947_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_174_87174947_qa_1/environment/pull_bucket.py b/tasks/0087_174_87174947_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_174_87174947_qa_1/environment/pull_bucket.py +++ b/tasks/0087_174_87174947_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_174_87174947_qa_1/task.toml b/tasks/0087_174_87174947_qa_1/task.toml index 4527a4134a881a308995f85eaaf2dc8f5aead0a0..12b0fde96bebe9f2f2e7cf70d343338dd672d336 100644 --- a/tasks/0087_174_87174947_qa_1/task.toml +++ b/tasks/0087_174_87174947_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_174_87174947_qa_3/environment/bootstrap.sh b/tasks/0087_174_87174947_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_174_87174947_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_174_87174947_qa_3/environment/pull_bucket.py b/tasks/0087_174_87174947_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_174_87174947_qa_3/environment/pull_bucket.py +++ b/tasks/0087_174_87174947_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_174_87174947_qa_3/task.toml b/tasks/0087_174_87174947_qa_3/task.toml index 3e127e12aed947ff65b50597f6486004c064400d..fc9d0391294d1bdee91825c7d37f70069abea9d4 100644 --- a/tasks/0087_174_87174947_qa_3/task.toml +++ b/tasks/0087_174_87174947_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_180_87180327_qa_4/environment/bootstrap.sh b/tasks/0087_180_87180327_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_180_87180327_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_180_87180327_qa_4/environment/pull_bucket.py b/tasks/0087_180_87180327_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_180_87180327_qa_4/environment/pull_bucket.py +++ b/tasks/0087_180_87180327_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_180_87180327_qa_4/task.toml b/tasks/0087_180_87180327_qa_4/task.toml index 9cc311f7b8749cd7874a4495c75efb953fbd0525..cbbc087508eb85d3874994a300fd080acab7ecca 100644 --- a/tasks/0087_180_87180327_qa_4/task.toml +++ b/tasks/0087_180_87180327_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_187_87187957_qa_5/environment/bootstrap.sh b/tasks/0087_187_87187957_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_187_87187957_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_187_87187957_qa_5/environment/pull_bucket.py b/tasks/0087_187_87187957_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_187_87187957_qa_5/environment/pull_bucket.py +++ b/tasks/0087_187_87187957_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_187_87187957_qa_5/task.toml b/tasks/0087_187_87187957_qa_5/task.toml index a2ad25eea281fc1fd59fdecde63b7a6dede043fa..77d7bdb52a7d1dd4de7b0785573ac57067d8a18d 100644 --- a/tasks/0087_187_87187957_qa_5/task.toml +++ b/tasks/0087_187_87187957_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_215_87215964_qa_1/environment/bootstrap.sh b/tasks/0087_215_87215964_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_215_87215964_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_215_87215964_qa_1/environment/pull_bucket.py b/tasks/0087_215_87215964_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_215_87215964_qa_1/environment/pull_bucket.py +++ b/tasks/0087_215_87215964_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_215_87215964_qa_1/task.toml b/tasks/0087_215_87215964_qa_1/task.toml index 438c4bd1ab6c20368a37b1a2fd29ef0e392c78a3..216a240fe868a5f99c87ceda723d23aed3aa1d5d 100644 --- a/tasks/0087_215_87215964_qa_1/task.toml +++ b/tasks/0087_215_87215964_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_222_87222139_qa_1/environment/bootstrap.sh b/tasks/0087_222_87222139_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_222_87222139_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_222_87222139_qa_1/environment/pull_bucket.py b/tasks/0087_222_87222139_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_222_87222139_qa_1/environment/pull_bucket.py +++ b/tasks/0087_222_87222139_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_222_87222139_qa_1/task.toml b/tasks/0087_222_87222139_qa_1/task.toml index c26737bbd52af8c9ca638831b2280898dfb01de4..bcc7c201d0463fb1a74ef33388d81e91cb3891b3 100644 --- a/tasks/0087_222_87222139_qa_1/task.toml +++ b/tasks/0087_222_87222139_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_222_87222139_qa_2/environment/bootstrap.sh b/tasks/0087_222_87222139_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_222_87222139_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_222_87222139_qa_2/environment/pull_bucket.py b/tasks/0087_222_87222139_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_222_87222139_qa_2/environment/pull_bucket.py +++ b/tasks/0087_222_87222139_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_222_87222139_qa_2/task.toml b/tasks/0087_222_87222139_qa_2/task.toml index a03b84da96ece930b07d0647e5046d80cf982746..e771d4b954f707a6c9997b83830dad3979eda9d4 100644 --- a/tasks/0087_222_87222139_qa_2/task.toml +++ b/tasks/0087_222_87222139_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_222_87222139_qa_4/environment/bootstrap.sh b/tasks/0087_222_87222139_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_222_87222139_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_222_87222139_qa_4/environment/pull_bucket.py b/tasks/0087_222_87222139_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_222_87222139_qa_4/environment/pull_bucket.py +++ b/tasks/0087_222_87222139_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_222_87222139_qa_4/task.toml b/tasks/0087_222_87222139_qa_4/task.toml index 31a542c68c71b6ca9509caf38be373aaecf31a27..9bec38a8da418d39935e8e94e843f21b59f31472 100644 --- a/tasks/0087_222_87222139_qa_4/task.toml +++ b/tasks/0087_222_87222139_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_225_87225031_qa_3/environment/bootstrap.sh b/tasks/0087_225_87225031_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_225_87225031_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_225_87225031_qa_3/environment/pull_bucket.py b/tasks/0087_225_87225031_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_225_87225031_qa_3/environment/pull_bucket.py +++ b/tasks/0087_225_87225031_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_225_87225031_qa_3/task.toml b/tasks/0087_225_87225031_qa_3/task.toml index dc2751d5abeb0af02a14061139c0f2da3d08b92a..d3f2bec89e8857ce01225969f9b0a538aaee297c 100644 --- a/tasks/0087_225_87225031_qa_3/task.toml +++ b/tasks/0087_225_87225031_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_227_87227874_qa_5/environment/bootstrap.sh b/tasks/0087_227_87227874_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_227_87227874_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_227_87227874_qa_5/environment/pull_bucket.py b/tasks/0087_227_87227874_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_227_87227874_qa_5/environment/pull_bucket.py +++ b/tasks/0087_227_87227874_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_227_87227874_qa_5/task.toml b/tasks/0087_227_87227874_qa_5/task.toml index 2a0c2e6f6fdfd18de4cbb68e0799100fb84faf33..141e21e0dad5714a662cc4ce15c4a0ede416ee9b 100644 --- a/tasks/0087_227_87227874_qa_5/task.toml +++ b/tasks/0087_227_87227874_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_290_87290637_qa_1/environment/bootstrap.sh b/tasks/0087_290_87290637_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_290_87290637_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_290_87290637_qa_1/environment/pull_bucket.py b/tasks/0087_290_87290637_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_290_87290637_qa_1/environment/pull_bucket.py +++ b/tasks/0087_290_87290637_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_290_87290637_qa_1/task.toml b/tasks/0087_290_87290637_qa_1/task.toml index ccc0e7315dfc0a7b79c69f091bb08f07af121446..ed0836fce675124987d1749a4504a12869e166f8 100644 --- a/tasks/0087_290_87290637_qa_1/task.toml +++ b/tasks/0087_290_87290637_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_320_87320991_qa_1/environment/bootstrap.sh b/tasks/0087_320_87320991_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_320_87320991_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_320_87320991_qa_1/environment/pull_bucket.py b/tasks/0087_320_87320991_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_320_87320991_qa_1/environment/pull_bucket.py +++ b/tasks/0087_320_87320991_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_320_87320991_qa_1/task.toml b/tasks/0087_320_87320991_qa_1/task.toml index 5e850f1e86978a022520504e22623a7ace0b7ddf..19e998408f10231430df71d45cc1ab821008ef29 100644 --- a/tasks/0087_320_87320991_qa_1/task.toml +++ b/tasks/0087_320_87320991_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_320_87320991_qa_2/environment/bootstrap.sh b/tasks/0087_320_87320991_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_320_87320991_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_320_87320991_qa_2/environment/pull_bucket.py b/tasks/0087_320_87320991_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_320_87320991_qa_2/environment/pull_bucket.py +++ b/tasks/0087_320_87320991_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_320_87320991_qa_2/task.toml b/tasks/0087_320_87320991_qa_2/task.toml index ac41633d42920d97bdc0e8293913fed5b3c603f6..7b942c856e2a6ed310a51f8cee7c574ccf9950f1 100644 --- a/tasks/0087_320_87320991_qa_2/task.toml +++ b/tasks/0087_320_87320991_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_349_87349607_qa_1/environment/bootstrap.sh b/tasks/0087_349_87349607_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_349_87349607_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_349_87349607_qa_1/environment/pull_bucket.py b/tasks/0087_349_87349607_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_349_87349607_qa_1/environment/pull_bucket.py +++ b/tasks/0087_349_87349607_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_349_87349607_qa_1/task.toml b/tasks/0087_349_87349607_qa_1/task.toml index b91fd949ec801886ecdd7e68faa3d43a8db8b2a6..d046ac1a0d228e9f0aaaaf5c4f3ba0ebecdc499c 100644 --- a/tasks/0087_349_87349607_qa_1/task.toml +++ b/tasks/0087_349_87349607_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_361_87361390_qa_4/environment/bootstrap.sh b/tasks/0087_361_87361390_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_361_87361390_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_361_87361390_qa_4/environment/pull_bucket.py b/tasks/0087_361_87361390_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_361_87361390_qa_4/environment/pull_bucket.py +++ b/tasks/0087_361_87361390_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_361_87361390_qa_4/task.toml b/tasks/0087_361_87361390_qa_4/task.toml index b34cf54de84a721d6ca77206b8814802ddf192e5..47e22dac1afe0ef468e1af0ef12d8b8ab295063e 100644 --- a/tasks/0087_361_87361390_qa_4/task.toml +++ b/tasks/0087_361_87361390_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_365_87365940_qa_1/environment/bootstrap.sh b/tasks/0087_365_87365940_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_365_87365940_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_365_87365940_qa_1/environment/pull_bucket.py b/tasks/0087_365_87365940_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_365_87365940_qa_1/environment/pull_bucket.py +++ b/tasks/0087_365_87365940_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_365_87365940_qa_1/task.toml b/tasks/0087_365_87365940_qa_1/task.toml index 503aa6cdf7bd02bdd204e17420c16dc6b9d262b3..bdd2a96f21eb2cca75e343e6f5046acaecff1511 100644 --- a/tasks/0087_365_87365940_qa_1/task.toml +++ b/tasks/0087_365_87365940_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_372_87372002_qa_1/environment/bootstrap.sh b/tasks/0087_372_87372002_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_372_87372002_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_372_87372002_qa_1/environment/pull_bucket.py b/tasks/0087_372_87372002_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_372_87372002_qa_1/environment/pull_bucket.py +++ b/tasks/0087_372_87372002_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_372_87372002_qa_1/task.toml b/tasks/0087_372_87372002_qa_1/task.toml index 7dfae9eb17db7b7dbe69858c020774ffb2195327..4a9250510bef36937af2964152502d7606073d95 100644 --- a/tasks/0087_372_87372002_qa_1/task.toml +++ b/tasks/0087_372_87372002_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_372_87372002_qa_2/environment/bootstrap.sh b/tasks/0087_372_87372002_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_372_87372002_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_372_87372002_qa_2/environment/pull_bucket.py b/tasks/0087_372_87372002_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_372_87372002_qa_2/environment/pull_bucket.py +++ b/tasks/0087_372_87372002_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_372_87372002_qa_2/task.toml b/tasks/0087_372_87372002_qa_2/task.toml index 1d49bed9383bd7054e8d07ca7fcb70dabf436ad5..e44bc7e3f2b12f4ba5723886750cf3fcccaff346 100644 --- a/tasks/0087_372_87372002_qa_2/task.toml +++ b/tasks/0087_372_87372002_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_374_87374454_qa_3/environment/bootstrap.sh b/tasks/0087_374_87374454_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_374_87374454_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_374_87374454_qa_3/environment/pull_bucket.py b/tasks/0087_374_87374454_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_374_87374454_qa_3/environment/pull_bucket.py +++ b/tasks/0087_374_87374454_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_374_87374454_qa_3/task.toml b/tasks/0087_374_87374454_qa_3/task.toml index 225d5786b4e236bb192c99c443941ab2d423b01d..a2fcacc8e4ccf75dfe54558f30005103f87b7f35 100644 --- a/tasks/0087_374_87374454_qa_3/task.toml +++ b/tasks/0087_374_87374454_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_388_87388798_qa_1/environment/bootstrap.sh b/tasks/0087_388_87388798_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_388_87388798_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_388_87388798_qa_1/environment/pull_bucket.py b/tasks/0087_388_87388798_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_388_87388798_qa_1/environment/pull_bucket.py +++ b/tasks/0087_388_87388798_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_388_87388798_qa_1/task.toml b/tasks/0087_388_87388798_qa_1/task.toml index 6bbe7419d764b5e87b563135796efd28e4c0e77e..cc5edb11e874d3881df9d1fdf49ace20646fbb28 100644 --- a/tasks/0087_388_87388798_qa_1/task.toml +++ b/tasks/0087_388_87388798_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_388_87388798_qa_4/environment/bootstrap.sh b/tasks/0087_388_87388798_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_388_87388798_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_388_87388798_qa_4/environment/pull_bucket.py b/tasks/0087_388_87388798_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_388_87388798_qa_4/environment/pull_bucket.py +++ b/tasks/0087_388_87388798_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_388_87388798_qa_4/task.toml b/tasks/0087_388_87388798_qa_4/task.toml index a8f614e54d2e6bce5dc5fa66c24657097cf52795..180099036fe0391a1be346b06569f194b85c974c 100644 --- a/tasks/0087_388_87388798_qa_4/task.toml +++ b/tasks/0087_388_87388798_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_443_87443962_qa_2/environment/bootstrap.sh b/tasks/0087_443_87443962_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_443_87443962_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_443_87443962_qa_2/environment/pull_bucket.py b/tasks/0087_443_87443962_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_443_87443962_qa_2/environment/pull_bucket.py +++ b/tasks/0087_443_87443962_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_443_87443962_qa_2/task.toml b/tasks/0087_443_87443962_qa_2/task.toml index f0f5fcd39ccb1f2d25410558f561b4420e8d54cf..fc321cac5f99c8e27501103307871fd721b049ec 100644 --- a/tasks/0087_443_87443962_qa_2/task.toml +++ b/tasks/0087_443_87443962_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_443_87443962_qa_3/environment/bootstrap.sh b/tasks/0087_443_87443962_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_443_87443962_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_443_87443962_qa_3/environment/pull_bucket.py b/tasks/0087_443_87443962_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_443_87443962_qa_3/environment/pull_bucket.py +++ b/tasks/0087_443_87443962_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_443_87443962_qa_3/task.toml b/tasks/0087_443_87443962_qa_3/task.toml index 259c12bc5b745bcdf84cb18bc50e5445ee29659a..a5149e45a81f8fe0468c2eeecad68497d4504cf6 100644 --- a/tasks/0087_443_87443962_qa_3/task.toml +++ b/tasks/0087_443_87443962_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_558_87558511_qa_3/environment/bootstrap.sh b/tasks/0087_558_87558511_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_558_87558511_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_558_87558511_qa_3/environment/pull_bucket.py b/tasks/0087_558_87558511_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_558_87558511_qa_3/environment/pull_bucket.py +++ b/tasks/0087_558_87558511_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_558_87558511_qa_3/task.toml b/tasks/0087_558_87558511_qa_3/task.toml index 5d4f3e6cdbbd168bffc436bba11663441ccb86d9..401cbca993d8569633746fee26f8b82b6f10b7fe 100644 --- a/tasks/0087_558_87558511_qa_3/task.toml +++ b/tasks/0087_558_87558511_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_558_87558511_qa_5/environment/bootstrap.sh b/tasks/0087_558_87558511_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_558_87558511_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_558_87558511_qa_5/environment/pull_bucket.py b/tasks/0087_558_87558511_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_558_87558511_qa_5/environment/pull_bucket.py +++ b/tasks/0087_558_87558511_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_558_87558511_qa_5/task.toml b/tasks/0087_558_87558511_qa_5/task.toml index d728713327a30d0df67e34504922e41ecd57318c..b00691a5ea4fe62e9ae4ebe05e21163a5169b3be 100644 --- a/tasks/0087_558_87558511_qa_5/task.toml +++ b/tasks/0087_558_87558511_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_608_87608969_qa_3/environment/bootstrap.sh b/tasks/0087_608_87608969_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_608_87608969_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_608_87608969_qa_3/environment/pull_bucket.py b/tasks/0087_608_87608969_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_608_87608969_qa_3/environment/pull_bucket.py +++ b/tasks/0087_608_87608969_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_608_87608969_qa_3/task.toml b/tasks/0087_608_87608969_qa_3/task.toml index 6a14d83a025e56d583f4f9c5e08d259c71cd8fb2..01308c95e77c759cd8e23ef68a31c84f37e60f10 100644 --- a/tasks/0087_608_87608969_qa_3/task.toml +++ b/tasks/0087_608_87608969_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_608_87608969_qa_4/environment/bootstrap.sh b/tasks/0087_608_87608969_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_608_87608969_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_608_87608969_qa_4/environment/pull_bucket.py b/tasks/0087_608_87608969_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_608_87608969_qa_4/environment/pull_bucket.py +++ b/tasks/0087_608_87608969_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_608_87608969_qa_4/task.toml b/tasks/0087_608_87608969_qa_4/task.toml index f1ad9623c433db6d18aae0a584136d95fe3adac3..5dc7f8aedf9f79fbb8cd312e7d21961b93934418 100644 --- a/tasks/0087_608_87608969_qa_4/task.toml +++ b/tasks/0087_608_87608969_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_608_87608969_qa_5/environment/bootstrap.sh b/tasks/0087_608_87608969_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_608_87608969_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_608_87608969_qa_5/environment/pull_bucket.py b/tasks/0087_608_87608969_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_608_87608969_qa_5/environment/pull_bucket.py +++ b/tasks/0087_608_87608969_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_608_87608969_qa_5/task.toml b/tasks/0087_608_87608969_qa_5/task.toml index 546601667b5ecb815bfe115178ba1f877535e6ee..775bd075917e690e99554dd346c2ce575be2e701 100644 --- a/tasks/0087_608_87608969_qa_5/task.toml +++ b/tasks/0087_608_87608969_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_634_87634929_qa_1/environment/bootstrap.sh b/tasks/0087_634_87634929_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_634_87634929_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_634_87634929_qa_1/environment/pull_bucket.py b/tasks/0087_634_87634929_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_634_87634929_qa_1/environment/pull_bucket.py +++ b/tasks/0087_634_87634929_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_634_87634929_qa_1/task.toml b/tasks/0087_634_87634929_qa_1/task.toml index 9f46f5c3b0971a566aaf7bfe1460b6bafed68ea2..1971cdb5acf9889073f1b72bd35489e21d2d9927 100644 --- a/tasks/0087_634_87634929_qa_1/task.toml +++ b/tasks/0087_634_87634929_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_643_87643226_qa_5/environment/bootstrap.sh b/tasks/0087_643_87643226_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_643_87643226_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_643_87643226_qa_5/environment/pull_bucket.py b/tasks/0087_643_87643226_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_643_87643226_qa_5/environment/pull_bucket.py +++ b/tasks/0087_643_87643226_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_643_87643226_qa_5/task.toml b/tasks/0087_643_87643226_qa_5/task.toml index 41bcc809228334eb6517b10bb2a5a60ebf6b512a..9abfe46cd22389495a46fcb5e8bcffba2276a378 100644 --- a/tasks/0087_643_87643226_qa_5/task.toml +++ b/tasks/0087_643_87643226_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_644_87644639_qa_1/environment/bootstrap.sh b/tasks/0087_644_87644639_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_644_87644639_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_644_87644639_qa_1/environment/pull_bucket.py b/tasks/0087_644_87644639_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_644_87644639_qa_1/environment/pull_bucket.py +++ b/tasks/0087_644_87644639_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_644_87644639_qa_1/task.toml b/tasks/0087_644_87644639_qa_1/task.toml index 88b750652f5893bd320f4b0911621907cbd73e00..069799fc809a52d1edfd8198aa29ad8b7d204e16 100644 --- a/tasks/0087_644_87644639_qa_1/task.toml +++ b/tasks/0087_644_87644639_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_644_87644639_qa_3/environment/bootstrap.sh b/tasks/0087_644_87644639_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_644_87644639_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_644_87644639_qa_3/environment/pull_bucket.py b/tasks/0087_644_87644639_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_644_87644639_qa_3/environment/pull_bucket.py +++ b/tasks/0087_644_87644639_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_644_87644639_qa_3/task.toml b/tasks/0087_644_87644639_qa_3/task.toml index bd4853da3e74c590c169c1974d66d8b3083b7034..e70f6f5ff5bf4ee7ff11c1fb17918a8bdf428bf9 100644 --- a/tasks/0087_644_87644639_qa_3/task.toml +++ b/tasks/0087_644_87644639_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_676_87676487_qa_1/environment/bootstrap.sh b/tasks/0087_676_87676487_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_676_87676487_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_676_87676487_qa_1/environment/pull_bucket.py b/tasks/0087_676_87676487_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_676_87676487_qa_1/environment/pull_bucket.py +++ b/tasks/0087_676_87676487_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_676_87676487_qa_1/task.toml b/tasks/0087_676_87676487_qa_1/task.toml index 2acd001983247f3416b6a68c69f87b6b2a411a01..301eb1107bb13df83b8c2ec144a81ff32fefdd23 100644 --- a/tasks/0087_676_87676487_qa_1/task.toml +++ b/tasks/0087_676_87676487_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_676_87676487_qa_3/environment/bootstrap.sh b/tasks/0087_676_87676487_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_676_87676487_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_676_87676487_qa_3/environment/pull_bucket.py b/tasks/0087_676_87676487_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_676_87676487_qa_3/environment/pull_bucket.py +++ b/tasks/0087_676_87676487_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_676_87676487_qa_3/task.toml b/tasks/0087_676_87676487_qa_3/task.toml index 931ff7eecd86728d40283a9d13ef258e67f69d3a..0f4b71775ea6a5dd7cca57acda7232f6478ca913 100644 --- a/tasks/0087_676_87676487_qa_3/task.toml +++ b/tasks/0087_676_87676487_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_720_87720557_qa_2/environment/bootstrap.sh b/tasks/0087_720_87720557_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_720_87720557_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_720_87720557_qa_2/environment/pull_bucket.py b/tasks/0087_720_87720557_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_720_87720557_qa_2/environment/pull_bucket.py +++ b/tasks/0087_720_87720557_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_720_87720557_qa_2/task.toml b/tasks/0087_720_87720557_qa_2/task.toml index 25945f2687fbea693d623262c073f6c8176801e1..4b74411b3008afc1d6b72c759110631c5744cb99 100644 --- a/tasks/0087_720_87720557_qa_2/task.toml +++ b/tasks/0087_720_87720557_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_789_87789840_qa_1/environment/bootstrap.sh b/tasks/0087_789_87789840_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_789_87789840_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_789_87789840_qa_1/environment/pull_bucket.py b/tasks/0087_789_87789840_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_789_87789840_qa_1/environment/pull_bucket.py +++ b/tasks/0087_789_87789840_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_789_87789840_qa_1/task.toml b/tasks/0087_789_87789840_qa_1/task.toml index a9a472d05de4f732df88173a03076f0a2fe9c11c..3c6d5e05d5bdc7aa9f21b083ecacaf93fef877a2 100644 --- a/tasks/0087_789_87789840_qa_1/task.toml +++ b/tasks/0087_789_87789840_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_825_87825397_qa_3/environment/bootstrap.sh b/tasks/0087_825_87825397_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_825_87825397_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_825_87825397_qa_3/environment/pull_bucket.py b/tasks/0087_825_87825397_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_825_87825397_qa_3/environment/pull_bucket.py +++ b/tasks/0087_825_87825397_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_825_87825397_qa_3/task.toml b/tasks/0087_825_87825397_qa_3/task.toml index 3485a1fadc3aa0b79165413c109a3f15f8dc1867..b03e252a02fecde8a126df964aa547bbfe7773af 100644 --- a/tasks/0087_825_87825397_qa_3/task.toml +++ b/tasks/0087_825_87825397_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_825_87825397_qa_4/environment/bootstrap.sh b/tasks/0087_825_87825397_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_825_87825397_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_825_87825397_qa_4/environment/pull_bucket.py b/tasks/0087_825_87825397_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_825_87825397_qa_4/environment/pull_bucket.py +++ b/tasks/0087_825_87825397_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_825_87825397_qa_4/task.toml b/tasks/0087_825_87825397_qa_4/task.toml index dd5b465f955681dd8d5eb1fc9075db5619f20cef..554f84d990b388db757ec90794a4dbb7edf95fa6 100644 --- a/tasks/0087_825_87825397_qa_4/task.toml +++ b/tasks/0087_825_87825397_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_832_87832429_qa_3/environment/bootstrap.sh b/tasks/0087_832_87832429_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_832_87832429_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_832_87832429_qa_3/environment/pull_bucket.py b/tasks/0087_832_87832429_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_832_87832429_qa_3/environment/pull_bucket.py +++ b/tasks/0087_832_87832429_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_832_87832429_qa_3/task.toml b/tasks/0087_832_87832429_qa_3/task.toml index eb6a32e5114b15b10e57b91ac171fecc14a673ac..cb6a141d5903c146577552d2719fc7298bd411c3 100644 --- a/tasks/0087_832_87832429_qa_3/task.toml +++ b/tasks/0087_832_87832429_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_860_87860092_qa_3/environment/bootstrap.sh b/tasks/0087_860_87860092_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_860_87860092_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_860_87860092_qa_3/environment/pull_bucket.py b/tasks/0087_860_87860092_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_860_87860092_qa_3/environment/pull_bucket.py +++ b/tasks/0087_860_87860092_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_860_87860092_qa_3/task.toml b/tasks/0087_860_87860092_qa_3/task.toml index 91a51f88de24ec837b76609538639e4b6e70ca68..0718271a10b874894344079aeb410898752c9cc2 100644 --- a/tasks/0087_860_87860092_qa_3/task.toml +++ b/tasks/0087_860_87860092_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_867_87867765_qa_2/environment/bootstrap.sh b/tasks/0087_867_87867765_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_867_87867765_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_867_87867765_qa_2/environment/pull_bucket.py b/tasks/0087_867_87867765_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_867_87867765_qa_2/environment/pull_bucket.py +++ b/tasks/0087_867_87867765_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_867_87867765_qa_2/task.toml b/tasks/0087_867_87867765_qa_2/task.toml index 13207eadc201eb09200a4a3a7c36347425b334e2..b9a8983f787bab8ee66f32e0b67c9ac2a750b70e 100644 --- a/tasks/0087_867_87867765_qa_2/task.toml +++ b/tasks/0087_867_87867765_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_867_87867765_qa_4/environment/bootstrap.sh b/tasks/0087_867_87867765_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_867_87867765_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_867_87867765_qa_4/environment/pull_bucket.py b/tasks/0087_867_87867765_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_867_87867765_qa_4/environment/pull_bucket.py +++ b/tasks/0087_867_87867765_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_867_87867765_qa_4/task.toml b/tasks/0087_867_87867765_qa_4/task.toml index 562493637e9f090d0f65802460ab73ad4abe172f..a45209966f781f8074725ea4295873f2ca90bc34 100644 --- a/tasks/0087_867_87867765_qa_4/task.toml +++ b/tasks/0087_867_87867765_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_867_87867765_qa_5/environment/bootstrap.sh b/tasks/0087_867_87867765_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_867_87867765_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_867_87867765_qa_5/environment/pull_bucket.py b/tasks/0087_867_87867765_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_867_87867765_qa_5/environment/pull_bucket.py +++ b/tasks/0087_867_87867765_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_867_87867765_qa_5/task.toml b/tasks/0087_867_87867765_qa_5/task.toml index ea788a803674e37f66ce3bcb1874455bd3440e09..88527ce822f6349cca3053bb8f07fadaea74cafd 100644 --- a/tasks/0087_867_87867765_qa_5/task.toml +++ b/tasks/0087_867_87867765_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_893_87893220_qa_2/environment/bootstrap.sh b/tasks/0087_893_87893220_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_893_87893220_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_893_87893220_qa_2/environment/pull_bucket.py b/tasks/0087_893_87893220_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_893_87893220_qa_2/environment/pull_bucket.py +++ b/tasks/0087_893_87893220_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_893_87893220_qa_2/task.toml b/tasks/0087_893_87893220_qa_2/task.toml index 522b8c23bf0e341eed8b2f2666af97cdf4259ad0..225f2a0d9c30bcb26639e9819127b2bc97267324 100644 --- a/tasks/0087_893_87893220_qa_2/task.toml +++ b/tasks/0087_893_87893220_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_941_87941186_qa_1/environment/bootstrap.sh b/tasks/0087_941_87941186_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_941_87941186_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_941_87941186_qa_1/environment/pull_bucket.py b/tasks/0087_941_87941186_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_941_87941186_qa_1/environment/pull_bucket.py +++ b/tasks/0087_941_87941186_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_941_87941186_qa_1/task.toml b/tasks/0087_941_87941186_qa_1/task.toml index d4d785bc7a1bb3728b4ae378aa91de774cb95f1f..d683695410176766388a08c026586db94373e5f9 100644 --- a/tasks/0087_941_87941186_qa_1/task.toml +++ b/tasks/0087_941_87941186_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_941_87941186_qa_3/environment/bootstrap.sh b/tasks/0087_941_87941186_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_941_87941186_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_941_87941186_qa_3/environment/pull_bucket.py b/tasks/0087_941_87941186_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_941_87941186_qa_3/environment/pull_bucket.py +++ b/tasks/0087_941_87941186_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_941_87941186_qa_3/task.toml b/tasks/0087_941_87941186_qa_3/task.toml index 83c834caed09b64e60b1ee6c78024da0938f27f8..b26a7a4d5a731b7e3bf8798d631ebd96b9307d65 100644 --- a/tasks/0087_941_87941186_qa_3/task.toml +++ b/tasks/0087_941_87941186_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_955_87955720_qa_2/environment/bootstrap.sh b/tasks/0087_955_87955720_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_955_87955720_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_955_87955720_qa_2/environment/pull_bucket.py b/tasks/0087_955_87955720_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_955_87955720_qa_2/environment/pull_bucket.py +++ b/tasks/0087_955_87955720_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_955_87955720_qa_2/task.toml b/tasks/0087_955_87955720_qa_2/task.toml index 416eb629acca1d2cd404aca231a0d4ad3b63f0ee..9699ad0a71dd11442e231fbabbc1d5b90b5b981d 100644 --- a/tasks/0087_955_87955720_qa_2/task.toml +++ b/tasks/0087_955_87955720_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_973_87973029_qa_1/environment/bootstrap.sh b/tasks/0087_973_87973029_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_973_87973029_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_973_87973029_qa_1/environment/pull_bucket.py b/tasks/0087_973_87973029_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_973_87973029_qa_1/environment/pull_bucket.py +++ b/tasks/0087_973_87973029_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_973_87973029_qa_1/task.toml b/tasks/0087_973_87973029_qa_1/task.toml index 93af49a218bb710588cdcd4b494a8f8a20bb5f44..c4fafd98372ea48a88b1ea6ca4582eddc8ce7ef1 100644 --- a/tasks/0087_973_87973029_qa_1/task.toml +++ b/tasks/0087_973_87973029_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0087_973_87973029_qa_3/environment/bootstrap.sh b/tasks/0087_973_87973029_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0087_973_87973029_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0087_973_87973029_qa_3/environment/pull_bucket.py b/tasks/0087_973_87973029_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0087_973_87973029_qa_3/environment/pull_bucket.py +++ b/tasks/0087_973_87973029_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0087_973_87973029_qa_3/task.toml b/tasks/0087_973_87973029_qa_3/task.toml index ad3c697405f1102e9861e35f82039d8c8f9a853b..0c4207f8af96c0bdd00be4c86ab6977c5f020854 100644 --- a/tasks/0087_973_87973029_qa_3/task.toml +++ b/tasks/0087_973_87973029_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_102_88102916_qa_2/environment/bootstrap.sh b/tasks/0088_102_88102916_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_102_88102916_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_102_88102916_qa_2/environment/pull_bucket.py b/tasks/0088_102_88102916_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_102_88102916_qa_2/environment/pull_bucket.py +++ b/tasks/0088_102_88102916_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_102_88102916_qa_2/task.toml b/tasks/0088_102_88102916_qa_2/task.toml index f0b61d0a6bba5017fb65989048af5c65b2177c13..fbc0a05223adf956ce1a0b35c715879a9428d285 100644 --- a/tasks/0088_102_88102916_qa_2/task.toml +++ b/tasks/0088_102_88102916_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_108_88108629_qa_1/environment/bootstrap.sh b/tasks/0088_108_88108629_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_108_88108629_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_108_88108629_qa_1/environment/pull_bucket.py b/tasks/0088_108_88108629_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_108_88108629_qa_1/environment/pull_bucket.py +++ b/tasks/0088_108_88108629_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_108_88108629_qa_1/task.toml b/tasks/0088_108_88108629_qa_1/task.toml index 2b75f2f304442ea27dd827f34b1d75f7408f0c45..14f0af6982ebcedf18cfd348e86857ed500fba6f 100644 --- a/tasks/0088_108_88108629_qa_1/task.toml +++ b/tasks/0088_108_88108629_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_214_88214420_qa_1/environment/bootstrap.sh b/tasks/0088_214_88214420_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_214_88214420_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_214_88214420_qa_1/environment/pull_bucket.py b/tasks/0088_214_88214420_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_214_88214420_qa_1/environment/pull_bucket.py +++ b/tasks/0088_214_88214420_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_214_88214420_qa_1/task.toml b/tasks/0088_214_88214420_qa_1/task.toml index 752b004c443fb613818b673aa1509fcfbab7422f..2f9e03aa8fb80dc24eaf610cdc463ba95a13ca7d 100644 --- a/tasks/0088_214_88214420_qa_1/task.toml +++ b/tasks/0088_214_88214420_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_214_88214420_qa_3/environment/bootstrap.sh b/tasks/0088_214_88214420_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_214_88214420_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_214_88214420_qa_3/environment/pull_bucket.py b/tasks/0088_214_88214420_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_214_88214420_qa_3/environment/pull_bucket.py +++ b/tasks/0088_214_88214420_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_214_88214420_qa_3/task.toml b/tasks/0088_214_88214420_qa_3/task.toml index 7ed991248a1fb72e04c2ca9416745d366e0ac1c3..1f7dec100bd70edc9234d6181128c8cffbf9ad22 100644 --- a/tasks/0088_214_88214420_qa_3/task.toml +++ b/tasks/0088_214_88214420_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_214_88214420_qa_5/environment/bootstrap.sh b/tasks/0088_214_88214420_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_214_88214420_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_214_88214420_qa_5/environment/pull_bucket.py b/tasks/0088_214_88214420_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_214_88214420_qa_5/environment/pull_bucket.py +++ b/tasks/0088_214_88214420_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_214_88214420_qa_5/task.toml b/tasks/0088_214_88214420_qa_5/task.toml index 76b7f1a3747786c6dfb208a1438a7283dcc46057..35db9c895d51c70b4f60f89aae3c82cf93bfe500 100644 --- a/tasks/0088_214_88214420_qa_5/task.toml +++ b/tasks/0088_214_88214420_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_244_88244831_qa_4/environment/bootstrap.sh b/tasks/0088_244_88244831_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_244_88244831_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_244_88244831_qa_4/environment/pull_bucket.py b/tasks/0088_244_88244831_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_244_88244831_qa_4/environment/pull_bucket.py +++ b/tasks/0088_244_88244831_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_244_88244831_qa_4/task.toml b/tasks/0088_244_88244831_qa_4/task.toml index f1282058d3adf0b04a4374c5cb90538f06b0b92f..f9a4652f3d337658cb394385afc97ef71f842137 100644 --- a/tasks/0088_244_88244831_qa_4/task.toml +++ b/tasks/0088_244_88244831_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_278_88278722_qa_4/environment/bootstrap.sh b/tasks/0088_278_88278722_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_278_88278722_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_278_88278722_qa_4/environment/pull_bucket.py b/tasks/0088_278_88278722_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_278_88278722_qa_4/environment/pull_bucket.py +++ b/tasks/0088_278_88278722_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_278_88278722_qa_4/task.toml b/tasks/0088_278_88278722_qa_4/task.toml index 539eb715b63b97a2283397e771f592d92f96ef9d..251aeae1b2c95a2151c0e25fe9fff6ea3bf02c0a 100644 --- a/tasks/0088_278_88278722_qa_4/task.toml +++ b/tasks/0088_278_88278722_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_300_88300701_qa_3/environment/bootstrap.sh b/tasks/0088_300_88300701_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_300_88300701_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_300_88300701_qa_3/environment/pull_bucket.py b/tasks/0088_300_88300701_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_300_88300701_qa_3/environment/pull_bucket.py +++ b/tasks/0088_300_88300701_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_300_88300701_qa_3/task.toml b/tasks/0088_300_88300701_qa_3/task.toml index c3fb9930bc9c5c37a9618b28c0aa9b17f8ee3383..ed6b7b4df275aacbd15910cbd47216927ba8879c 100644 --- a/tasks/0088_300_88300701_qa_3/task.toml +++ b/tasks/0088_300_88300701_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_305_88305132_qa_1/environment/bootstrap.sh b/tasks/0088_305_88305132_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_305_88305132_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_305_88305132_qa_1/environment/pull_bucket.py b/tasks/0088_305_88305132_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_305_88305132_qa_1/environment/pull_bucket.py +++ b/tasks/0088_305_88305132_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_305_88305132_qa_1/task.toml b/tasks/0088_305_88305132_qa_1/task.toml index 3c703d09ff926ddf1eb9838e44ebcb846f0aa438..64a5a7a7109d86d71003a19da242fbb6d139dda4 100644 --- a/tasks/0088_305_88305132_qa_1/task.toml +++ b/tasks/0088_305_88305132_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_305_88305132_qa_4/environment/bootstrap.sh b/tasks/0088_305_88305132_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_305_88305132_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_305_88305132_qa_4/environment/pull_bucket.py b/tasks/0088_305_88305132_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_305_88305132_qa_4/environment/pull_bucket.py +++ b/tasks/0088_305_88305132_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_305_88305132_qa_4/task.toml b/tasks/0088_305_88305132_qa_4/task.toml index c708f495163601ec0f29162b911176a38a78ce9f..322e048732aedc25ef6cd1556fd53cb28f5ef477 100644 --- a/tasks/0088_305_88305132_qa_4/task.toml +++ b/tasks/0088_305_88305132_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_409_88409114_qa_4/environment/bootstrap.sh b/tasks/0088_409_88409114_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_409_88409114_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_409_88409114_qa_4/environment/pull_bucket.py b/tasks/0088_409_88409114_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_409_88409114_qa_4/environment/pull_bucket.py +++ b/tasks/0088_409_88409114_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_409_88409114_qa_4/task.toml b/tasks/0088_409_88409114_qa_4/task.toml index cbff720cacdb8812c39348375ceb24fc5ec10423..c35769e996d11682f7ccbb9b6da3ea23f348e46d 100644 --- a/tasks/0088_409_88409114_qa_4/task.toml +++ b/tasks/0088_409_88409114_qa_4/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_417_88417673_qa_1/environment/bootstrap.sh b/tasks/0088_417_88417673_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_417_88417673_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_417_88417673_qa_1/environment/pull_bucket.py b/tasks/0088_417_88417673_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_417_88417673_qa_1/environment/pull_bucket.py +++ b/tasks/0088_417_88417673_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_417_88417673_qa_1/task.toml b/tasks/0088_417_88417673_qa_1/task.toml index 7393da4a0234af8f42fdd0d19beaceac931e4355..f93bf481641f053e95b6e97fa37ad0decd63c590 100644 --- a/tasks/0088_417_88417673_qa_1/task.toml +++ b/tasks/0088_417_88417673_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_418_88418145_qa_1/environment/bootstrap.sh b/tasks/0088_418_88418145_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_418_88418145_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_418_88418145_qa_1/environment/pull_bucket.py b/tasks/0088_418_88418145_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_418_88418145_qa_1/environment/pull_bucket.py +++ b/tasks/0088_418_88418145_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_418_88418145_qa_1/task.toml b/tasks/0088_418_88418145_qa_1/task.toml index fc22fa0d0971d11745401670c0073578d1e28eff..db12e7a5e5252d12b4c5ad777d1f989f166c8b4d 100644 --- a/tasks/0088_418_88418145_qa_1/task.toml +++ b/tasks/0088_418_88418145_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_472_88472757_qa_2/environment/bootstrap.sh b/tasks/0088_472_88472757_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_472_88472757_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_472_88472757_qa_2/environment/pull_bucket.py b/tasks/0088_472_88472757_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_472_88472757_qa_2/environment/pull_bucket.py +++ b/tasks/0088_472_88472757_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_472_88472757_qa_2/task.toml b/tasks/0088_472_88472757_qa_2/task.toml index e74d5a66e3c15e05719d9e8c308b14dcca732945..fe4c1a9f2284e31e078f540e2239cc0a6512c3c7 100644 --- a/tasks/0088_472_88472757_qa_2/task.toml +++ b/tasks/0088_472_88472757_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_483_88483775_qa_4/environment/bootstrap.sh b/tasks/0088_483_88483775_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_483_88483775_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_483_88483775_qa_4/environment/pull_bucket.py b/tasks/0088_483_88483775_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_483_88483775_qa_4/environment/pull_bucket.py +++ b/tasks/0088_483_88483775_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_483_88483775_qa_4/task.toml b/tasks/0088_483_88483775_qa_4/task.toml index 1619af594701098ba4ac88b075eefe1d7de0e727..ed3d0484b568dc6721f159b23b297447cbdcec51 100644 --- a/tasks/0088_483_88483775_qa_4/task.toml +++ b/tasks/0088_483_88483775_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_489_88489992_qa_2/environment/bootstrap.sh b/tasks/0088_489_88489992_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_489_88489992_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_489_88489992_qa_2/environment/pull_bucket.py b/tasks/0088_489_88489992_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_489_88489992_qa_2/environment/pull_bucket.py +++ b/tasks/0088_489_88489992_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_489_88489992_qa_2/task.toml b/tasks/0088_489_88489992_qa_2/task.toml index e52c17db060e54120ad94c57bce3a473fb42d295..b7e0910a6bbd7f0e4eb441e4d8892911e2ddb8dc 100644 --- a/tasks/0088_489_88489992_qa_2/task.toml +++ b/tasks/0088_489_88489992_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_489_88489992_qa_3/environment/bootstrap.sh b/tasks/0088_489_88489992_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_489_88489992_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_489_88489992_qa_3/environment/pull_bucket.py b/tasks/0088_489_88489992_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_489_88489992_qa_3/environment/pull_bucket.py +++ b/tasks/0088_489_88489992_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_489_88489992_qa_3/task.toml b/tasks/0088_489_88489992_qa_3/task.toml index 716b6b3cf90a35b7627281a4cb59079842d57f53..9fe6569a407002792ac6b41c71f622f1869116df 100644 --- a/tasks/0088_489_88489992_qa_3/task.toml +++ b/tasks/0088_489_88489992_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_507_88507841_qa_4/environment/bootstrap.sh b/tasks/0088_507_88507841_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_507_88507841_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_507_88507841_qa_4/environment/pull_bucket.py b/tasks/0088_507_88507841_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_507_88507841_qa_4/environment/pull_bucket.py +++ b/tasks/0088_507_88507841_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_507_88507841_qa_4/task.toml b/tasks/0088_507_88507841_qa_4/task.toml index 749d9eed6b1847336a7170b70df6d7ab4d9db2d6..9cea993174911b99ec7a23f8da49aa205eaa4050 100644 --- a/tasks/0088_507_88507841_qa_4/task.toml +++ b/tasks/0088_507_88507841_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_548_88548025_qa_1/environment/bootstrap.sh b/tasks/0088_548_88548025_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_548_88548025_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_548_88548025_qa_1/environment/pull_bucket.py b/tasks/0088_548_88548025_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_548_88548025_qa_1/environment/pull_bucket.py +++ b/tasks/0088_548_88548025_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_548_88548025_qa_1/task.toml b/tasks/0088_548_88548025_qa_1/task.toml index 0c3d06a577d92a6b321bf5706dbdd2455ea19190..ad8f676d208fde52e5e8fc82d8e82b32931d7579 100644 --- a/tasks/0088_548_88548025_qa_1/task.toml +++ b/tasks/0088_548_88548025_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_548_88548685_qa_4/environment/bootstrap.sh b/tasks/0088_548_88548685_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_548_88548685_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_548_88548685_qa_4/environment/pull_bucket.py b/tasks/0088_548_88548685_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_548_88548685_qa_4/environment/pull_bucket.py +++ b/tasks/0088_548_88548685_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_548_88548685_qa_4/task.toml b/tasks/0088_548_88548685_qa_4/task.toml index c35d128defd25c618a9829017e22a2bf4d9d9a3f..fc2b9128d4159c5c45b4e8abf838c88b2ddd46ab 100644 --- a/tasks/0088_548_88548685_qa_4/task.toml +++ b/tasks/0088_548_88548685_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_550_88550730_qa_1/environment/bootstrap.sh b/tasks/0088_550_88550730_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_550_88550730_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_550_88550730_qa_1/environment/pull_bucket.py b/tasks/0088_550_88550730_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_550_88550730_qa_1/environment/pull_bucket.py +++ b/tasks/0088_550_88550730_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_550_88550730_qa_1/task.toml b/tasks/0088_550_88550730_qa_1/task.toml index 3e1fbefd71f88a76a1ed8577866cee4eb9a5b162..9fbb3e7824ceb4a2a14c4ee7aaca5ca0a0bd6e4e 100644 --- a/tasks/0088_550_88550730_qa_1/task.toml +++ b/tasks/0088_550_88550730_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_614_88614765_qa_5/environment/bootstrap.sh b/tasks/0088_614_88614765_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_614_88614765_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_614_88614765_qa_5/environment/pull_bucket.py b/tasks/0088_614_88614765_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_614_88614765_qa_5/environment/pull_bucket.py +++ b/tasks/0088_614_88614765_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_614_88614765_qa_5/task.toml b/tasks/0088_614_88614765_qa_5/task.toml index 6d4e8081ec4a629aea6781b7471644d67ea8b962..b63a7572cb9f9723f61d418e6e2d922415a20e14 100644 --- a/tasks/0088_614_88614765_qa_5/task.toml +++ b/tasks/0088_614_88614765_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_676_88676435_qa_3/environment/bootstrap.sh b/tasks/0088_676_88676435_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_676_88676435_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_676_88676435_qa_3/environment/pull_bucket.py b/tasks/0088_676_88676435_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_676_88676435_qa_3/environment/pull_bucket.py +++ b/tasks/0088_676_88676435_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_676_88676435_qa_3/task.toml b/tasks/0088_676_88676435_qa_3/task.toml index f37c5cdf4179fc221feb48ae8f7e594b77ed7960..20d29fe7fc974bfc7378508fa38d390c0edffed0 100644 --- a/tasks/0088_676_88676435_qa_3/task.toml +++ b/tasks/0088_676_88676435_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_720_88720224_qa_1/environment/bootstrap.sh b/tasks/0088_720_88720224_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_720_88720224_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_720_88720224_qa_1/environment/pull_bucket.py b/tasks/0088_720_88720224_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_720_88720224_qa_1/environment/pull_bucket.py +++ b/tasks/0088_720_88720224_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_720_88720224_qa_1/task.toml b/tasks/0088_720_88720224_qa_1/task.toml index 7a9761f1adf02b5d33c95d52b0c888c8a1522843..0a8b1e692867a3a609d2ca39031f12d93b8aab66 100644 --- a/tasks/0088_720_88720224_qa_1/task.toml +++ b/tasks/0088_720_88720224_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_720_88720224_qa_2/environment/bootstrap.sh b/tasks/0088_720_88720224_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_720_88720224_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_720_88720224_qa_2/environment/pull_bucket.py b/tasks/0088_720_88720224_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_720_88720224_qa_2/environment/pull_bucket.py +++ b/tasks/0088_720_88720224_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_720_88720224_qa_2/task.toml b/tasks/0088_720_88720224_qa_2/task.toml index f81d36dc83182a817d9026c0a5164e143953a531..7d396b69dc34f47af6b54d6d037c275d3b4f218e 100644 --- a/tasks/0088_720_88720224_qa_2/task.toml +++ b/tasks/0088_720_88720224_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_720_88720224_qa_3/environment/bootstrap.sh b/tasks/0088_720_88720224_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_720_88720224_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_720_88720224_qa_3/environment/pull_bucket.py b/tasks/0088_720_88720224_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_720_88720224_qa_3/environment/pull_bucket.py +++ b/tasks/0088_720_88720224_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_720_88720224_qa_3/task.toml b/tasks/0088_720_88720224_qa_3/task.toml index 3d00f6c9b826ad8325572f1a33a64ec4a1efef2c..994343423a23d956e6a6d3521d3d21ef0dc41163 100644 --- a/tasks/0088_720_88720224_qa_3/task.toml +++ b/tasks/0088_720_88720224_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_720_88720224_qa_4/environment/bootstrap.sh b/tasks/0088_720_88720224_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_720_88720224_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_720_88720224_qa_4/environment/pull_bucket.py b/tasks/0088_720_88720224_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_720_88720224_qa_4/environment/pull_bucket.py +++ b/tasks/0088_720_88720224_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_720_88720224_qa_4/task.toml b/tasks/0088_720_88720224_qa_4/task.toml index f273532bbf4bccdfbae067d684c02e46e2a75d5f..06a355cdc70cc8d003b7a554a59d9f05df214892 100644 --- a/tasks/0088_720_88720224_qa_4/task.toml +++ b/tasks/0088_720_88720224_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_736_88736093_qa_5/environment/bootstrap.sh b/tasks/0088_736_88736093_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_736_88736093_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_736_88736093_qa_5/environment/pull_bucket.py b/tasks/0088_736_88736093_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_736_88736093_qa_5/environment/pull_bucket.py +++ b/tasks/0088_736_88736093_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_736_88736093_qa_5/task.toml b/tasks/0088_736_88736093_qa_5/task.toml index 3248b3193f1953f1a7766cb938755ee92d696171..d88ab7d2785f78b912a9399fd0ed61dafb8b9c03 100644 --- a/tasks/0088_736_88736093_qa_5/task.toml +++ b/tasks/0088_736_88736093_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_822_88822681_qa_1/environment/bootstrap.sh b/tasks/0088_822_88822681_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_822_88822681_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_822_88822681_qa_1/environment/pull_bucket.py b/tasks/0088_822_88822681_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_822_88822681_qa_1/environment/pull_bucket.py +++ b/tasks/0088_822_88822681_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_822_88822681_qa_1/task.toml b/tasks/0088_822_88822681_qa_1/task.toml index 73ce24e17b5a3b553199e8e9ee56507c86d91d7f..c8a589d45c849e6a14c614a4ea1f19006f2b4482 100644 --- a/tasks/0088_822_88822681_qa_1/task.toml +++ b/tasks/0088_822_88822681_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_860_88860848_qa_2/environment/bootstrap.sh b/tasks/0088_860_88860848_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_860_88860848_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_860_88860848_qa_2/environment/pull_bucket.py b/tasks/0088_860_88860848_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_860_88860848_qa_2/environment/pull_bucket.py +++ b/tasks/0088_860_88860848_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_860_88860848_qa_2/task.toml b/tasks/0088_860_88860848_qa_2/task.toml index 98ec3aabcd7b8103f78804ec15261cb6b915df67..2b7fd71f165e64cd0a924534c8170c384de59e80 100644 --- a/tasks/0088_860_88860848_qa_2/task.toml +++ b/tasks/0088_860_88860848_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_860_88860848_qa_4/environment/bootstrap.sh b/tasks/0088_860_88860848_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_860_88860848_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_860_88860848_qa_4/environment/pull_bucket.py b/tasks/0088_860_88860848_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_860_88860848_qa_4/environment/pull_bucket.py +++ b/tasks/0088_860_88860848_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_860_88860848_qa_4/task.toml b/tasks/0088_860_88860848_qa_4/task.toml index f07115d70f6a5712cb3f802b3327b78bdd454257..ac27ee374e4c604edf57787c3612c6a11d8556e8 100644 --- a/tasks/0088_860_88860848_qa_4/task.toml +++ b/tasks/0088_860_88860848_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_961_88961970_qa_1/environment/bootstrap.sh b/tasks/0088_961_88961970_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_961_88961970_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_961_88961970_qa_1/environment/pull_bucket.py b/tasks/0088_961_88961970_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_961_88961970_qa_1/environment/pull_bucket.py +++ b/tasks/0088_961_88961970_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_961_88961970_qa_1/task.toml b/tasks/0088_961_88961970_qa_1/task.toml index 514c72f2f04358c17d6988589c0aabb2a99fa95e..ddb0f2fe862eca975939e46dab11a912d8fb83f6 100644 --- a/tasks/0088_961_88961970_qa_1/task.toml +++ b/tasks/0088_961_88961970_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_961_88961970_qa_4/environment/bootstrap.sh b/tasks/0088_961_88961970_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_961_88961970_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_961_88961970_qa_4/environment/pull_bucket.py b/tasks/0088_961_88961970_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_961_88961970_qa_4/environment/pull_bucket.py +++ b/tasks/0088_961_88961970_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_961_88961970_qa_4/task.toml b/tasks/0088_961_88961970_qa_4/task.toml index c150c4a45a90555574814353301158de5bd1c45e..7efd766d1fcaeb13a10ae1b0fc8f9ae1d3adb94b 100644 --- a/tasks/0088_961_88961970_qa_4/task.toml +++ b/tasks/0088_961_88961970_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0088_996_88996860_qa_1/environment/bootstrap.sh b/tasks/0088_996_88996860_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0088_996_88996860_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0088_996_88996860_qa_1/environment/pull_bucket.py b/tasks/0088_996_88996860_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0088_996_88996860_qa_1/environment/pull_bucket.py +++ b/tasks/0088_996_88996860_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0088_996_88996860_qa_1/task.toml b/tasks/0088_996_88996860_qa_1/task.toml index a67b3555facd340a2733cb248f0039fb938b1e27..714eb330ec30f93f88e4a60ec437b01ba929edc1 100644 --- a/tasks/0088_996_88996860_qa_1/task.toml +++ b/tasks/0088_996_88996860_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_026_89026160_qa_4/environment/bootstrap.sh b/tasks/0089_026_89026160_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_026_89026160_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_026_89026160_qa_4/environment/pull_bucket.py b/tasks/0089_026_89026160_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_026_89026160_qa_4/environment/pull_bucket.py +++ b/tasks/0089_026_89026160_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_026_89026160_qa_4/task.toml b/tasks/0089_026_89026160_qa_4/task.toml index 6020a134456929476c6f3ae13c8bc73f1474cf60..0c3c1f9b29408a53cad5940e856716eb11b9325e 100644 --- a/tasks/0089_026_89026160_qa_4/task.toml +++ b/tasks/0089_026_89026160_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_051_89051135_qa_2/environment/bootstrap.sh b/tasks/0089_051_89051135_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_051_89051135_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_051_89051135_qa_2/environment/pull_bucket.py b/tasks/0089_051_89051135_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_051_89051135_qa_2/environment/pull_bucket.py +++ b/tasks/0089_051_89051135_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_051_89051135_qa_2/task.toml b/tasks/0089_051_89051135_qa_2/task.toml index 805e4b876832201adeda2ec9feb61aa087d13f31..41892497187ec5926a1b5457bce42ee5383dc039 100644 --- a/tasks/0089_051_89051135_qa_2/task.toml +++ b/tasks/0089_051_89051135_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_075_89075568_qa_2/environment/bootstrap.sh b/tasks/0089_075_89075568_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_075_89075568_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_075_89075568_qa_2/environment/pull_bucket.py b/tasks/0089_075_89075568_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_075_89075568_qa_2/environment/pull_bucket.py +++ b/tasks/0089_075_89075568_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_075_89075568_qa_2/task.toml b/tasks/0089_075_89075568_qa_2/task.toml index 00d93d1d30ff95d943b59f9d50df88b14d9a8967..732a7d73a97b433a28c92bc2111f6de861e9417e 100644 --- a/tasks/0089_075_89075568_qa_2/task.toml +++ b/tasks/0089_075_89075568_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_129_89129153_qa_1/environment/bootstrap.sh b/tasks/0089_129_89129153_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_129_89129153_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_129_89129153_qa_1/environment/pull_bucket.py b/tasks/0089_129_89129153_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_129_89129153_qa_1/environment/pull_bucket.py +++ b/tasks/0089_129_89129153_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_129_89129153_qa_1/task.toml b/tasks/0089_129_89129153_qa_1/task.toml index 03e6e1843d764b2c0d79ee32870fbc39fa406568..245c516d5428e1d7afe48d4f06ae9acaa756bb30 100644 --- a/tasks/0089_129_89129153_qa_1/task.toml +++ b/tasks/0089_129_89129153_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_129_89129153_qa_3/environment/bootstrap.sh b/tasks/0089_129_89129153_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_129_89129153_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_129_89129153_qa_3/environment/pull_bucket.py b/tasks/0089_129_89129153_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_129_89129153_qa_3/environment/pull_bucket.py +++ b/tasks/0089_129_89129153_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_129_89129153_qa_3/task.toml b/tasks/0089_129_89129153_qa_3/task.toml index 7c570d1db8922e627366ee09f373106e2a78804f..77116efb8db4f30907649fb1a850362d0a1a9b08 100644 --- a/tasks/0089_129_89129153_qa_3/task.toml +++ b/tasks/0089_129_89129153_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_171_89171933_qa_3/environment/bootstrap.sh b/tasks/0089_171_89171933_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_171_89171933_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_171_89171933_qa_3/environment/pull_bucket.py b/tasks/0089_171_89171933_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_171_89171933_qa_3/environment/pull_bucket.py +++ b/tasks/0089_171_89171933_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_171_89171933_qa_3/task.toml b/tasks/0089_171_89171933_qa_3/task.toml index 493a417dbcaa800aa4baf7c742262f8653d9c421..74992c0acc92350b756b6f0227c7fe2c8de7ff40 100644 --- a/tasks/0089_171_89171933_qa_3/task.toml +++ b/tasks/0089_171_89171933_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_171_89171933_qa_4/environment/bootstrap.sh b/tasks/0089_171_89171933_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_171_89171933_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_171_89171933_qa_4/environment/pull_bucket.py b/tasks/0089_171_89171933_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_171_89171933_qa_4/environment/pull_bucket.py +++ b/tasks/0089_171_89171933_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_171_89171933_qa_4/task.toml b/tasks/0089_171_89171933_qa_4/task.toml index 71406031dfa8777ede2852c533787db680b1cc81..e567776e19e76ba13c56af57b717269f7f995233 100644 --- a/tasks/0089_171_89171933_qa_4/task.toml +++ b/tasks/0089_171_89171933_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_217_89217936_qa_2/environment/bootstrap.sh b/tasks/0089_217_89217936_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_217_89217936_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_217_89217936_qa_2/environment/pull_bucket.py b/tasks/0089_217_89217936_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_217_89217936_qa_2/environment/pull_bucket.py +++ b/tasks/0089_217_89217936_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_217_89217936_qa_2/task.toml b/tasks/0089_217_89217936_qa_2/task.toml index 22047d81929896d73a5ff240730401558404a1ab..c3699908cfc8251211c5ef147cb20e27b8b57714 100644 --- a/tasks/0089_217_89217936_qa_2/task.toml +++ b/tasks/0089_217_89217936_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_255_89255842_qa_4/environment/bootstrap.sh b/tasks/0089_255_89255842_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_255_89255842_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_255_89255842_qa_4/environment/pull_bucket.py b/tasks/0089_255_89255842_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_255_89255842_qa_4/environment/pull_bucket.py +++ b/tasks/0089_255_89255842_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_255_89255842_qa_4/task.toml b/tasks/0089_255_89255842_qa_4/task.toml index 96e32b853952e31939c814e769f68ad3b6b31b52..04aa5e2065c29ebc653b6a4052acfc4b70e8acc1 100644 --- a/tasks/0089_255_89255842_qa_4/task.toml +++ b/tasks/0089_255_89255842_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_279_89279140_qa_5/environment/bootstrap.sh b/tasks/0089_279_89279140_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_279_89279140_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_279_89279140_qa_5/environment/pull_bucket.py b/tasks/0089_279_89279140_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_279_89279140_qa_5/environment/pull_bucket.py +++ b/tasks/0089_279_89279140_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_279_89279140_qa_5/task.toml b/tasks/0089_279_89279140_qa_5/task.toml index aa72c068c055c3f2436afe775137e80e4267ec3c..1827191c29c911d86a8a47ed5290b2bb8caf2139 100644 --- a/tasks/0089_279_89279140_qa_5/task.toml +++ b/tasks/0089_279_89279140_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_290_89290915_qa_3/environment/bootstrap.sh b/tasks/0089_290_89290915_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_290_89290915_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_290_89290915_qa_3/environment/pull_bucket.py b/tasks/0089_290_89290915_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_290_89290915_qa_3/environment/pull_bucket.py +++ b/tasks/0089_290_89290915_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_290_89290915_qa_3/task.toml b/tasks/0089_290_89290915_qa_3/task.toml index 1041fd598a5dbce338bb46f4fe57165e62760de3..f307fd2ab3da5dd89aeda5a22fcde6e4b8cec940 100644 --- a/tasks/0089_290_89290915_qa_3/task.toml +++ b/tasks/0089_290_89290915_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_290_89290915_qa_5/environment/bootstrap.sh b/tasks/0089_290_89290915_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_290_89290915_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_290_89290915_qa_5/environment/pull_bucket.py b/tasks/0089_290_89290915_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_290_89290915_qa_5/environment/pull_bucket.py +++ b/tasks/0089_290_89290915_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_290_89290915_qa_5/task.toml b/tasks/0089_290_89290915_qa_5/task.toml index a3d03746ee239d78ec26107eab3a7b7335fb9b32..c093548ad16f90482b30461cf82d71f5b1be49ee 100644 --- a/tasks/0089_290_89290915_qa_5/task.toml +++ b/tasks/0089_290_89290915_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_547_89547343_qa_2/environment/bootstrap.sh b/tasks/0089_547_89547343_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_547_89547343_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_547_89547343_qa_2/environment/pull_bucket.py b/tasks/0089_547_89547343_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_547_89547343_qa_2/environment/pull_bucket.py +++ b/tasks/0089_547_89547343_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_547_89547343_qa_2/task.toml b/tasks/0089_547_89547343_qa_2/task.toml index 3b21d3331db70a1be8fd9261fc680ffd6cda14ed..b170e567a570df703ee93d53f42a31489a5afcec 100644 --- a/tasks/0089_547_89547343_qa_2/task.toml +++ b/tasks/0089_547_89547343_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_576_89576733_qa_4/environment/bootstrap.sh b/tasks/0089_576_89576733_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_576_89576733_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_576_89576733_qa_4/environment/pull_bucket.py b/tasks/0089_576_89576733_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_576_89576733_qa_4/environment/pull_bucket.py +++ b/tasks/0089_576_89576733_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_576_89576733_qa_4/task.toml b/tasks/0089_576_89576733_qa_4/task.toml index 43db5058794e9251fc21fa4436cfb54d80783c1a..b57df5aa858d97d4bf7d9d3573691cdb5db7ccd8 100644 --- a/tasks/0089_576_89576733_qa_4/task.toml +++ b/tasks/0089_576_89576733_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_589_89589668_qa_1/environment/bootstrap.sh b/tasks/0089_589_89589668_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_589_89589668_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_589_89589668_qa_1/environment/pull_bucket.py b/tasks/0089_589_89589668_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_589_89589668_qa_1/environment/pull_bucket.py +++ b/tasks/0089_589_89589668_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_589_89589668_qa_1/task.toml b/tasks/0089_589_89589668_qa_1/task.toml index f47f6e13ea766a72f4cf87dae692f5d7ea34e0f3..5b2b8f02bba4d032f38068ed73ea734e0f4cb6ba 100644 --- a/tasks/0089_589_89589668_qa_1/task.toml +++ b/tasks/0089_589_89589668_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_601_89601148_qa_3/environment/bootstrap.sh b/tasks/0089_601_89601148_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_601_89601148_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_601_89601148_qa_3/environment/pull_bucket.py b/tasks/0089_601_89601148_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_601_89601148_qa_3/environment/pull_bucket.py +++ b/tasks/0089_601_89601148_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_601_89601148_qa_3/task.toml b/tasks/0089_601_89601148_qa_3/task.toml index e7123e1ccd4bc7df352353d3d26695209158051c..760f3a3cba0e5714b1b22f0b069f9d127b2a30a4 100644 --- a/tasks/0089_601_89601148_qa_3/task.toml +++ b/tasks/0089_601_89601148_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_603_89603255_qa_1/environment/bootstrap.sh b/tasks/0089_603_89603255_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_603_89603255_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_603_89603255_qa_1/environment/pull_bucket.py b/tasks/0089_603_89603255_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_603_89603255_qa_1/environment/pull_bucket.py +++ b/tasks/0089_603_89603255_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_603_89603255_qa_1/task.toml b/tasks/0089_603_89603255_qa_1/task.toml index 444ec06d9211a9114f2f39869042a0ddfe66c888..050f4b3860ca401ce9c7e60f6a6683ea4595574a 100644 --- a/tasks/0089_603_89603255_qa_1/task.toml +++ b/tasks/0089_603_89603255_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_604_89604836_qa_2/environment/bootstrap.sh b/tasks/0089_604_89604836_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_604_89604836_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_604_89604836_qa_2/environment/pull_bucket.py b/tasks/0089_604_89604836_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_604_89604836_qa_2/environment/pull_bucket.py +++ b/tasks/0089_604_89604836_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_604_89604836_qa_2/task.toml b/tasks/0089_604_89604836_qa_2/task.toml index 42c9bcef3b6074e0a51707fb307802edf09babdf..d2f08a427fb7b3d6053583a9737155021e851f04 100644 --- a/tasks/0089_604_89604836_qa_2/task.toml +++ b/tasks/0089_604_89604836_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_604_89604836_qa_4/environment/bootstrap.sh b/tasks/0089_604_89604836_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_604_89604836_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_604_89604836_qa_4/environment/pull_bucket.py b/tasks/0089_604_89604836_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_604_89604836_qa_4/environment/pull_bucket.py +++ b/tasks/0089_604_89604836_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_604_89604836_qa_4/task.toml b/tasks/0089_604_89604836_qa_4/task.toml index 02f02f678edd20473d2d53130864625ee4f0ad48..f41b27fbb9c0678edeb821c62ccff25a81982a6f 100644 --- a/tasks/0089_604_89604836_qa_4/task.toml +++ b/tasks/0089_604_89604836_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_604_89604836_qa_5/environment/bootstrap.sh b/tasks/0089_604_89604836_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_604_89604836_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_604_89604836_qa_5/environment/pull_bucket.py b/tasks/0089_604_89604836_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_604_89604836_qa_5/environment/pull_bucket.py +++ b/tasks/0089_604_89604836_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_604_89604836_qa_5/task.toml b/tasks/0089_604_89604836_qa_5/task.toml index 7df051d392de82d9d8c8b8c6fd7437b8465ce647..7dbf8f1d3a3739feab911a31b22e3080c17bbae8 100644 --- a/tasks/0089_604_89604836_qa_5/task.toml +++ b/tasks/0089_604_89604836_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_613_89613351_qa_4/environment/bootstrap.sh b/tasks/0089_613_89613351_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_613_89613351_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_613_89613351_qa_4/environment/pull_bucket.py b/tasks/0089_613_89613351_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_613_89613351_qa_4/environment/pull_bucket.py +++ b/tasks/0089_613_89613351_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_613_89613351_qa_4/task.toml b/tasks/0089_613_89613351_qa_4/task.toml index edf545ff1b78bd097d2efd0f3503d89cea83d08f..417bf045fbf723a34eb35fc8753a778be596f1e6 100644 --- a/tasks/0089_613_89613351_qa_4/task.toml +++ b/tasks/0089_613_89613351_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_696_89696158_qa_1/environment/bootstrap.sh b/tasks/0089_696_89696158_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_696_89696158_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_696_89696158_qa_1/environment/pull_bucket.py b/tasks/0089_696_89696158_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_696_89696158_qa_1/environment/pull_bucket.py +++ b/tasks/0089_696_89696158_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_696_89696158_qa_1/task.toml b/tasks/0089_696_89696158_qa_1/task.toml index 4cec578cd63c266d131b483e3781ebe877fac305..8859d4bea4cac2b8ccdc6d19213cd6cd2ad73adc 100644 --- a/tasks/0089_696_89696158_qa_1/task.toml +++ b/tasks/0089_696_89696158_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_704_89704261_qa_1/environment/bootstrap.sh b/tasks/0089_704_89704261_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_704_89704261_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_704_89704261_qa_1/environment/pull_bucket.py b/tasks/0089_704_89704261_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_704_89704261_qa_1/environment/pull_bucket.py +++ b/tasks/0089_704_89704261_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_704_89704261_qa_1/task.toml b/tasks/0089_704_89704261_qa_1/task.toml index 3addb2fa1fad04aa68b5616b218b4bc7fb46f0c5..75125971c7706b07b9d7d7d68142bea103183882 100644 --- a/tasks/0089_704_89704261_qa_1/task.toml +++ b/tasks/0089_704_89704261_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_704_89704261_qa_5/environment/bootstrap.sh b/tasks/0089_704_89704261_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_704_89704261_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_704_89704261_qa_5/environment/pull_bucket.py b/tasks/0089_704_89704261_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_704_89704261_qa_5/environment/pull_bucket.py +++ b/tasks/0089_704_89704261_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_704_89704261_qa_5/task.toml b/tasks/0089_704_89704261_qa_5/task.toml index 34b965d94f575e668228125d97bb288cb1ca08f3..cf5ac3fa2f11832fbcba529b55d938e12769e357 100644 --- a/tasks/0089_704_89704261_qa_5/task.toml +++ b/tasks/0089_704_89704261_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_775_89775918_qa_4/environment/bootstrap.sh b/tasks/0089_775_89775918_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_775_89775918_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_775_89775918_qa_4/environment/pull_bucket.py b/tasks/0089_775_89775918_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_775_89775918_qa_4/environment/pull_bucket.py +++ b/tasks/0089_775_89775918_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_775_89775918_qa_4/task.toml b/tasks/0089_775_89775918_qa_4/task.toml index 14506de07a875a9aabb02e96d45781fc82121a80..876c54996aaa00e540c6e1caff0605c0a2a148ba 100644 --- a/tasks/0089_775_89775918_qa_4/task.toml +++ b/tasks/0089_775_89775918_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_787_89787610_qa_1/environment/bootstrap.sh b/tasks/0089_787_89787610_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_787_89787610_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_787_89787610_qa_1/environment/pull_bucket.py b/tasks/0089_787_89787610_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_787_89787610_qa_1/environment/pull_bucket.py +++ b/tasks/0089_787_89787610_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_787_89787610_qa_1/task.toml b/tasks/0089_787_89787610_qa_1/task.toml index 77bb718383c0c070733b61e641b0d56eac4f6ed3..d62fffb02b2c49dadb3abbfebf5665cb63f43daf 100644 --- a/tasks/0089_787_89787610_qa_1/task.toml +++ b/tasks/0089_787_89787610_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_787_89787610_qa_4/environment/bootstrap.sh b/tasks/0089_787_89787610_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_787_89787610_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_787_89787610_qa_4/environment/pull_bucket.py b/tasks/0089_787_89787610_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_787_89787610_qa_4/environment/pull_bucket.py +++ b/tasks/0089_787_89787610_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_787_89787610_qa_4/task.toml b/tasks/0089_787_89787610_qa_4/task.toml index 0aa648a201c2494c4671eafcf74e9abe7b479dbc..28e4c41378d07f8864ed92965e632041658ea510 100644 --- a/tasks/0089_787_89787610_qa_4/task.toml +++ b/tasks/0089_787_89787610_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_804_89804602_qa_4/environment/bootstrap.sh b/tasks/0089_804_89804602_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_804_89804602_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_804_89804602_qa_4/environment/pull_bucket.py b/tasks/0089_804_89804602_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_804_89804602_qa_4/environment/pull_bucket.py +++ b/tasks/0089_804_89804602_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_804_89804602_qa_4/task.toml b/tasks/0089_804_89804602_qa_4/task.toml index 45fe52accdfec4e415940ce7fa4a05ff658b8abe..b0ac902fad599767172d7d6e44f1139feea1b2eb 100644 --- a/tasks/0089_804_89804602_qa_4/task.toml +++ b/tasks/0089_804_89804602_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_811_89811907_qa_3/environment/bootstrap.sh b/tasks/0089_811_89811907_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_811_89811907_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_811_89811907_qa_3/environment/pull_bucket.py b/tasks/0089_811_89811907_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_811_89811907_qa_3/environment/pull_bucket.py +++ b/tasks/0089_811_89811907_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_811_89811907_qa_3/task.toml b/tasks/0089_811_89811907_qa_3/task.toml index 69a22c6a71a10aa8531d53573a00b780baccafd4..709f57bc549ab75e559ef6c47ccf3868d2a2c3a0 100644 --- a/tasks/0089_811_89811907_qa_3/task.toml +++ b/tasks/0089_811_89811907_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0089_811_89811907_qa_4/environment/bootstrap.sh b/tasks/0089_811_89811907_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0089_811_89811907_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0089_811_89811907_qa_4/environment/pull_bucket.py b/tasks/0089_811_89811907_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0089_811_89811907_qa_4/environment/pull_bucket.py +++ b/tasks/0089_811_89811907_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0089_811_89811907_qa_4/task.toml b/tasks/0089_811_89811907_qa_4/task.toml index e05eb0f6430d60c33148f8ae70c3d0846e631210..d42ced3b8b7a06d26e22784285fb552367ed85eb 100644 --- a/tasks/0089_811_89811907_qa_4/task.toml +++ b/tasks/0089_811_89811907_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_012_90012642_qa_4/environment/bootstrap.sh b/tasks/0090_012_90012642_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_012_90012642_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_012_90012642_qa_4/environment/pull_bucket.py b/tasks/0090_012_90012642_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_012_90012642_qa_4/environment/pull_bucket.py +++ b/tasks/0090_012_90012642_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_012_90012642_qa_4/task.toml b/tasks/0090_012_90012642_qa_4/task.toml index 4d4a35f4efef014cee6531f19958e224c09c1537..ae56455944b1d1fd49bef412bfbb3362e7e76827 100644 --- a/tasks/0090_012_90012642_qa_4/task.toml +++ b/tasks/0090_012_90012642_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_020_90020807_qa_4/environment/bootstrap.sh b/tasks/0090_020_90020807_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_020_90020807_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_020_90020807_qa_4/environment/pull_bucket.py b/tasks/0090_020_90020807_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_020_90020807_qa_4/environment/pull_bucket.py +++ b/tasks/0090_020_90020807_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_020_90020807_qa_4/task.toml b/tasks/0090_020_90020807_qa_4/task.toml index b635ddce80871facad75171cedbf13477759fc9c..bd7544762b40ba31cc5f6915057527728d9c30e1 100644 --- a/tasks/0090_020_90020807_qa_4/task.toml +++ b/tasks/0090_020_90020807_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_233_90233145_qa_2/environment/bootstrap.sh b/tasks/0090_233_90233145_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_233_90233145_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_233_90233145_qa_2/environment/pull_bucket.py b/tasks/0090_233_90233145_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_233_90233145_qa_2/environment/pull_bucket.py +++ b/tasks/0090_233_90233145_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_233_90233145_qa_2/task.toml b/tasks/0090_233_90233145_qa_2/task.toml index 91789a96bf891759fa1c99478db3bdb25b6efa18..f83e4e84d949731dad56db81d0cc9a3f8a0a912a 100644 --- a/tasks/0090_233_90233145_qa_2/task.toml +++ b/tasks/0090_233_90233145_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_257_90257990_qa_1/environment/bootstrap.sh b/tasks/0090_257_90257990_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_257_90257990_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_257_90257990_qa_1/environment/pull_bucket.py b/tasks/0090_257_90257990_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_257_90257990_qa_1/environment/pull_bucket.py +++ b/tasks/0090_257_90257990_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_257_90257990_qa_1/task.toml b/tasks/0090_257_90257990_qa_1/task.toml index 4b702e92d62c82fb5cebf277a1ca2bf314cd32b3..5172250ab04f7a79aa0111050134246eb63fe921 100644 --- a/tasks/0090_257_90257990_qa_1/task.toml +++ b/tasks/0090_257_90257990_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_257_90257990_qa_4/environment/bootstrap.sh b/tasks/0090_257_90257990_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_257_90257990_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_257_90257990_qa_4/environment/pull_bucket.py b/tasks/0090_257_90257990_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_257_90257990_qa_4/environment/pull_bucket.py +++ b/tasks/0090_257_90257990_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_257_90257990_qa_4/task.toml b/tasks/0090_257_90257990_qa_4/task.toml index fc6c4ade9e5c92a536164d9cbac2ad1d0154b484..072197cc82d167d6d99344348045b233796423dd 100644 --- a/tasks/0090_257_90257990_qa_4/task.toml +++ b/tasks/0090_257_90257990_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_285_90285188_qa_3/environment/bootstrap.sh b/tasks/0090_285_90285188_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_285_90285188_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_285_90285188_qa_3/environment/pull_bucket.py b/tasks/0090_285_90285188_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_285_90285188_qa_3/environment/pull_bucket.py +++ b/tasks/0090_285_90285188_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_285_90285188_qa_3/task.toml b/tasks/0090_285_90285188_qa_3/task.toml index d643449fb57f8c1a205a0ae639b74323cf320d16..c3a04206949dc05ed58c0811790fb8bfc0c9baef 100644 --- a/tasks/0090_285_90285188_qa_3/task.toml +++ b/tasks/0090_285_90285188_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_285_90285188_qa_5/environment/bootstrap.sh b/tasks/0090_285_90285188_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_285_90285188_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_285_90285188_qa_5/environment/pull_bucket.py b/tasks/0090_285_90285188_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_285_90285188_qa_5/environment/pull_bucket.py +++ b/tasks/0090_285_90285188_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_285_90285188_qa_5/task.toml b/tasks/0090_285_90285188_qa_5/task.toml index df5c337a111c3102d3eeac363e08a5234e56f3f7..66771ae969560d30906152902d35800f6947825c 100644 --- a/tasks/0090_285_90285188_qa_5/task.toml +++ b/tasks/0090_285_90285188_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_301_90301818_qa_4/environment/bootstrap.sh b/tasks/0090_301_90301818_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_301_90301818_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_301_90301818_qa_4/environment/pull_bucket.py b/tasks/0090_301_90301818_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_301_90301818_qa_4/environment/pull_bucket.py +++ b/tasks/0090_301_90301818_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_301_90301818_qa_4/task.toml b/tasks/0090_301_90301818_qa_4/task.toml index ff241da2f03b9e8aba0e0770f29bd6eca7bb0b2a..12f32f7ca4366ea711350f86ee1375b80cda22e3 100644 --- a/tasks/0090_301_90301818_qa_4/task.toml +++ b/tasks/0090_301_90301818_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_327_90327261_qa_3/environment/bootstrap.sh b/tasks/0090_327_90327261_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_327_90327261_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_327_90327261_qa_3/environment/pull_bucket.py b/tasks/0090_327_90327261_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_327_90327261_qa_3/environment/pull_bucket.py +++ b/tasks/0090_327_90327261_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_327_90327261_qa_3/task.toml b/tasks/0090_327_90327261_qa_3/task.toml index 363288ac7f9352dc56136d358399f3f2838df7c8..4764cd2a2c643adc37234fe85fb77209877fbe67 100644 --- a/tasks/0090_327_90327261_qa_3/task.toml +++ b/tasks/0090_327_90327261_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_327_90327261_qa_4/environment/bootstrap.sh b/tasks/0090_327_90327261_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_327_90327261_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_327_90327261_qa_4/environment/pull_bucket.py b/tasks/0090_327_90327261_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_327_90327261_qa_4/environment/pull_bucket.py +++ b/tasks/0090_327_90327261_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_327_90327261_qa_4/task.toml b/tasks/0090_327_90327261_qa_4/task.toml index bc04bb5670e7311e571d938af415959af0ea348f..290291c769fcc07aa77059f72809a596f8357b3b 100644 --- a/tasks/0090_327_90327261_qa_4/task.toml +++ b/tasks/0090_327_90327261_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_327_90327261_qa_5/environment/bootstrap.sh b/tasks/0090_327_90327261_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_327_90327261_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_327_90327261_qa_5/environment/pull_bucket.py b/tasks/0090_327_90327261_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_327_90327261_qa_5/environment/pull_bucket.py +++ b/tasks/0090_327_90327261_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_327_90327261_qa_5/task.toml b/tasks/0090_327_90327261_qa_5/task.toml index d78231619b9b6790871e647af16a90c598d7344c..01adb9c8ebac42ccfe6fdc415f5124251b07e93a 100644 --- a/tasks/0090_327_90327261_qa_5/task.toml +++ b/tasks/0090_327_90327261_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_380_90380699_qa_3/environment/bootstrap.sh b/tasks/0090_380_90380699_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_380_90380699_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_380_90380699_qa_3/environment/pull_bucket.py b/tasks/0090_380_90380699_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_380_90380699_qa_3/environment/pull_bucket.py +++ b/tasks/0090_380_90380699_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_380_90380699_qa_3/task.toml b/tasks/0090_380_90380699_qa_3/task.toml index d2560ed764be3b06b95ac1eba9213d3a56e7a36f..0c1abe82c1927a62635c677ed607be9648f3064a 100644 --- a/tasks/0090_380_90380699_qa_3/task.toml +++ b/tasks/0090_380_90380699_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_428_90428964_qa_1/environment/bootstrap.sh b/tasks/0090_428_90428964_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_428_90428964_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_428_90428964_qa_1/environment/pull_bucket.py b/tasks/0090_428_90428964_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_428_90428964_qa_1/environment/pull_bucket.py +++ b/tasks/0090_428_90428964_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_428_90428964_qa_1/task.toml b/tasks/0090_428_90428964_qa_1/task.toml index be8a33feb5065baa80493eef341cbfd42c85a8ee..648620c50565b441b8eebbbfa0a352ccbd9d3627 100644 --- a/tasks/0090_428_90428964_qa_1/task.toml +++ b/tasks/0090_428_90428964_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_428_90428964_qa_4/environment/bootstrap.sh b/tasks/0090_428_90428964_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_428_90428964_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_428_90428964_qa_4/environment/pull_bucket.py b/tasks/0090_428_90428964_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_428_90428964_qa_4/environment/pull_bucket.py +++ b/tasks/0090_428_90428964_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_428_90428964_qa_4/task.toml b/tasks/0090_428_90428964_qa_4/task.toml index 05dfc8798d49e6522b89d530e8a81d0bf22b9847..9d97fe9337c97bf02cb04df54ef120c7398e923b 100644 --- a/tasks/0090_428_90428964_qa_4/task.toml +++ b/tasks/0090_428_90428964_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_436_90436320_qa_1/environment/bootstrap.sh b/tasks/0090_436_90436320_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_436_90436320_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_436_90436320_qa_1/environment/pull_bucket.py b/tasks/0090_436_90436320_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_436_90436320_qa_1/environment/pull_bucket.py +++ b/tasks/0090_436_90436320_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_436_90436320_qa_1/task.toml b/tasks/0090_436_90436320_qa_1/task.toml index 1054c1fae444c28c2afa2aa16f5caaf89db61c17..3c4eba6de55a0fbf66a1c989bea9b80b32f9fac6 100644 --- a/tasks/0090_436_90436320_qa_1/task.toml +++ b/tasks/0090_436_90436320_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_524_90524053_qa_1/environment/bootstrap.sh b/tasks/0090_524_90524053_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_524_90524053_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_524_90524053_qa_1/environment/pull_bucket.py b/tasks/0090_524_90524053_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_524_90524053_qa_1/environment/pull_bucket.py +++ b/tasks/0090_524_90524053_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_524_90524053_qa_1/task.toml b/tasks/0090_524_90524053_qa_1/task.toml index 9a6ad73b308a92ddc773ab52daade79c4db961b7..ba06b44c744b65ad97a27b2e8d96d4ccf34b0527 100644 --- a/tasks/0090_524_90524053_qa_1/task.toml +++ b/tasks/0090_524_90524053_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_524_90524053_qa_2/environment/bootstrap.sh b/tasks/0090_524_90524053_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_524_90524053_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_524_90524053_qa_2/environment/pull_bucket.py b/tasks/0090_524_90524053_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_524_90524053_qa_2/environment/pull_bucket.py +++ b/tasks/0090_524_90524053_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_524_90524053_qa_2/task.toml b/tasks/0090_524_90524053_qa_2/task.toml index 02dec093b230c3dd31a1eb58e8bda82b5c25c004..4911fb0bb1dfcabdded10700ae72043d2e910a70 100644 --- a/tasks/0090_524_90524053_qa_2/task.toml +++ b/tasks/0090_524_90524053_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_524_90524053_qa_5/environment/bootstrap.sh b/tasks/0090_524_90524053_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_524_90524053_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_524_90524053_qa_5/environment/pull_bucket.py b/tasks/0090_524_90524053_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_524_90524053_qa_5/environment/pull_bucket.py +++ b/tasks/0090_524_90524053_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_524_90524053_qa_5/task.toml b/tasks/0090_524_90524053_qa_5/task.toml index 8530e4ef54dce896d18459726cdc46c6cd41b0f2..b4dd936d20238990a611c14d5c28389be27a6cc4 100644 --- a/tasks/0090_524_90524053_qa_5/task.toml +++ b/tasks/0090_524_90524053_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_607_90607840_qa_3/environment/bootstrap.sh b/tasks/0090_607_90607840_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_607_90607840_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_607_90607840_qa_3/environment/pull_bucket.py b/tasks/0090_607_90607840_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_607_90607840_qa_3/environment/pull_bucket.py +++ b/tasks/0090_607_90607840_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_607_90607840_qa_3/task.toml b/tasks/0090_607_90607840_qa_3/task.toml index f5b89f9f58a54a39c8236f03cafd494a8ceeca03..84498c63362f6d70c440cca2f69e7ad3fb084d81 100644 --- a/tasks/0090_607_90607840_qa_3/task.toml +++ b/tasks/0090_607_90607840_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_607_90607840_qa_4/environment/bootstrap.sh b/tasks/0090_607_90607840_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_607_90607840_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_607_90607840_qa_4/environment/pull_bucket.py b/tasks/0090_607_90607840_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_607_90607840_qa_4/environment/pull_bucket.py +++ b/tasks/0090_607_90607840_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_607_90607840_qa_4/task.toml b/tasks/0090_607_90607840_qa_4/task.toml index 5375c1b6eb1b84767120b5d777371309f2702a68..efebc86d376ee3fe190aa316f7bf63c6fe4e7764 100644 --- a/tasks/0090_607_90607840_qa_4/task.toml +++ b/tasks/0090_607_90607840_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_629_90629430_qa_1/environment/bootstrap.sh b/tasks/0090_629_90629430_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_629_90629430_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_629_90629430_qa_1/environment/pull_bucket.py b/tasks/0090_629_90629430_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_629_90629430_qa_1/environment/pull_bucket.py +++ b/tasks/0090_629_90629430_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_629_90629430_qa_1/task.toml b/tasks/0090_629_90629430_qa_1/task.toml index 36bc6e717ad616f4dd6d427a4bd97948f90f60c2..e2476684e1ca8afb172ec231841adba54af7a2b0 100644 --- a/tasks/0090_629_90629430_qa_1/task.toml +++ b/tasks/0090_629_90629430_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_648_90648013_qa_1/environment/bootstrap.sh b/tasks/0090_648_90648013_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_648_90648013_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_648_90648013_qa_1/environment/pull_bucket.py b/tasks/0090_648_90648013_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_648_90648013_qa_1/environment/pull_bucket.py +++ b/tasks/0090_648_90648013_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_648_90648013_qa_1/task.toml b/tasks/0090_648_90648013_qa_1/task.toml index 44dd00ad2bb81b20a18d1adeff5c2af47d8bd312..c3ac11b6de46e201f5a270f202685cda0f882ad2 100644 --- a/tasks/0090_648_90648013_qa_1/task.toml +++ b/tasks/0090_648_90648013_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_648_90648013_qa_4/environment/bootstrap.sh b/tasks/0090_648_90648013_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_648_90648013_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_648_90648013_qa_4/environment/pull_bucket.py b/tasks/0090_648_90648013_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_648_90648013_qa_4/environment/pull_bucket.py +++ b/tasks/0090_648_90648013_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_648_90648013_qa_4/task.toml b/tasks/0090_648_90648013_qa_4/task.toml index 5a3397818c110629a11508df8207fcee0af66f5c..d12141cf0c70b23293aa6215948419660c66f497 100644 --- a/tasks/0090_648_90648013_qa_4/task.toml +++ b/tasks/0090_648_90648013_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_720_90720010_qa_2/environment/bootstrap.sh b/tasks/0090_720_90720010_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_720_90720010_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_720_90720010_qa_2/environment/pull_bucket.py b/tasks/0090_720_90720010_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_720_90720010_qa_2/environment/pull_bucket.py +++ b/tasks/0090_720_90720010_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_720_90720010_qa_2/task.toml b/tasks/0090_720_90720010_qa_2/task.toml index 7700dc96b5b70caf7f167450af47df1173027c20..d4efbaf6767599b4783168104fd8b358d401c581 100644 --- a/tasks/0090_720_90720010_qa_2/task.toml +++ b/tasks/0090_720_90720010_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_720_90720010_qa_3/environment/bootstrap.sh b/tasks/0090_720_90720010_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_720_90720010_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_720_90720010_qa_3/environment/pull_bucket.py b/tasks/0090_720_90720010_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_720_90720010_qa_3/environment/pull_bucket.py +++ b/tasks/0090_720_90720010_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_720_90720010_qa_3/task.toml b/tasks/0090_720_90720010_qa_3/task.toml index 8fe285de4842a60c34364a9b8509da042c2d568b..bce69152f069f20075659eff492b4fc13b847cb7 100644 --- a/tasks/0090_720_90720010_qa_3/task.toml +++ b/tasks/0090_720_90720010_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_728_90728839_qa_3/environment/bootstrap.sh b/tasks/0090_728_90728839_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_728_90728839_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_728_90728839_qa_3/environment/pull_bucket.py b/tasks/0090_728_90728839_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_728_90728839_qa_3/environment/pull_bucket.py +++ b/tasks/0090_728_90728839_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_728_90728839_qa_3/task.toml b/tasks/0090_728_90728839_qa_3/task.toml index 66e89e2de373e78dca63383182922d580461cba0..6bbd0f246657e1b2a36196d9c58aded9ee54ebdc 100644 --- a/tasks/0090_728_90728839_qa_3/task.toml +++ b/tasks/0090_728_90728839_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_749_90749607_qa_5/environment/bootstrap.sh b/tasks/0090_749_90749607_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_749_90749607_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_749_90749607_qa_5/environment/pull_bucket.py b/tasks/0090_749_90749607_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_749_90749607_qa_5/environment/pull_bucket.py +++ b/tasks/0090_749_90749607_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_749_90749607_qa_5/task.toml b/tasks/0090_749_90749607_qa_5/task.toml index 376baea161ee3f6a3c81d3caf9c06c066bab6b2c..1df920a726ad21328f8c67b1722542ac045aed78 100644 --- a/tasks/0090_749_90749607_qa_5/task.toml +++ b/tasks/0090_749_90749607_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_760_90760347_qa_2/environment/bootstrap.sh b/tasks/0090_760_90760347_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_760_90760347_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_760_90760347_qa_2/environment/pull_bucket.py b/tasks/0090_760_90760347_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_760_90760347_qa_2/environment/pull_bucket.py +++ b/tasks/0090_760_90760347_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_760_90760347_qa_2/task.toml b/tasks/0090_760_90760347_qa_2/task.toml index 030bafaa1e5400ba45889058032a8a48ad395eea..937b4e44874ac90b6188f9d1847138e918f0b37d 100644 --- a/tasks/0090_760_90760347_qa_2/task.toml +++ b/tasks/0090_760_90760347_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_760_90760347_qa_4/environment/bootstrap.sh b/tasks/0090_760_90760347_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_760_90760347_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_760_90760347_qa_4/environment/pull_bucket.py b/tasks/0090_760_90760347_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_760_90760347_qa_4/environment/pull_bucket.py +++ b/tasks/0090_760_90760347_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_760_90760347_qa_4/task.toml b/tasks/0090_760_90760347_qa_4/task.toml index 46b21f539d4290f5c97982087712cfc02eaf1df6..5d733fd8c4c7ffa25a4087d8ba266af9dd54bb57 100644 --- a/tasks/0090_760_90760347_qa_4/task.toml +++ b/tasks/0090_760_90760347_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0090_941_90941195_qa_2/environment/bootstrap.sh b/tasks/0090_941_90941195_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0090_941_90941195_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0090_941_90941195_qa_2/environment/pull_bucket.py b/tasks/0090_941_90941195_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0090_941_90941195_qa_2/environment/pull_bucket.py +++ b/tasks/0090_941_90941195_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0090_941_90941195_qa_2/task.toml b/tasks/0090_941_90941195_qa_2/task.toml index 0746b11cbb60b46e7df172b175e62479543c7f3d..67f6f62a7073557a55883c7fb8eb6ce51403cafb 100644 --- a/tasks/0090_941_90941195_qa_2/task.toml +++ b/tasks/0090_941_90941195_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_031_91031611_qa_2/environment/bootstrap.sh b/tasks/0091_031_91031611_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_031_91031611_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_031_91031611_qa_2/environment/pull_bucket.py b/tasks/0091_031_91031611_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_031_91031611_qa_2/environment/pull_bucket.py +++ b/tasks/0091_031_91031611_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_031_91031611_qa_2/task.toml b/tasks/0091_031_91031611_qa_2/task.toml index fd0602f4e3aa8071229fcdb64cadb8b00741897f..2e6db527b89160649cef5acf533a3cce24dda74b 100644 --- a/tasks/0091_031_91031611_qa_2/task.toml +++ b/tasks/0091_031_91031611_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_122_91122496_qa_5/environment/bootstrap.sh b/tasks/0091_122_91122496_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_122_91122496_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_122_91122496_qa_5/environment/pull_bucket.py b/tasks/0091_122_91122496_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_122_91122496_qa_5/environment/pull_bucket.py +++ b/tasks/0091_122_91122496_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_122_91122496_qa_5/task.toml b/tasks/0091_122_91122496_qa_5/task.toml index 469b5c8b653b89b1b33298e012f72d9c410df792..76ac7ddb2cfe653f8ae0103c31b90fbe9b78f399 100644 --- a/tasks/0091_122_91122496_qa_5/task.toml +++ b/tasks/0091_122_91122496_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_124_91124471_qa_1/environment/bootstrap.sh b/tasks/0091_124_91124471_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_124_91124471_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_124_91124471_qa_1/environment/pull_bucket.py b/tasks/0091_124_91124471_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_124_91124471_qa_1/environment/pull_bucket.py +++ b/tasks/0091_124_91124471_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_124_91124471_qa_1/task.toml b/tasks/0091_124_91124471_qa_1/task.toml index 74ac2e58bc1de5d0164c701f9b5ea3b310979411..83011803c41a372795ce073a670830f6ac99bcf4 100644 --- a/tasks/0091_124_91124471_qa_1/task.toml +++ b/tasks/0091_124_91124471_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_153_91153202_qa_3/environment/bootstrap.sh b/tasks/0091_153_91153202_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_153_91153202_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_153_91153202_qa_3/environment/pull_bucket.py b/tasks/0091_153_91153202_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_153_91153202_qa_3/environment/pull_bucket.py +++ b/tasks/0091_153_91153202_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_153_91153202_qa_3/task.toml b/tasks/0091_153_91153202_qa_3/task.toml index 6d88c434191c9eac7c2ed60749a7260dbbd70639..0f3953e569ab60a0dd1866f5a5ca9d9a960cb7c4 100644 --- a/tasks/0091_153_91153202_qa_3/task.toml +++ b/tasks/0091_153_91153202_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_212_91212287_qa_3/environment/bootstrap.sh b/tasks/0091_212_91212287_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_212_91212287_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_212_91212287_qa_3/environment/pull_bucket.py b/tasks/0091_212_91212287_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_212_91212287_qa_3/environment/pull_bucket.py +++ b/tasks/0091_212_91212287_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_212_91212287_qa_3/task.toml b/tasks/0091_212_91212287_qa_3/task.toml index a83861a20230aded08ca287a5359c217a4c33e37..9e8ecd7cf4deb35a20aac940e59155c4e0825db7 100644 --- a/tasks/0091_212_91212287_qa_3/task.toml +++ b/tasks/0091_212_91212287_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_251_91251894_qa_2/environment/bootstrap.sh b/tasks/0091_251_91251894_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_251_91251894_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_251_91251894_qa_2/environment/pull_bucket.py b/tasks/0091_251_91251894_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_251_91251894_qa_2/environment/pull_bucket.py +++ b/tasks/0091_251_91251894_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_251_91251894_qa_2/task.toml b/tasks/0091_251_91251894_qa_2/task.toml index d143fb569f77dd1ff39e9c6ea233ae5ccc04ac4b..5634aaca7fb0ceb6224fcf355344a942219e8f47 100644 --- a/tasks/0091_251_91251894_qa_2/task.toml +++ b/tasks/0091_251_91251894_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_251_91251894_qa_3/environment/bootstrap.sh b/tasks/0091_251_91251894_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_251_91251894_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_251_91251894_qa_3/environment/pull_bucket.py b/tasks/0091_251_91251894_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_251_91251894_qa_3/environment/pull_bucket.py +++ b/tasks/0091_251_91251894_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_251_91251894_qa_3/task.toml b/tasks/0091_251_91251894_qa_3/task.toml index 17d39e988fb07c7d981bba5c9d2e949b6d18580d..2df14b0d9eb137a09b56a942ae87911209c14863 100644 --- a/tasks/0091_251_91251894_qa_3/task.toml +++ b/tasks/0091_251_91251894_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_296_91296853_qa_1/environment/bootstrap.sh b/tasks/0091_296_91296853_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_296_91296853_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_296_91296853_qa_1/environment/pull_bucket.py b/tasks/0091_296_91296853_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_296_91296853_qa_1/environment/pull_bucket.py +++ b/tasks/0091_296_91296853_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_296_91296853_qa_1/task.toml b/tasks/0091_296_91296853_qa_1/task.toml index 7d161541e2583282e2312af04a1dce224bda1065..9408e6ec433af0af3b73de5335c58164d652dc24 100644 --- a/tasks/0091_296_91296853_qa_1/task.toml +++ b/tasks/0091_296_91296853_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_392_91392892_qa_4/environment/bootstrap.sh b/tasks/0091_392_91392892_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_392_91392892_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_392_91392892_qa_4/environment/pull_bucket.py b/tasks/0091_392_91392892_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_392_91392892_qa_4/environment/pull_bucket.py +++ b/tasks/0091_392_91392892_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_392_91392892_qa_4/task.toml b/tasks/0091_392_91392892_qa_4/task.toml index 9176a47c839371d458e1df98f4c0ddab2ea0ce0f..104f2aa3abee336ca7649251b364e9d5d1dabadd 100644 --- a/tasks/0091_392_91392892_qa_4/task.toml +++ b/tasks/0091_392_91392892_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_439_91439789_qa_3/environment/bootstrap.sh b/tasks/0091_439_91439789_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_439_91439789_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_439_91439789_qa_3/environment/pull_bucket.py b/tasks/0091_439_91439789_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_439_91439789_qa_3/environment/pull_bucket.py +++ b/tasks/0091_439_91439789_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_439_91439789_qa_3/task.toml b/tasks/0091_439_91439789_qa_3/task.toml index f82b4b59d125cfd57792332abf7bb32c6b0a24a1..46ee95f6f92166d602d725c2cd4fa793e31827cd 100644 --- a/tasks/0091_439_91439789_qa_3/task.toml +++ b/tasks/0091_439_91439789_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_442_91442113_qa_2/environment/bootstrap.sh b/tasks/0091_442_91442113_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_442_91442113_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_442_91442113_qa_2/environment/pull_bucket.py b/tasks/0091_442_91442113_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_442_91442113_qa_2/environment/pull_bucket.py +++ b/tasks/0091_442_91442113_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_442_91442113_qa_2/task.toml b/tasks/0091_442_91442113_qa_2/task.toml index 8ed84c4048bb1932aa70ada1ed09ecc18e00988b..922436ca9853e034b522c5b5f15fd7f09a9801ad 100644 --- a/tasks/0091_442_91442113_qa_2/task.toml +++ b/tasks/0091_442_91442113_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_531_91531799_qa_1/environment/bootstrap.sh b/tasks/0091_531_91531799_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_531_91531799_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_531_91531799_qa_1/environment/pull_bucket.py b/tasks/0091_531_91531799_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_531_91531799_qa_1/environment/pull_bucket.py +++ b/tasks/0091_531_91531799_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_531_91531799_qa_1/task.toml b/tasks/0091_531_91531799_qa_1/task.toml index 460c4b1e2751d96182b311529c80da8e04a5c3f6..cd72498bb60e1c931ade962f8bdfda73de852742 100644 --- a/tasks/0091_531_91531799_qa_1/task.toml +++ b/tasks/0091_531_91531799_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_567_91567203_qa_4/environment/bootstrap.sh b/tasks/0091_567_91567203_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_567_91567203_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_567_91567203_qa_4/environment/pull_bucket.py b/tasks/0091_567_91567203_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_567_91567203_qa_4/environment/pull_bucket.py +++ b/tasks/0091_567_91567203_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_567_91567203_qa_4/task.toml b/tasks/0091_567_91567203_qa_4/task.toml index bbd47febf6afaf117f50b90a1d277289cb6f2a80..d9ee6a25b9295ad46a483c0bc91ab5c6181e887d 100644 --- a/tasks/0091_567_91567203_qa_4/task.toml +++ b/tasks/0091_567_91567203_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_584_91584778_qa_3/environment/bootstrap.sh b/tasks/0091_584_91584778_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_584_91584778_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_584_91584778_qa_3/environment/pull_bucket.py b/tasks/0091_584_91584778_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_584_91584778_qa_3/environment/pull_bucket.py +++ b/tasks/0091_584_91584778_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_584_91584778_qa_3/task.toml b/tasks/0091_584_91584778_qa_3/task.toml index 83d710b4f1fcd1e537ad51e529d21a847dc8f803..01a89eaa3d909f4a96582ce583506a4724c23abc 100644 --- a/tasks/0091_584_91584778_qa_3/task.toml +++ b/tasks/0091_584_91584778_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_643_91643144_qa_2/environment/bootstrap.sh b/tasks/0091_643_91643144_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_643_91643144_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_643_91643144_qa_2/environment/pull_bucket.py b/tasks/0091_643_91643144_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_643_91643144_qa_2/environment/pull_bucket.py +++ b/tasks/0091_643_91643144_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_643_91643144_qa_2/task.toml b/tasks/0091_643_91643144_qa_2/task.toml index d829bbeea7e5f962d7e39d585ae306db9fe9374c..a63981dd362f1e91836d98576c0fee9b2d3a170f 100644 --- a/tasks/0091_643_91643144_qa_2/task.toml +++ b/tasks/0091_643_91643144_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_643_91643144_qa_5/environment/bootstrap.sh b/tasks/0091_643_91643144_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_643_91643144_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_643_91643144_qa_5/environment/pull_bucket.py b/tasks/0091_643_91643144_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_643_91643144_qa_5/environment/pull_bucket.py +++ b/tasks/0091_643_91643144_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_643_91643144_qa_5/task.toml b/tasks/0091_643_91643144_qa_5/task.toml index 1639343ca3b269b5602b2ad7dc899e5374ebdbd1..7b1505961ea92a95fbdaca18cccc1c10c3d33595 100644 --- a/tasks/0091_643_91643144_qa_5/task.toml +++ b/tasks/0091_643_91643144_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_670_91670414_qa_3/environment/bootstrap.sh b/tasks/0091_670_91670414_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_670_91670414_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_670_91670414_qa_3/environment/pull_bucket.py b/tasks/0091_670_91670414_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_670_91670414_qa_3/environment/pull_bucket.py +++ b/tasks/0091_670_91670414_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_670_91670414_qa_3/task.toml b/tasks/0091_670_91670414_qa_3/task.toml index 70a923a880e1d55e275d7f451a865b0ecc8f96f5..448307a07113dc65d7387611142158cf88ff9323 100644 --- a/tasks/0091_670_91670414_qa_3/task.toml +++ b/tasks/0091_670_91670414_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_670_91670414_qa_5/environment/bootstrap.sh b/tasks/0091_670_91670414_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_670_91670414_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_670_91670414_qa_5/environment/pull_bucket.py b/tasks/0091_670_91670414_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_670_91670414_qa_5/environment/pull_bucket.py +++ b/tasks/0091_670_91670414_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_670_91670414_qa_5/task.toml b/tasks/0091_670_91670414_qa_5/task.toml index 8a2f2544f63838a8cd1389ed0b423a9c1ed80fe7..d482e89b0f692eefc7e8b1ab405d5c74a0f180c3 100644 --- a/tasks/0091_670_91670414_qa_5/task.toml +++ b/tasks/0091_670_91670414_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_690_91690951_qa_3/environment/bootstrap.sh b/tasks/0091_690_91690951_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_690_91690951_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_690_91690951_qa_3/environment/pull_bucket.py b/tasks/0091_690_91690951_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_690_91690951_qa_3/environment/pull_bucket.py +++ b/tasks/0091_690_91690951_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_690_91690951_qa_3/task.toml b/tasks/0091_690_91690951_qa_3/task.toml index 77f7cafb39855574a35af115a26f1d86aadceb4d..615eceec6e61f51d7d39bd000eb17b4dfac6507b 100644 --- a/tasks/0091_690_91690951_qa_3/task.toml +++ b/tasks/0091_690_91690951_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_690_91690951_qa_4/environment/bootstrap.sh b/tasks/0091_690_91690951_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_690_91690951_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_690_91690951_qa_4/environment/pull_bucket.py b/tasks/0091_690_91690951_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_690_91690951_qa_4/environment/pull_bucket.py +++ b/tasks/0091_690_91690951_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_690_91690951_qa_4/task.toml b/tasks/0091_690_91690951_qa_4/task.toml index e3c7bb0f370df112fd50de7100b1a555501ceb23..715564a069f36863cc87480df6699eb253bf9f8d 100644 --- a/tasks/0091_690_91690951_qa_4/task.toml +++ b/tasks/0091_690_91690951_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_713_91713569_qa_1/environment/bootstrap.sh b/tasks/0091_713_91713569_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_713_91713569_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_713_91713569_qa_1/environment/pull_bucket.py b/tasks/0091_713_91713569_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_713_91713569_qa_1/environment/pull_bucket.py +++ b/tasks/0091_713_91713569_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_713_91713569_qa_1/task.toml b/tasks/0091_713_91713569_qa_1/task.toml index 4271b55e079078aae06d12386514a9b323551e9a..ee081f1edd4fa0ea66dfe49a8dffb2d0e67403d7 100644 --- a/tasks/0091_713_91713569_qa_1/task.toml +++ b/tasks/0091_713_91713569_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_747_91747804_qa_5/environment/bootstrap.sh b/tasks/0091_747_91747804_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_747_91747804_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_747_91747804_qa_5/environment/pull_bucket.py b/tasks/0091_747_91747804_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_747_91747804_qa_5/environment/pull_bucket.py +++ b/tasks/0091_747_91747804_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_747_91747804_qa_5/task.toml b/tasks/0091_747_91747804_qa_5/task.toml index e013a233517b9b098d6eb86d0c4461039bcaac93..a3d8a7d3d96bffde38ffc7edabe64b3ac4ffad04 100644 --- a/tasks/0091_747_91747804_qa_5/task.toml +++ b/tasks/0091_747_91747804_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_774_91774768_qa_4/environment/bootstrap.sh b/tasks/0091_774_91774768_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_774_91774768_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_774_91774768_qa_4/environment/pull_bucket.py b/tasks/0091_774_91774768_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_774_91774768_qa_4/environment/pull_bucket.py +++ b/tasks/0091_774_91774768_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_774_91774768_qa_4/task.toml b/tasks/0091_774_91774768_qa_4/task.toml index 9763f9a1d7eb6ab614160d8c063d08adae0a402a..2a5986595d86cc74878c2a45a37e08bc276b8639 100644 --- a/tasks/0091_774_91774768_qa_4/task.toml +++ b/tasks/0091_774_91774768_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_853_91853988_qa_2/environment/bootstrap.sh b/tasks/0091_853_91853988_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_853_91853988_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_853_91853988_qa_2/environment/pull_bucket.py b/tasks/0091_853_91853988_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_853_91853988_qa_2/environment/pull_bucket.py +++ b/tasks/0091_853_91853988_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_853_91853988_qa_2/task.toml b/tasks/0091_853_91853988_qa_2/task.toml index 9be006ea3784c75bc9b2dbf21ae93abee28e4140..5a4d4a24b79bb0114613273a3851a751e2977bf9 100644 --- a/tasks/0091_853_91853988_qa_2/task.toml +++ b/tasks/0091_853_91853988_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_859_91859529_qa_2/environment/bootstrap.sh b/tasks/0091_859_91859529_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_859_91859529_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_859_91859529_qa_2/environment/pull_bucket.py b/tasks/0091_859_91859529_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_859_91859529_qa_2/environment/pull_bucket.py +++ b/tasks/0091_859_91859529_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_859_91859529_qa_2/task.toml b/tasks/0091_859_91859529_qa_2/task.toml index 7c58fd7fe7f81c046aeaf8a85738c817e15dbd0d..29f201e08feea6bf60c733fd0b48ccdcdc394e49 100644 --- a/tasks/0091_859_91859529_qa_2/task.toml +++ b/tasks/0091_859_91859529_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_859_91859529_qa_4/environment/bootstrap.sh b/tasks/0091_859_91859529_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_859_91859529_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_859_91859529_qa_4/environment/pull_bucket.py b/tasks/0091_859_91859529_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_859_91859529_qa_4/environment/pull_bucket.py +++ b/tasks/0091_859_91859529_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_859_91859529_qa_4/task.toml b/tasks/0091_859_91859529_qa_4/task.toml index 7c98031e4220cd573ed7b04ed8e9c1cba6dc6a95..9b4a7b84a65db0babf65706901662b89f4b55b99 100644 --- a/tasks/0091_859_91859529_qa_4/task.toml +++ b/tasks/0091_859_91859529_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_861_91861304_qa_1/environment/bootstrap.sh b/tasks/0091_861_91861304_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_861_91861304_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_861_91861304_qa_1/environment/pull_bucket.py b/tasks/0091_861_91861304_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_861_91861304_qa_1/environment/pull_bucket.py +++ b/tasks/0091_861_91861304_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_861_91861304_qa_1/task.toml b/tasks/0091_861_91861304_qa_1/task.toml index 54fab91a589471501a0695ff152dd10101ed1837..8728d41d723036be412ca3fbc376a1760015b782 100644 --- a/tasks/0091_861_91861304_qa_1/task.toml +++ b/tasks/0091_861_91861304_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_861_91861304_qa_2/environment/bootstrap.sh b/tasks/0091_861_91861304_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_861_91861304_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_861_91861304_qa_2/environment/pull_bucket.py b/tasks/0091_861_91861304_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_861_91861304_qa_2/environment/pull_bucket.py +++ b/tasks/0091_861_91861304_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_861_91861304_qa_2/task.toml b/tasks/0091_861_91861304_qa_2/task.toml index 4c75cadb4d46f1f5bbfdc1a9a3b8bb243051e151..eea03f72d5711ec79a75f17cbbce0bee161ca628 100644 --- a/tasks/0091_861_91861304_qa_2/task.toml +++ b/tasks/0091_861_91861304_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_861_91861304_qa_4/environment/bootstrap.sh b/tasks/0091_861_91861304_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_861_91861304_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_861_91861304_qa_4/environment/pull_bucket.py b/tasks/0091_861_91861304_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_861_91861304_qa_4/environment/pull_bucket.py +++ b/tasks/0091_861_91861304_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_861_91861304_qa_4/task.toml b/tasks/0091_861_91861304_qa_4/task.toml index c0d24d210751c6c0f152e62ef6b1ba5fb0e99016..29575d379de35d2b186ee0fbdc99e3f640d8e1aa 100644 --- a/tasks/0091_861_91861304_qa_4/task.toml +++ b/tasks/0091_861_91861304_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_886_91886216_qa_5/environment/bootstrap.sh b/tasks/0091_886_91886216_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_886_91886216_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_886_91886216_qa_5/environment/pull_bucket.py b/tasks/0091_886_91886216_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_886_91886216_qa_5/environment/pull_bucket.py +++ b/tasks/0091_886_91886216_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_886_91886216_qa_5/task.toml b/tasks/0091_886_91886216_qa_5/task.toml index 085cb2d9891955a4e8afe55579c442196838c65a..d8bb9c4504ee8f53344bc0d1eb98fe82cfd28635 100644 --- a/tasks/0091_886_91886216_qa_5/task.toml +++ b/tasks/0091_886_91886216_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0091_902_91902857_qa_1/environment/bootstrap.sh b/tasks/0091_902_91902857_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0091_902_91902857_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0091_902_91902857_qa_1/environment/pull_bucket.py b/tasks/0091_902_91902857_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0091_902_91902857_qa_1/environment/pull_bucket.py +++ b/tasks/0091_902_91902857_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0091_902_91902857_qa_1/task.toml b/tasks/0091_902_91902857_qa_1/task.toml index 6254b78ce4a0e10fddedbf8b9fec099337fe9ef6..27c67f3ecd3073eee477d877fd1cfd8755d2fb6d 100644 --- a/tasks/0091_902_91902857_qa_1/task.toml +++ b/tasks/0091_902_91902857_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_004_92004246_qa_1/environment/bootstrap.sh b/tasks/0092_004_92004246_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_004_92004246_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_004_92004246_qa_1/environment/pull_bucket.py b/tasks/0092_004_92004246_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_004_92004246_qa_1/environment/pull_bucket.py +++ b/tasks/0092_004_92004246_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_004_92004246_qa_1/task.toml b/tasks/0092_004_92004246_qa_1/task.toml index 38cdf8f246c43a650da8cfe1dec1972b074acd8f..42eba631be12f904fb3afa26231bd4d44b1008f5 100644 --- a/tasks/0092_004_92004246_qa_1/task.toml +++ b/tasks/0092_004_92004246_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_004_92004246_qa_3/environment/bootstrap.sh b/tasks/0092_004_92004246_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_004_92004246_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_004_92004246_qa_3/environment/pull_bucket.py b/tasks/0092_004_92004246_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_004_92004246_qa_3/environment/pull_bucket.py +++ b/tasks/0092_004_92004246_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_004_92004246_qa_3/task.toml b/tasks/0092_004_92004246_qa_3/task.toml index 086dbca4762965e35f2279f09da18ec3594fdce4..9ee7e62fd3c584f672cbac0eaf3310735779e6ee 100644 --- a/tasks/0092_004_92004246_qa_3/task.toml +++ b/tasks/0092_004_92004246_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_008_92008043_qa_2/environment/bootstrap.sh b/tasks/0092_008_92008043_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_008_92008043_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_008_92008043_qa_2/environment/pull_bucket.py b/tasks/0092_008_92008043_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_008_92008043_qa_2/environment/pull_bucket.py +++ b/tasks/0092_008_92008043_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_008_92008043_qa_2/task.toml b/tasks/0092_008_92008043_qa_2/task.toml index 9cad7cca1fd7377accec8c030f24eb6ed96b7f4a..7df497382795fe03c7a892347fa18ff78ee2fa7b 100644 --- a/tasks/0092_008_92008043_qa_2/task.toml +++ b/tasks/0092_008_92008043_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_190_92190264_qa_4/environment/bootstrap.sh b/tasks/0092_190_92190264_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_190_92190264_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_190_92190264_qa_4/environment/pull_bucket.py b/tasks/0092_190_92190264_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_190_92190264_qa_4/environment/pull_bucket.py +++ b/tasks/0092_190_92190264_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_190_92190264_qa_4/task.toml b/tasks/0092_190_92190264_qa_4/task.toml index 76adfc630d716dc8f41d5c96538d6afdb9b0d49f..f3954be9eb5881478bc8534dbe77f9088b46abce 100644 --- a/tasks/0092_190_92190264_qa_4/task.toml +++ b/tasks/0092_190_92190264_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_354_92354139_qa_3/environment/bootstrap.sh b/tasks/0092_354_92354139_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_354_92354139_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_354_92354139_qa_3/environment/pull_bucket.py b/tasks/0092_354_92354139_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_354_92354139_qa_3/environment/pull_bucket.py +++ b/tasks/0092_354_92354139_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_354_92354139_qa_3/task.toml b/tasks/0092_354_92354139_qa_3/task.toml index 5f1c4a9c100645f05798961bc0bebfc53ef05b47..30c9c8cf68c60e882265cefe87575a99af014af1 100644 --- a/tasks/0092_354_92354139_qa_3/task.toml +++ b/tasks/0092_354_92354139_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_376_92376137_qa_1/environment/bootstrap.sh b/tasks/0092_376_92376137_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_376_92376137_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_376_92376137_qa_1/environment/pull_bucket.py b/tasks/0092_376_92376137_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_376_92376137_qa_1/environment/pull_bucket.py +++ b/tasks/0092_376_92376137_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_376_92376137_qa_1/task.toml b/tasks/0092_376_92376137_qa_1/task.toml index 7d1d302ae25f1709de01904d8d6f76fa0429e8a3..fc04b5496c23bdf50f168e0ddc2ec465558ce7c5 100644 --- a/tasks/0092_376_92376137_qa_1/task.toml +++ b/tasks/0092_376_92376137_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_376_92376137_qa_2/environment/bootstrap.sh b/tasks/0092_376_92376137_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_376_92376137_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_376_92376137_qa_2/environment/pull_bucket.py b/tasks/0092_376_92376137_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_376_92376137_qa_2/environment/pull_bucket.py +++ b/tasks/0092_376_92376137_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_376_92376137_qa_2/task.toml b/tasks/0092_376_92376137_qa_2/task.toml index ce2789a04018fb1bf333219da54e7323741d7df3..73a1620cfbd48b20ea49e008aae6776ec66c0ae1 100644 --- a/tasks/0092_376_92376137_qa_2/task.toml +++ b/tasks/0092_376_92376137_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_376_92376137_qa_3/environment/bootstrap.sh b/tasks/0092_376_92376137_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_376_92376137_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_376_92376137_qa_3/environment/pull_bucket.py b/tasks/0092_376_92376137_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_376_92376137_qa_3/environment/pull_bucket.py +++ b/tasks/0092_376_92376137_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_376_92376137_qa_3/task.toml b/tasks/0092_376_92376137_qa_3/task.toml index e5c49d3e3047d7d69251e6fc590ede1a3bbd8866..417902c559b7641954bbf5f46c85fa43071c75bb 100644 --- a/tasks/0092_376_92376137_qa_3/task.toml +++ b/tasks/0092_376_92376137_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_401_92401680_qa_1/environment/bootstrap.sh b/tasks/0092_401_92401680_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_401_92401680_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_401_92401680_qa_1/environment/pull_bucket.py b/tasks/0092_401_92401680_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_401_92401680_qa_1/environment/pull_bucket.py +++ b/tasks/0092_401_92401680_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_401_92401680_qa_1/task.toml b/tasks/0092_401_92401680_qa_1/task.toml index 16e204d07fb91656fcabac8bd3214805ac96c5ad..a7525567c18c204598e3007494c705b0d5aa48f3 100644 --- a/tasks/0092_401_92401680_qa_1/task.toml +++ b/tasks/0092_401_92401680_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_424_92424981_qa_1/environment/bootstrap.sh b/tasks/0092_424_92424981_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_424_92424981_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_424_92424981_qa_1/environment/pull_bucket.py b/tasks/0092_424_92424981_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_424_92424981_qa_1/environment/pull_bucket.py +++ b/tasks/0092_424_92424981_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_424_92424981_qa_1/task.toml b/tasks/0092_424_92424981_qa_1/task.toml index f274bbb3ace119bca248798f262fcb771b0dd93d..643a53ad15abe350490cecbf87d1b3676d543c14 100644 --- a/tasks/0092_424_92424981_qa_1/task.toml +++ b/tasks/0092_424_92424981_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_443_92443406_qa_2/environment/bootstrap.sh b/tasks/0092_443_92443406_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_443_92443406_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_443_92443406_qa_2/environment/pull_bucket.py b/tasks/0092_443_92443406_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_443_92443406_qa_2/environment/pull_bucket.py +++ b/tasks/0092_443_92443406_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_443_92443406_qa_2/task.toml b/tasks/0092_443_92443406_qa_2/task.toml index 4a0f47bcdd1773c58cf7e593c0be7229ed02de0e..ca61b83a0486de3a813fcaa43a53356bc50d9eaf 100644 --- a/tasks/0092_443_92443406_qa_2/task.toml +++ b/tasks/0092_443_92443406_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_481_92481063_qa_4/environment/bootstrap.sh b/tasks/0092_481_92481063_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_481_92481063_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_481_92481063_qa_4/environment/pull_bucket.py b/tasks/0092_481_92481063_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_481_92481063_qa_4/environment/pull_bucket.py +++ b/tasks/0092_481_92481063_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_481_92481063_qa_4/task.toml b/tasks/0092_481_92481063_qa_4/task.toml index 43d79fe892d6ed8ca836331ce87c9816616f4211..653c85c827968193207e0e95b7546e5c58e31a05 100644 --- a/tasks/0092_481_92481063_qa_4/task.toml +++ b/tasks/0092_481_92481063_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_493_92493148_qa_3/environment/bootstrap.sh b/tasks/0092_493_92493148_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_493_92493148_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_493_92493148_qa_3/environment/pull_bucket.py b/tasks/0092_493_92493148_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_493_92493148_qa_3/environment/pull_bucket.py +++ b/tasks/0092_493_92493148_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_493_92493148_qa_3/task.toml b/tasks/0092_493_92493148_qa_3/task.toml index e6c64c277d32e64274a4415e781a41d09ca2bd89..1ed30cf466531e5404484f54ffed4d4e4561623f 100644 --- a/tasks/0092_493_92493148_qa_3/task.toml +++ b/tasks/0092_493_92493148_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_596_92596170_qa_2/environment/bootstrap.sh b/tasks/0092_596_92596170_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_596_92596170_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_596_92596170_qa_2/environment/pull_bucket.py b/tasks/0092_596_92596170_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_596_92596170_qa_2/environment/pull_bucket.py +++ b/tasks/0092_596_92596170_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_596_92596170_qa_2/task.toml b/tasks/0092_596_92596170_qa_2/task.toml index cc7b92ee9821140530c30fbbae3b194eaa8780c5..0fb68fc6e616dc51373689b39e8f364b777afa18 100644 --- a/tasks/0092_596_92596170_qa_2/task.toml +++ b/tasks/0092_596_92596170_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_606_92606348_qa_3/environment/bootstrap.sh b/tasks/0092_606_92606348_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_606_92606348_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_606_92606348_qa_3/environment/pull_bucket.py b/tasks/0092_606_92606348_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_606_92606348_qa_3/environment/pull_bucket.py +++ b/tasks/0092_606_92606348_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_606_92606348_qa_3/task.toml b/tasks/0092_606_92606348_qa_3/task.toml index 176a0819f281a55fc5659f3cb81051575c3a6637..53cb4742d3f90477c8ffa1dbd542c9b78ea0b45d 100644 --- a/tasks/0092_606_92606348_qa_3/task.toml +++ b/tasks/0092_606_92606348_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_606_92606348_qa_4/environment/bootstrap.sh b/tasks/0092_606_92606348_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_606_92606348_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_606_92606348_qa_4/environment/pull_bucket.py b/tasks/0092_606_92606348_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_606_92606348_qa_4/environment/pull_bucket.py +++ b/tasks/0092_606_92606348_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_606_92606348_qa_4/task.toml b/tasks/0092_606_92606348_qa_4/task.toml index ecc4fef346aed9c4d4c72e5d2dad2d9bbc81cfed..da3a0d1f9ca125d2739a7914755a70ebf9a27ae5 100644 --- a/tasks/0092_606_92606348_qa_4/task.toml +++ b/tasks/0092_606_92606348_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_620_92620460_qa_4/environment/bootstrap.sh b/tasks/0092_620_92620460_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_620_92620460_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_620_92620460_qa_4/environment/pull_bucket.py b/tasks/0092_620_92620460_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_620_92620460_qa_4/environment/pull_bucket.py +++ b/tasks/0092_620_92620460_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_620_92620460_qa_4/task.toml b/tasks/0092_620_92620460_qa_4/task.toml index 8f3770c2d61cfb4777209a71129873b1421b694a..c0d6a80bd80ff1597373ebcfe9ba1e2e93dc6102 100644 --- a/tasks/0092_620_92620460_qa_4/task.toml +++ b/tasks/0092_620_92620460_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_637_92637915_qa_4/environment/bootstrap.sh b/tasks/0092_637_92637915_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_637_92637915_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_637_92637915_qa_4/environment/pull_bucket.py b/tasks/0092_637_92637915_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_637_92637915_qa_4/environment/pull_bucket.py +++ b/tasks/0092_637_92637915_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_637_92637915_qa_4/task.toml b/tasks/0092_637_92637915_qa_4/task.toml index b07838a37673562160b79fdad56a7e9ea89a4665..7d2925046d88de8d60c0cb491dbff96e305e4c4c 100644 --- a/tasks/0092_637_92637915_qa_4/task.toml +++ b/tasks/0092_637_92637915_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_706_92706423_qa_4/environment/bootstrap.sh b/tasks/0092_706_92706423_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_706_92706423_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_706_92706423_qa_4/environment/pull_bucket.py b/tasks/0092_706_92706423_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_706_92706423_qa_4/environment/pull_bucket.py +++ b/tasks/0092_706_92706423_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_706_92706423_qa_4/task.toml b/tasks/0092_706_92706423_qa_4/task.toml index b5d2d45c167d5e73f628294040abb4b409b3dedc..61de0dc895b3d3fc16a1e234980d6932fc759c33 100644 --- a/tasks/0092_706_92706423_qa_4/task.toml +++ b/tasks/0092_706_92706423_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_855_92855886_qa_1/environment/bootstrap.sh b/tasks/0092_855_92855886_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_855_92855886_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_855_92855886_qa_1/environment/pull_bucket.py b/tasks/0092_855_92855886_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_855_92855886_qa_1/environment/pull_bucket.py +++ b/tasks/0092_855_92855886_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_855_92855886_qa_1/task.toml b/tasks/0092_855_92855886_qa_1/task.toml index 494fe1f6cc20f9de469e6d0ccf16024add1dff15..e28b60ce3e5d53acb6a3be26b0e803aacd20f581 100644 --- a/tasks/0092_855_92855886_qa_1/task.toml +++ b/tasks/0092_855_92855886_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_855_92855886_qa_2/environment/bootstrap.sh b/tasks/0092_855_92855886_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_855_92855886_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_855_92855886_qa_2/environment/pull_bucket.py b/tasks/0092_855_92855886_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_855_92855886_qa_2/environment/pull_bucket.py +++ b/tasks/0092_855_92855886_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_855_92855886_qa_2/task.toml b/tasks/0092_855_92855886_qa_2/task.toml index 63dbd2df0960dae5ba6b426ac592ed62ca798074..fdd9a4defaad1bcf45c4ef98d27fa13ed925ccb3 100644 --- a/tasks/0092_855_92855886_qa_2/task.toml +++ b/tasks/0092_855_92855886_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_936_92936463_qa_5/environment/bootstrap.sh b/tasks/0092_936_92936463_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_936_92936463_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_936_92936463_qa_5/environment/pull_bucket.py b/tasks/0092_936_92936463_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_936_92936463_qa_5/environment/pull_bucket.py +++ b/tasks/0092_936_92936463_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_936_92936463_qa_5/task.toml b/tasks/0092_936_92936463_qa_5/task.toml index d5b27cb79f243b08101d5b47d3a71a024a9de6c2..aba71db6802e2e2afb46cd69fa3ab47c07ecf313 100644 --- a/tasks/0092_936_92936463_qa_5/task.toml +++ b/tasks/0092_936_92936463_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_951_92951855_qa_2/environment/bootstrap.sh b/tasks/0092_951_92951855_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_951_92951855_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_951_92951855_qa_2/environment/pull_bucket.py b/tasks/0092_951_92951855_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_951_92951855_qa_2/environment/pull_bucket.py +++ b/tasks/0092_951_92951855_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_951_92951855_qa_2/task.toml b/tasks/0092_951_92951855_qa_2/task.toml index 1c74cd8e82ef1faafbda8e64d50c86f837aadcef..9862af7f5ed78ac4034ea9b142fbcc57de6a79f4 100644 --- a/tasks/0092_951_92951855_qa_2/task.toml +++ b/tasks/0092_951_92951855_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0092_990_92990642_qa_2/environment/bootstrap.sh b/tasks/0092_990_92990642_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0092_990_92990642_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0092_990_92990642_qa_2/environment/pull_bucket.py b/tasks/0092_990_92990642_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0092_990_92990642_qa_2/environment/pull_bucket.py +++ b/tasks/0092_990_92990642_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0092_990_92990642_qa_2/task.toml b/tasks/0092_990_92990642_qa_2/task.toml index f2089623d75f50670ab6009c881af2ffd7729b78..145f6cec6e21865faa997f9223d2b843aa57423e 100644 --- a/tasks/0092_990_92990642_qa_2/task.toml +++ b/tasks/0092_990_92990642_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_118_93118701_qa_2/environment/bootstrap.sh b/tasks/0093_118_93118701_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_118_93118701_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_118_93118701_qa_2/environment/pull_bucket.py b/tasks/0093_118_93118701_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_118_93118701_qa_2/environment/pull_bucket.py +++ b/tasks/0093_118_93118701_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_118_93118701_qa_2/task.toml b/tasks/0093_118_93118701_qa_2/task.toml index 7947a57170d70e8122e1467d2ec8025bb6669134..6a59727ac216d28b76bffe73cda4f64a230d12e3 100644 --- a/tasks/0093_118_93118701_qa_2/task.toml +++ b/tasks/0093_118_93118701_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_118_93118701_qa_4/environment/bootstrap.sh b/tasks/0093_118_93118701_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_118_93118701_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_118_93118701_qa_4/environment/pull_bucket.py b/tasks/0093_118_93118701_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_118_93118701_qa_4/environment/pull_bucket.py +++ b/tasks/0093_118_93118701_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_118_93118701_qa_4/task.toml b/tasks/0093_118_93118701_qa_4/task.toml index b71970fd04c85307778ccc23543444fdf1a95313..9a925654c805f851ee8646104099547dec8da8d8 100644 --- a/tasks/0093_118_93118701_qa_4/task.toml +++ b/tasks/0093_118_93118701_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_170_93170596_qa_1/environment/bootstrap.sh b/tasks/0093_170_93170596_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_170_93170596_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_170_93170596_qa_1/environment/pull_bucket.py b/tasks/0093_170_93170596_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_170_93170596_qa_1/environment/pull_bucket.py +++ b/tasks/0093_170_93170596_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_170_93170596_qa_1/task.toml b/tasks/0093_170_93170596_qa_1/task.toml index 0fe5014d802a522791a565b7178382b2e12d01d0..abbd46e3e53f32622d8ef38c3729d5bbbcf3e364 100644 --- a/tasks/0093_170_93170596_qa_1/task.toml +++ b/tasks/0093_170_93170596_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_185_93185105_qa_1/environment/bootstrap.sh b/tasks/0093_185_93185105_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_185_93185105_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_185_93185105_qa_1/environment/pull_bucket.py b/tasks/0093_185_93185105_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_185_93185105_qa_1/environment/pull_bucket.py +++ b/tasks/0093_185_93185105_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_185_93185105_qa_1/task.toml b/tasks/0093_185_93185105_qa_1/task.toml index 4f7799dd5b1400b41434d1e6f242d1a16b97b0a8..0ee65cca671c51fed079891c8caaceadee787aea 100644 --- a/tasks/0093_185_93185105_qa_1/task.toml +++ b/tasks/0093_185_93185105_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_185_93185105_qa_4/environment/bootstrap.sh b/tasks/0093_185_93185105_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_185_93185105_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_185_93185105_qa_4/environment/pull_bucket.py b/tasks/0093_185_93185105_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_185_93185105_qa_4/environment/pull_bucket.py +++ b/tasks/0093_185_93185105_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_185_93185105_qa_4/task.toml b/tasks/0093_185_93185105_qa_4/task.toml index 266bfe94452e8a3423adb648737be968f9dfdbc1..92ff39d1755a03945825cab9e0ecc7382d462e05 100644 --- a/tasks/0093_185_93185105_qa_4/task.toml +++ b/tasks/0093_185_93185105_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_351_93351284_qa_1/environment/bootstrap.sh b/tasks/0093_351_93351284_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_351_93351284_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_351_93351284_qa_1/environment/pull_bucket.py b/tasks/0093_351_93351284_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_351_93351284_qa_1/environment/pull_bucket.py +++ b/tasks/0093_351_93351284_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_351_93351284_qa_1/task.toml b/tasks/0093_351_93351284_qa_1/task.toml index 12bebfe976c8dbb6bffc6ca7f320d9a8ee72c910..37d1fb0d49c02fb2a4a5a03d274686d916481780 100644 --- a/tasks/0093_351_93351284_qa_1/task.toml +++ b/tasks/0093_351_93351284_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_442_93442881_qa_2/environment/bootstrap.sh b/tasks/0093_442_93442881_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_442_93442881_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_442_93442881_qa_2/environment/pull_bucket.py b/tasks/0093_442_93442881_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_442_93442881_qa_2/environment/pull_bucket.py +++ b/tasks/0093_442_93442881_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_442_93442881_qa_2/task.toml b/tasks/0093_442_93442881_qa_2/task.toml index 5b82c39fd26dc0936316168e03847bc2fc68da58..02045fa4e6df5660048578a13460ead1d252e613 100644 --- a/tasks/0093_442_93442881_qa_2/task.toml +++ b/tasks/0093_442_93442881_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_490_93490141_qa_3/environment/bootstrap.sh b/tasks/0093_490_93490141_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_490_93490141_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_490_93490141_qa_3/environment/pull_bucket.py b/tasks/0093_490_93490141_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_490_93490141_qa_3/environment/pull_bucket.py +++ b/tasks/0093_490_93490141_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_490_93490141_qa_3/task.toml b/tasks/0093_490_93490141_qa_3/task.toml index 571c9cf9836123a8eb2388403159dd925d386724..0991be488549cdb4df48717a40f7f2b6e25d3fd5 100644 --- a/tasks/0093_490_93490141_qa_3/task.toml +++ b/tasks/0093_490_93490141_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_626_93626148_qa_1/environment/bootstrap.sh b/tasks/0093_626_93626148_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_626_93626148_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_626_93626148_qa_1/environment/pull_bucket.py b/tasks/0093_626_93626148_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_626_93626148_qa_1/environment/pull_bucket.py +++ b/tasks/0093_626_93626148_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_626_93626148_qa_1/task.toml b/tasks/0093_626_93626148_qa_1/task.toml index fdfd631dd8da5ddb7c185292547b70f1b91ef0ed..b5f8a3dbe1da26abc481208c0797566fa10c4255 100644 --- a/tasks/0093_626_93626148_qa_1/task.toml +++ b/tasks/0093_626_93626148_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_643_93643564_qa_1/environment/bootstrap.sh b/tasks/0093_643_93643564_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_643_93643564_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_643_93643564_qa_1/environment/pull_bucket.py b/tasks/0093_643_93643564_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_643_93643564_qa_1/environment/pull_bucket.py +++ b/tasks/0093_643_93643564_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_643_93643564_qa_1/task.toml b/tasks/0093_643_93643564_qa_1/task.toml index 45f255b9b21cdddd4278a52e88544474d6385304..d8f91171065238d0130e28f415e645efa75a7d42 100644 --- a/tasks/0093_643_93643564_qa_1/task.toml +++ b/tasks/0093_643_93643564_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_734_93734119_qa_2/environment/bootstrap.sh b/tasks/0093_734_93734119_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_734_93734119_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_734_93734119_qa_2/environment/pull_bucket.py b/tasks/0093_734_93734119_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_734_93734119_qa_2/environment/pull_bucket.py +++ b/tasks/0093_734_93734119_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_734_93734119_qa_2/task.toml b/tasks/0093_734_93734119_qa_2/task.toml index 25f1c37d60ae57ef0e5ff4e98295fb76264813a6..d3498dbad0d7d6e325417fafd565043a493f38d9 100644 --- a/tasks/0093_734_93734119_qa_2/task.toml +++ b/tasks/0093_734_93734119_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_755_93755212_qa_1/environment/bootstrap.sh b/tasks/0093_755_93755212_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_755_93755212_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_755_93755212_qa_1/environment/pull_bucket.py b/tasks/0093_755_93755212_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_755_93755212_qa_1/environment/pull_bucket.py +++ b/tasks/0093_755_93755212_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_755_93755212_qa_1/task.toml b/tasks/0093_755_93755212_qa_1/task.toml index 3c50e9616efe5e69394862faa26be9bfd59fb366..a57994f8d97f8ef5f910bbfc35867603be628320 100644 --- a/tasks/0093_755_93755212_qa_1/task.toml +++ b/tasks/0093_755_93755212_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_755_93755212_qa_4/environment/bootstrap.sh b/tasks/0093_755_93755212_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_755_93755212_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_755_93755212_qa_4/environment/pull_bucket.py b/tasks/0093_755_93755212_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_755_93755212_qa_4/environment/pull_bucket.py +++ b/tasks/0093_755_93755212_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_755_93755212_qa_4/task.toml b/tasks/0093_755_93755212_qa_4/task.toml index 1ffe56653e7aae8164b718b8a17f637e50467474..e670bbc9622cb966c70b54a137f74571d7f5a8b4 100644 --- a/tasks/0093_755_93755212_qa_4/task.toml +++ b/tasks/0093_755_93755212_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_755_93755212_qa_5/environment/bootstrap.sh b/tasks/0093_755_93755212_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_755_93755212_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_755_93755212_qa_5/environment/pull_bucket.py b/tasks/0093_755_93755212_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_755_93755212_qa_5/environment/pull_bucket.py +++ b/tasks/0093_755_93755212_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_755_93755212_qa_5/task.toml b/tasks/0093_755_93755212_qa_5/task.toml index a7dc5b93b2d320c355f6aaf31f071ed46a9bb4dd..f9a9e63fac8c536a5a3824dd6315eff5aa1117b1 100644 --- a/tasks/0093_755_93755212_qa_5/task.toml +++ b/tasks/0093_755_93755212_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0093_813_93813737_qa_1/environment/bootstrap.sh b/tasks/0093_813_93813737_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0093_813_93813737_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0093_813_93813737_qa_1/environment/pull_bucket.py b/tasks/0093_813_93813737_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0093_813_93813737_qa_1/environment/pull_bucket.py +++ b/tasks/0093_813_93813737_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0093_813_93813737_qa_1/task.toml b/tasks/0093_813_93813737_qa_1/task.toml index 13da7068f936b4e601329c43848c75beb566cfe7..d556a618c35b0a879d45f5cac1fb2f7d8412974e 100644 --- a/tasks/0093_813_93813737_qa_1/task.toml +++ b/tasks/0093_813_93813737_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_004_94004350_qa_2/environment/bootstrap.sh b/tasks/0094_004_94004350_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_004_94004350_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_004_94004350_qa_2/environment/pull_bucket.py b/tasks/0094_004_94004350_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_004_94004350_qa_2/environment/pull_bucket.py +++ b/tasks/0094_004_94004350_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_004_94004350_qa_2/task.toml b/tasks/0094_004_94004350_qa_2/task.toml index a468a4b6936b7028e997d13b1d6ceab625e58b49..5ab85d46b9315d3d2ba3dbb76514cb28c5e1862e 100644 --- a/tasks/0094_004_94004350_qa_2/task.toml +++ b/tasks/0094_004_94004350_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_028_94028594_qa_1/environment/bootstrap.sh b/tasks/0094_028_94028594_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_028_94028594_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_028_94028594_qa_1/environment/pull_bucket.py b/tasks/0094_028_94028594_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_028_94028594_qa_1/environment/pull_bucket.py +++ b/tasks/0094_028_94028594_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_028_94028594_qa_1/task.toml b/tasks/0094_028_94028594_qa_1/task.toml index e2375420a310719d34b5f2b915b28db01dd277b3..01221d30dc293b681cea89da45621103a616cee9 100644 --- a/tasks/0094_028_94028594_qa_1/task.toml +++ b/tasks/0094_028_94028594_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_052_94052168_qa_3/environment/bootstrap.sh b/tasks/0094_052_94052168_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_052_94052168_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_052_94052168_qa_3/environment/pull_bucket.py b/tasks/0094_052_94052168_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_052_94052168_qa_3/environment/pull_bucket.py +++ b/tasks/0094_052_94052168_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_052_94052168_qa_3/task.toml b/tasks/0094_052_94052168_qa_3/task.toml index 2b6c8c6320e37dbe8851bc09ee47480cf03d2137..9e62aa287291cba588d6896e280d2c75701822a7 100644 --- a/tasks/0094_052_94052168_qa_3/task.toml +++ b/tasks/0094_052_94052168_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_052_94052168_qa_4/environment/bootstrap.sh b/tasks/0094_052_94052168_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_052_94052168_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_052_94052168_qa_4/environment/pull_bucket.py b/tasks/0094_052_94052168_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_052_94052168_qa_4/environment/pull_bucket.py +++ b/tasks/0094_052_94052168_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_052_94052168_qa_4/task.toml b/tasks/0094_052_94052168_qa_4/task.toml index fd6eea3a35b9f09b226c02c20d630a7ae8a03954..fa3a9f49116fd8d6399d9db7b9f6c02604b3c1fd 100644 --- a/tasks/0094_052_94052168_qa_4/task.toml +++ b/tasks/0094_052_94052168_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_083_94083312_qa_2/environment/bootstrap.sh b/tasks/0094_083_94083312_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_083_94083312_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_083_94083312_qa_2/environment/pull_bucket.py b/tasks/0094_083_94083312_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_083_94083312_qa_2/environment/pull_bucket.py +++ b/tasks/0094_083_94083312_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_083_94083312_qa_2/task.toml b/tasks/0094_083_94083312_qa_2/task.toml index 1ea86259155ac204af5022804484b39a3c802194..9bdf9365b160eac7d272bfa56da76e7ead406ea4 100644 --- a/tasks/0094_083_94083312_qa_2/task.toml +++ b/tasks/0094_083_94083312_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_083_94083425_qa_4/environment/bootstrap.sh b/tasks/0094_083_94083425_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_083_94083425_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_083_94083425_qa_4/environment/pull_bucket.py b/tasks/0094_083_94083425_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_083_94083425_qa_4/environment/pull_bucket.py +++ b/tasks/0094_083_94083425_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_083_94083425_qa_4/task.toml b/tasks/0094_083_94083425_qa_4/task.toml index 39d28936d8cd6c5f83f07ec6ee5d33c8f001cb97..579a3388bd490203f2c4b9ec2ed993ba9101b711 100644 --- a/tasks/0094_083_94083425_qa_4/task.toml +++ b/tasks/0094_083_94083425_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_116_94116653_qa_2/environment/bootstrap.sh b/tasks/0094_116_94116653_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_116_94116653_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_116_94116653_qa_2/environment/pull_bucket.py b/tasks/0094_116_94116653_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_116_94116653_qa_2/environment/pull_bucket.py +++ b/tasks/0094_116_94116653_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_116_94116653_qa_2/task.toml b/tasks/0094_116_94116653_qa_2/task.toml index b808f3639e3e47a3493b452711e99cb581f3c4a6..8e9c4d369d98e612c5b5ee4c6dcb6d8cd4ef1a29 100644 --- a/tasks/0094_116_94116653_qa_2/task.toml +++ b/tasks/0094_116_94116653_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_146_94146987_qa_2/environment/bootstrap.sh b/tasks/0094_146_94146987_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_146_94146987_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_146_94146987_qa_2/environment/pull_bucket.py b/tasks/0094_146_94146987_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_146_94146987_qa_2/environment/pull_bucket.py +++ b/tasks/0094_146_94146987_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_146_94146987_qa_2/task.toml b/tasks/0094_146_94146987_qa_2/task.toml index 907a53bbbb094b8fbc84085c591e7d1801c4ed13..9da5422f43b09eec0ba5354f554d2b40573580cf 100644 --- a/tasks/0094_146_94146987_qa_2/task.toml +++ b/tasks/0094_146_94146987_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_146_94146987_qa_5/environment/bootstrap.sh b/tasks/0094_146_94146987_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_146_94146987_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_146_94146987_qa_5/environment/pull_bucket.py b/tasks/0094_146_94146987_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_146_94146987_qa_5/environment/pull_bucket.py +++ b/tasks/0094_146_94146987_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_146_94146987_qa_5/task.toml b/tasks/0094_146_94146987_qa_5/task.toml index 9de21b95b4d0ba35e1ae9770fdb532b0367a6e24..be294eb25773cb6f44e1e9c2a0f5a39b4b87dd46 100644 --- a/tasks/0094_146_94146987_qa_5/task.toml +++ b/tasks/0094_146_94146987_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_237_94237964_qa_4/environment/bootstrap.sh b/tasks/0094_237_94237964_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_237_94237964_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_237_94237964_qa_4/environment/pull_bucket.py b/tasks/0094_237_94237964_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_237_94237964_qa_4/environment/pull_bucket.py +++ b/tasks/0094_237_94237964_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_237_94237964_qa_4/task.toml b/tasks/0094_237_94237964_qa_4/task.toml index 7bf4560502c335e2971c1d913e0406a1e2cd6502..65e655be01e13bd10e1f02f521e840ef0c939bd4 100644 --- a/tasks/0094_237_94237964_qa_4/task.toml +++ b/tasks/0094_237_94237964_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_237_94237964_qa_5/environment/bootstrap.sh b/tasks/0094_237_94237964_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_237_94237964_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_237_94237964_qa_5/environment/pull_bucket.py b/tasks/0094_237_94237964_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_237_94237964_qa_5/environment/pull_bucket.py +++ b/tasks/0094_237_94237964_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_237_94237964_qa_5/task.toml b/tasks/0094_237_94237964_qa_5/task.toml index 7bf652c408f9980431aab32073df3c27574ba8bc..9f1e98f82d3b356aa31b9f720c4dce4788728d6d 100644 --- a/tasks/0094_237_94237964_qa_5/task.toml +++ b/tasks/0094_237_94237964_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_264_94264953_qa_3/environment/bootstrap.sh b/tasks/0094_264_94264953_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_264_94264953_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_264_94264953_qa_3/environment/pull_bucket.py b/tasks/0094_264_94264953_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_264_94264953_qa_3/environment/pull_bucket.py +++ b/tasks/0094_264_94264953_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_264_94264953_qa_3/task.toml b/tasks/0094_264_94264953_qa_3/task.toml index 5c19658bfbfda27270c874bfee586e46778b846d..ccd07adc3a8f2afbf0f2f36a8d0642966c0e5847 100644 --- a/tasks/0094_264_94264953_qa_3/task.toml +++ b/tasks/0094_264_94264953_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_415_94415300_qa_4/environment/bootstrap.sh b/tasks/0094_415_94415300_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_415_94415300_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_415_94415300_qa_4/environment/pull_bucket.py b/tasks/0094_415_94415300_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_415_94415300_qa_4/environment/pull_bucket.py +++ b/tasks/0094_415_94415300_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_415_94415300_qa_4/task.toml b/tasks/0094_415_94415300_qa_4/task.toml index 263e0fd605668bafb642733804ee2eab203d7aef..00fc03e835166421e124272962b8ad0e423dc625 100644 --- a/tasks/0094_415_94415300_qa_4/task.toml +++ b/tasks/0094_415_94415300_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_443_94443300_qa_3/environment/bootstrap.sh b/tasks/0094_443_94443300_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_443_94443300_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_443_94443300_qa_3/environment/pull_bucket.py b/tasks/0094_443_94443300_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_443_94443300_qa_3/environment/pull_bucket.py +++ b/tasks/0094_443_94443300_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_443_94443300_qa_3/task.toml b/tasks/0094_443_94443300_qa_3/task.toml index 1ec4d001b3b19a39feb48a4335beed751a44a800..65e15347fd5cee99b29eef6dafd350037c4d7c0e 100644 --- a/tasks/0094_443_94443300_qa_3/task.toml +++ b/tasks/0094_443_94443300_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_443_94443300_qa_5/environment/bootstrap.sh b/tasks/0094_443_94443300_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_443_94443300_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_443_94443300_qa_5/environment/pull_bucket.py b/tasks/0094_443_94443300_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_443_94443300_qa_5/environment/pull_bucket.py +++ b/tasks/0094_443_94443300_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_443_94443300_qa_5/task.toml b/tasks/0094_443_94443300_qa_5/task.toml index 1c886ab72cb008b74e8612b09583edb61928fe38..f11809de3313c213f6adfdaf6b31f271e990177b 100644 --- a/tasks/0094_443_94443300_qa_5/task.toml +++ b/tasks/0094_443_94443300_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_540_94540451_qa_2/environment/bootstrap.sh b/tasks/0094_540_94540451_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_540_94540451_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_540_94540451_qa_2/environment/pull_bucket.py b/tasks/0094_540_94540451_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_540_94540451_qa_2/environment/pull_bucket.py +++ b/tasks/0094_540_94540451_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_540_94540451_qa_2/task.toml b/tasks/0094_540_94540451_qa_2/task.toml index 26eb21ed8a07fbc5d6a27d24a33aba304bf29434..ea1455d576095ba6bd8ee168a0861547a5f82bf5 100644 --- a/tasks/0094_540_94540451_qa_2/task.toml +++ b/tasks/0094_540_94540451_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_557_94557527_qa_3/environment/bootstrap.sh b/tasks/0094_557_94557527_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_557_94557527_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_557_94557527_qa_3/environment/pull_bucket.py b/tasks/0094_557_94557527_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_557_94557527_qa_3/environment/pull_bucket.py +++ b/tasks/0094_557_94557527_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_557_94557527_qa_3/task.toml b/tasks/0094_557_94557527_qa_3/task.toml index 8b553700ff2e9af370e4a1d82b56a8abb4ce30f5..fc31675cfe58bac1fb67dc9196fa227b5f61f556 100644 --- a/tasks/0094_557_94557527_qa_3/task.toml +++ b/tasks/0094_557_94557527_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_574_94574947_qa_3/environment/bootstrap.sh b/tasks/0094_574_94574947_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_574_94574947_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_574_94574947_qa_3/environment/pull_bucket.py b/tasks/0094_574_94574947_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_574_94574947_qa_3/environment/pull_bucket.py +++ b/tasks/0094_574_94574947_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_574_94574947_qa_3/task.toml b/tasks/0094_574_94574947_qa_3/task.toml index 4af1c0073665d51b713bfbd7dbfc608aaf1ea261..068f0c1fa4fc824e416f86f4b364bf3e19d7c7bb 100644 --- a/tasks/0094_574_94574947_qa_3/task.toml +++ b/tasks/0094_574_94574947_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_620_94620248_qa_2/environment/bootstrap.sh b/tasks/0094_620_94620248_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_620_94620248_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_620_94620248_qa_2/environment/pull_bucket.py b/tasks/0094_620_94620248_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_620_94620248_qa_2/environment/pull_bucket.py +++ b/tasks/0094_620_94620248_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_620_94620248_qa_2/task.toml b/tasks/0094_620_94620248_qa_2/task.toml index 855cef82a11c0d749948317fe1a01ebedda0b5cb..5470d28c97c6325ae613ff6ce060e5c33fe8eff2 100644 --- a/tasks/0094_620_94620248_qa_2/task.toml +++ b/tasks/0094_620_94620248_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_620_94620248_qa_3/environment/bootstrap.sh b/tasks/0094_620_94620248_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_620_94620248_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_620_94620248_qa_3/environment/pull_bucket.py b/tasks/0094_620_94620248_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_620_94620248_qa_3/environment/pull_bucket.py +++ b/tasks/0094_620_94620248_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_620_94620248_qa_3/task.toml b/tasks/0094_620_94620248_qa_3/task.toml index 6cb4b2ff7fa449569e31a9ca566216eb90bc86b6..6923eb4c57ee6cb81f30967424a506aba896d114 100644 --- a/tasks/0094_620_94620248_qa_3/task.toml +++ b/tasks/0094_620_94620248_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_622_94622632_qa_2/environment/bootstrap.sh b/tasks/0094_622_94622632_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_622_94622632_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_622_94622632_qa_2/environment/pull_bucket.py b/tasks/0094_622_94622632_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_622_94622632_qa_2/environment/pull_bucket.py +++ b/tasks/0094_622_94622632_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_622_94622632_qa_2/task.toml b/tasks/0094_622_94622632_qa_2/task.toml index 207c97d694ce535d592ccec711defebc0de2fc41..9346b33d775c36b6629ce6abac95f632236ed844 100644 --- a/tasks/0094_622_94622632_qa_2/task.toml +++ b/tasks/0094_622_94622632_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_685_94685478_qa_2/environment/bootstrap.sh b/tasks/0094_685_94685478_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_685_94685478_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_685_94685478_qa_2/environment/pull_bucket.py b/tasks/0094_685_94685478_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_685_94685478_qa_2/environment/pull_bucket.py +++ b/tasks/0094_685_94685478_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_685_94685478_qa_2/task.toml b/tasks/0094_685_94685478_qa_2/task.toml index f919a4d2f0b1500f1b1824dbf5fd3da16f8d0cbc..7cad89039e521bc33638b79c8124f1a30ea469fb 100644 --- a/tasks/0094_685_94685478_qa_2/task.toml +++ b/tasks/0094_685_94685478_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_688_94688742_qa_2/environment/bootstrap.sh b/tasks/0094_688_94688742_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_688_94688742_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_688_94688742_qa_2/environment/pull_bucket.py b/tasks/0094_688_94688742_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_688_94688742_qa_2/environment/pull_bucket.py +++ b/tasks/0094_688_94688742_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_688_94688742_qa_2/task.toml b/tasks/0094_688_94688742_qa_2/task.toml index 37bdeac53c6aeab979510546e7aaba9e9d65e1f4..b6a8d8aaaff8334791a5074ff78cc581c788d8c7 100644 --- a/tasks/0094_688_94688742_qa_2/task.toml +++ b/tasks/0094_688_94688742_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_688_94688742_qa_4/environment/bootstrap.sh b/tasks/0094_688_94688742_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_688_94688742_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_688_94688742_qa_4/environment/pull_bucket.py b/tasks/0094_688_94688742_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_688_94688742_qa_4/environment/pull_bucket.py +++ b/tasks/0094_688_94688742_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_688_94688742_qa_4/task.toml b/tasks/0094_688_94688742_qa_4/task.toml index d16c57bc956142d24e8b684fad69977c5a18a8a1..95be7af794c9e16b2a4c7ccf350b517fbe542d9f 100644 --- a/tasks/0094_688_94688742_qa_4/task.toml +++ b/tasks/0094_688_94688742_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_696_94696355_qa_3/environment/bootstrap.sh b/tasks/0094_696_94696355_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_696_94696355_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_696_94696355_qa_3/environment/pull_bucket.py b/tasks/0094_696_94696355_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_696_94696355_qa_3/environment/pull_bucket.py +++ b/tasks/0094_696_94696355_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_696_94696355_qa_3/task.toml b/tasks/0094_696_94696355_qa_3/task.toml index 63f588722b113467e2939f0139a280a3af49be6a..ea83d9935d1d715ab58948283d808e1b6fc4121d 100644 --- a/tasks/0094_696_94696355_qa_3/task.toml +++ b/tasks/0094_696_94696355_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_698_94698351_qa_2/environment/bootstrap.sh b/tasks/0094_698_94698351_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_698_94698351_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_698_94698351_qa_2/environment/pull_bucket.py b/tasks/0094_698_94698351_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_698_94698351_qa_2/environment/pull_bucket.py +++ b/tasks/0094_698_94698351_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_698_94698351_qa_2/task.toml b/tasks/0094_698_94698351_qa_2/task.toml index e1aaeaf34450fb5e030961db6b1e2c0c3d6bc203..e5805b2e182dc1431172d29189cc13f789f06ec8 100644 --- a/tasks/0094_698_94698351_qa_2/task.toml +++ b/tasks/0094_698_94698351_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_875_94875423_qa_3/environment/bootstrap.sh b/tasks/0094_875_94875423_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_875_94875423_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_875_94875423_qa_3/environment/pull_bucket.py b/tasks/0094_875_94875423_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_875_94875423_qa_3/environment/pull_bucket.py +++ b/tasks/0094_875_94875423_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_875_94875423_qa_3/task.toml b/tasks/0094_875_94875423_qa_3/task.toml index 870da477d962fb1a9677bc33b4a28ca09e17fffb..60c61a170f39ac4d369698d08754da06b10c13d5 100644 --- a/tasks/0094_875_94875423_qa_3/task.toml +++ b/tasks/0094_875_94875423_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_883_94883618_qa_1/environment/bootstrap.sh b/tasks/0094_883_94883618_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_883_94883618_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_883_94883618_qa_1/environment/pull_bucket.py b/tasks/0094_883_94883618_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_883_94883618_qa_1/environment/pull_bucket.py +++ b/tasks/0094_883_94883618_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_883_94883618_qa_1/task.toml b/tasks/0094_883_94883618_qa_1/task.toml index 885c41ad18524451a034096629bbd56462c1acf7..5c088c944fb05c279f42a83fa26b55a9badb1030 100644 --- a/tasks/0094_883_94883618_qa_1/task.toml +++ b/tasks/0094_883_94883618_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_969_94969707_qa_1/environment/bootstrap.sh b/tasks/0094_969_94969707_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_969_94969707_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_969_94969707_qa_1/environment/pull_bucket.py b/tasks/0094_969_94969707_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_969_94969707_qa_1/environment/pull_bucket.py +++ b/tasks/0094_969_94969707_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_969_94969707_qa_1/task.toml b/tasks/0094_969_94969707_qa_1/task.toml index 24804d0af91b635fc081da83153d6127f966c197..ee06251a20400d4ff0d504e4c421dbbeaa296b53 100644 --- a/tasks/0094_969_94969707_qa_1/task.toml +++ b/tasks/0094_969_94969707_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_969_94969707_qa_5/environment/bootstrap.sh b/tasks/0094_969_94969707_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_969_94969707_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_969_94969707_qa_5/environment/pull_bucket.py b/tasks/0094_969_94969707_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_969_94969707_qa_5/environment/pull_bucket.py +++ b/tasks/0094_969_94969707_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_969_94969707_qa_5/task.toml b/tasks/0094_969_94969707_qa_5/task.toml index a753edc33c915fcbc33bbc836736335639ddc1cd..bd100b6948e314d2f741319e7f542bec21673f20 100644 --- a/tasks/0094_969_94969707_qa_5/task.toml +++ b/tasks/0094_969_94969707_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0094_991_94991853_qa_3/environment/bootstrap.sh b/tasks/0094_991_94991853_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0094_991_94991853_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0094_991_94991853_qa_3/environment/pull_bucket.py b/tasks/0094_991_94991853_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0094_991_94991853_qa_3/environment/pull_bucket.py +++ b/tasks/0094_991_94991853_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0094_991_94991853_qa_3/task.toml b/tasks/0094_991_94991853_qa_3/task.toml index 232789ea0db56a656cc2b206728384ca6d0fd111..225f26c45beffad552dc2c95a85852be5998f890 100644 --- a/tasks/0094_991_94991853_qa_3/task.toml +++ b/tasks/0094_991_94991853_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_053_95053072_qa_1/environment/bootstrap.sh b/tasks/0095_053_95053072_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_053_95053072_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_053_95053072_qa_1/environment/pull_bucket.py b/tasks/0095_053_95053072_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_053_95053072_qa_1/environment/pull_bucket.py +++ b/tasks/0095_053_95053072_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_053_95053072_qa_1/task.toml b/tasks/0095_053_95053072_qa_1/task.toml index bb375a7644e467ae562661589f985d6b08660fa2..27b527a1fd96ef51d45f23d6eb44a534ca675d52 100644 --- a/tasks/0095_053_95053072_qa_1/task.toml +++ b/tasks/0095_053_95053072_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_057_95057992_qa_2/environment/bootstrap.sh b/tasks/0095_057_95057992_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_057_95057992_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_057_95057992_qa_2/environment/pull_bucket.py b/tasks/0095_057_95057992_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_057_95057992_qa_2/environment/pull_bucket.py +++ b/tasks/0095_057_95057992_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_057_95057992_qa_2/task.toml b/tasks/0095_057_95057992_qa_2/task.toml index f7cb6b5e926a3332eca861e07eb704a49739bea5..784d332911c9884bc6f35734695dff80a7c6a5aa 100644 --- a/tasks/0095_057_95057992_qa_2/task.toml +++ b/tasks/0095_057_95057992_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_057_95057992_qa_4/environment/bootstrap.sh b/tasks/0095_057_95057992_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_057_95057992_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_057_95057992_qa_4/environment/pull_bucket.py b/tasks/0095_057_95057992_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_057_95057992_qa_4/environment/pull_bucket.py +++ b/tasks/0095_057_95057992_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_057_95057992_qa_4/task.toml b/tasks/0095_057_95057992_qa_4/task.toml index 2fe9417e6210ebdf8a6cb78a03c752e4d2200ac3..fb69306a5a0462e9cc996da3d68341b4c03380f7 100644 --- a/tasks/0095_057_95057992_qa_4/task.toml +++ b/tasks/0095_057_95057992_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_085_95085137_qa_2/environment/bootstrap.sh b/tasks/0095_085_95085137_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_085_95085137_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_085_95085137_qa_2/environment/pull_bucket.py b/tasks/0095_085_95085137_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_085_95085137_qa_2/environment/pull_bucket.py +++ b/tasks/0095_085_95085137_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_085_95085137_qa_2/task.toml b/tasks/0095_085_95085137_qa_2/task.toml index 2b7a552cf3ab758931dc50fc04803af63559c627..76bada212d756c08374635ed0622e883e913c155 100644 --- a/tasks/0095_085_95085137_qa_2/task.toml +++ b/tasks/0095_085_95085137_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_085_95085137_qa_4/environment/bootstrap.sh b/tasks/0095_085_95085137_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_085_95085137_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_085_95085137_qa_4/environment/pull_bucket.py b/tasks/0095_085_95085137_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_085_95085137_qa_4/environment/pull_bucket.py +++ b/tasks/0095_085_95085137_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_085_95085137_qa_4/task.toml b/tasks/0095_085_95085137_qa_4/task.toml index 58f2c0c8b6f29a9348d3e0e6dad90640ffc777cd..7eb1769139b6725a0b338f53de7121488239b456 100644 --- a/tasks/0095_085_95085137_qa_4/task.toml +++ b/tasks/0095_085_95085137_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_088_95088024_qa_1/environment/bootstrap.sh b/tasks/0095_088_95088024_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_088_95088024_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_088_95088024_qa_1/environment/pull_bucket.py b/tasks/0095_088_95088024_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_088_95088024_qa_1/environment/pull_bucket.py +++ b/tasks/0095_088_95088024_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_088_95088024_qa_1/task.toml b/tasks/0095_088_95088024_qa_1/task.toml index ce2cbb57eeaee8762addae851f633b7524b6b64f..5bb6439be9b603f1ebe06f6a60d2f92ba21c023e 100644 --- a/tasks/0095_088_95088024_qa_1/task.toml +++ b/tasks/0095_088_95088024_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_143_95143885_qa_3/environment/bootstrap.sh b/tasks/0095_143_95143885_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_143_95143885_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_143_95143885_qa_3/environment/pull_bucket.py b/tasks/0095_143_95143885_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_143_95143885_qa_3/environment/pull_bucket.py +++ b/tasks/0095_143_95143885_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_143_95143885_qa_3/task.toml b/tasks/0095_143_95143885_qa_3/task.toml index e9ed8c09b78d5b76a88b8c0d0bd29c43d6e0f6ea..89c9ab736729208bdb04641dcfb6f4db0fc6f6be 100644 --- a/tasks/0095_143_95143885_qa_3/task.toml +++ b/tasks/0095_143_95143885_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_143_95143885_qa_4/environment/bootstrap.sh b/tasks/0095_143_95143885_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_143_95143885_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_143_95143885_qa_4/environment/pull_bucket.py b/tasks/0095_143_95143885_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_143_95143885_qa_4/environment/pull_bucket.py +++ b/tasks/0095_143_95143885_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_143_95143885_qa_4/task.toml b/tasks/0095_143_95143885_qa_4/task.toml index eb298a43b7e7532da23fef193f7b0acb92af0db0..d867e91ed921c66c51c28f17f4291e3aebcfc696 100644 --- a/tasks/0095_143_95143885_qa_4/task.toml +++ b/tasks/0095_143_95143885_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_202_95202118_qa_3/environment/bootstrap.sh b/tasks/0095_202_95202118_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_202_95202118_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_202_95202118_qa_3/environment/pull_bucket.py b/tasks/0095_202_95202118_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_202_95202118_qa_3/environment/pull_bucket.py +++ b/tasks/0095_202_95202118_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_202_95202118_qa_3/task.toml b/tasks/0095_202_95202118_qa_3/task.toml index 35bc152591e883e674c89c48ac08a56df6c5e9e6..987a9ba73776b3c256bd80ee8bda853e216325ea 100644 --- a/tasks/0095_202_95202118_qa_3/task.toml +++ b/tasks/0095_202_95202118_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_202_95202118_qa_5/environment/bootstrap.sh b/tasks/0095_202_95202118_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_202_95202118_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_202_95202118_qa_5/environment/pull_bucket.py b/tasks/0095_202_95202118_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_202_95202118_qa_5/environment/pull_bucket.py +++ b/tasks/0095_202_95202118_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_202_95202118_qa_5/task.toml b/tasks/0095_202_95202118_qa_5/task.toml index 5adb8bb69e8d25e27c1971928e0c510bf44e907e..93dd9b7b3da4f2ea557b0326a2d67a14f73174ae 100644 --- a/tasks/0095_202_95202118_qa_5/task.toml +++ b/tasks/0095_202_95202118_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_223_95223929_qa_4/environment/bootstrap.sh b/tasks/0095_223_95223929_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_223_95223929_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_223_95223929_qa_4/environment/pull_bucket.py b/tasks/0095_223_95223929_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_223_95223929_qa_4/environment/pull_bucket.py +++ b/tasks/0095_223_95223929_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_223_95223929_qa_4/task.toml b/tasks/0095_223_95223929_qa_4/task.toml index 9f377ce93e706ee2bc96a4a45960a55c2df5ac95..7ef999868f01cd0b845ba44258a6a77c2a3f81a9 100644 --- a/tasks/0095_223_95223929_qa_4/task.toml +++ b/tasks/0095_223_95223929_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_223_95223929_qa_5/environment/bootstrap.sh b/tasks/0095_223_95223929_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_223_95223929_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_223_95223929_qa_5/environment/pull_bucket.py b/tasks/0095_223_95223929_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_223_95223929_qa_5/environment/pull_bucket.py +++ b/tasks/0095_223_95223929_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_223_95223929_qa_5/task.toml b/tasks/0095_223_95223929_qa_5/task.toml index c8a399ab7cb4b6060029d73d32688f266e8371fb..6fa8ebd2b54b33f32905b24a90364594a05ef55a 100644 --- a/tasks/0095_223_95223929_qa_5/task.toml +++ b/tasks/0095_223_95223929_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_236_95236707_qa_2/environment/bootstrap.sh b/tasks/0095_236_95236707_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_236_95236707_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_236_95236707_qa_2/environment/pull_bucket.py b/tasks/0095_236_95236707_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_236_95236707_qa_2/environment/pull_bucket.py +++ b/tasks/0095_236_95236707_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_236_95236707_qa_2/task.toml b/tasks/0095_236_95236707_qa_2/task.toml index 52cfa7bcd345b9727c2b14e5bfbaae12b32b79bf..c6ccf5d514fa8f6d101eb20d60327a27453f0421 100644 --- a/tasks/0095_236_95236707_qa_2/task.toml +++ b/tasks/0095_236_95236707_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_334_95334310_qa_2/environment/bootstrap.sh b/tasks/0095_334_95334310_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_334_95334310_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_334_95334310_qa_2/environment/pull_bucket.py b/tasks/0095_334_95334310_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_334_95334310_qa_2/environment/pull_bucket.py +++ b/tasks/0095_334_95334310_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_334_95334310_qa_2/task.toml b/tasks/0095_334_95334310_qa_2/task.toml index a694c73d5360944c547d9f9086de1e7a493f61e6..137a8b1bb3980b0313ffcc7d154ce1eec4603271 100644 --- a/tasks/0095_334_95334310_qa_2/task.toml +++ b/tasks/0095_334_95334310_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_334_95334310_qa_5/environment/bootstrap.sh b/tasks/0095_334_95334310_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_334_95334310_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_334_95334310_qa_5/environment/pull_bucket.py b/tasks/0095_334_95334310_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_334_95334310_qa_5/environment/pull_bucket.py +++ b/tasks/0095_334_95334310_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_334_95334310_qa_5/task.toml b/tasks/0095_334_95334310_qa_5/task.toml index a47e2410d63de80a144eb2a63569e48efabff73e..32edd4fcac9c43665551a56c58c855667b88798a 100644 --- a/tasks/0095_334_95334310_qa_5/task.toml +++ b/tasks/0095_334_95334310_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_339_95339518_qa_4/environment/bootstrap.sh b/tasks/0095_339_95339518_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_339_95339518_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_339_95339518_qa_4/environment/pull_bucket.py b/tasks/0095_339_95339518_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_339_95339518_qa_4/environment/pull_bucket.py +++ b/tasks/0095_339_95339518_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_339_95339518_qa_4/task.toml b/tasks/0095_339_95339518_qa_4/task.toml index 86602bebff6a6d87f2ca3341a3a7cbe06a3831ed..0bfced26e7fd729dff03c0f2df1a6a210babab2b 100644 --- a/tasks/0095_339_95339518_qa_4/task.toml +++ b/tasks/0095_339_95339518_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_339_95339518_qa_5/environment/bootstrap.sh b/tasks/0095_339_95339518_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_339_95339518_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_339_95339518_qa_5/environment/pull_bucket.py b/tasks/0095_339_95339518_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_339_95339518_qa_5/environment/pull_bucket.py +++ b/tasks/0095_339_95339518_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_339_95339518_qa_5/task.toml b/tasks/0095_339_95339518_qa_5/task.toml index aaf4b2ab02a8912894d8c06d5f1aeae89a1f6fea..f5c5005569393327a937be8bbab67f66074d9b65 100644 --- a/tasks/0095_339_95339518_qa_5/task.toml +++ b/tasks/0095_339_95339518_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_344_95344142_qa_3/environment/bootstrap.sh b/tasks/0095_344_95344142_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_344_95344142_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_344_95344142_qa_3/environment/pull_bucket.py b/tasks/0095_344_95344142_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_344_95344142_qa_3/environment/pull_bucket.py +++ b/tasks/0095_344_95344142_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_344_95344142_qa_3/task.toml b/tasks/0095_344_95344142_qa_3/task.toml index 3ec3e3e37a6889dcaa87c0682b5e6dfb86e54805..5548c8c9391ec3e54ff3be84daa157df99a078cc 100644 --- a/tasks/0095_344_95344142_qa_3/task.toml +++ b/tasks/0095_344_95344142_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_344_95344142_qa_4/environment/bootstrap.sh b/tasks/0095_344_95344142_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_344_95344142_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_344_95344142_qa_4/environment/pull_bucket.py b/tasks/0095_344_95344142_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_344_95344142_qa_4/environment/pull_bucket.py +++ b/tasks/0095_344_95344142_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_344_95344142_qa_4/task.toml b/tasks/0095_344_95344142_qa_4/task.toml index 5dc6c75a4f7c848cb74d7407e2e2a27b76f9414a..c00ce370ccb9c133de809eac0cd365cd97ba7024 100644 --- a/tasks/0095_344_95344142_qa_4/task.toml +++ b/tasks/0095_344_95344142_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_395_95395894_qa_2/environment/bootstrap.sh b/tasks/0095_395_95395894_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_395_95395894_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_395_95395894_qa_2/environment/pull_bucket.py b/tasks/0095_395_95395894_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_395_95395894_qa_2/environment/pull_bucket.py +++ b/tasks/0095_395_95395894_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_395_95395894_qa_2/task.toml b/tasks/0095_395_95395894_qa_2/task.toml index a532baa51999ceae46993b4215dfcadc450ee7f0..29089b7b5b67e625beece8b07157bff5352cbc1f 100644 --- a/tasks/0095_395_95395894_qa_2/task.toml +++ b/tasks/0095_395_95395894_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_624_95624401_qa_2/environment/bootstrap.sh b/tasks/0095_624_95624401_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_624_95624401_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_624_95624401_qa_2/environment/pull_bucket.py b/tasks/0095_624_95624401_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_624_95624401_qa_2/environment/pull_bucket.py +++ b/tasks/0095_624_95624401_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_624_95624401_qa_2/task.toml b/tasks/0095_624_95624401_qa_2/task.toml index 39564dfe0c6fc60db771c8d97145ada9de53ce53..396f7007ebf979c617a4c3f17dcdcd74f97a2609 100644 --- a/tasks/0095_624_95624401_qa_2/task.toml +++ b/tasks/0095_624_95624401_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_666_95666563_qa_5/environment/bootstrap.sh b/tasks/0095_666_95666563_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_666_95666563_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_666_95666563_qa_5/environment/pull_bucket.py b/tasks/0095_666_95666563_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_666_95666563_qa_5/environment/pull_bucket.py +++ b/tasks/0095_666_95666563_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_666_95666563_qa_5/task.toml b/tasks/0095_666_95666563_qa_5/task.toml index 7f2d339583bd3c9cf33061bded7fa9be892cccfb..76208c65f24949e18ad8eb641a3cfc2497bbbcdc 100644 --- a/tasks/0095_666_95666563_qa_5/task.toml +++ b/tasks/0095_666_95666563_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_690_95690898_qa_3/environment/bootstrap.sh b/tasks/0095_690_95690898_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_690_95690898_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_690_95690898_qa_3/environment/pull_bucket.py b/tasks/0095_690_95690898_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_690_95690898_qa_3/environment/pull_bucket.py +++ b/tasks/0095_690_95690898_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_690_95690898_qa_3/task.toml b/tasks/0095_690_95690898_qa_3/task.toml index 3d879233de2190a5c6b03b257296102c42ba60ae..187a59430ee3af55e0a539acdc5918b049fca129 100644 --- a/tasks/0095_690_95690898_qa_3/task.toml +++ b/tasks/0095_690_95690898_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_690_95690898_qa_5/environment/bootstrap.sh b/tasks/0095_690_95690898_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_690_95690898_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_690_95690898_qa_5/environment/pull_bucket.py b/tasks/0095_690_95690898_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_690_95690898_qa_5/environment/pull_bucket.py +++ b/tasks/0095_690_95690898_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_690_95690898_qa_5/task.toml b/tasks/0095_690_95690898_qa_5/task.toml index 60e168b69ee18854c48b6605d179571f5d5c6b78..cbb84d76955eb50f0fbe64bdd88a0ec9c62f800b 100644 --- a/tasks/0095_690_95690898_qa_5/task.toml +++ b/tasks/0095_690_95690898_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_795_95795358_qa_4/environment/bootstrap.sh b/tasks/0095_795_95795358_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_795_95795358_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_795_95795358_qa_4/environment/pull_bucket.py b/tasks/0095_795_95795358_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_795_95795358_qa_4/environment/pull_bucket.py +++ b/tasks/0095_795_95795358_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_795_95795358_qa_4/task.toml b/tasks/0095_795_95795358_qa_4/task.toml index 86a051f1977d7044b96f27e122a1c8cf8628d061..efe86127b6d9243c80e781403c88a0d8c649d226 100644 --- a/tasks/0095_795_95795358_qa_4/task.toml +++ b/tasks/0095_795_95795358_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_843_95843375_qa_1/environment/bootstrap.sh b/tasks/0095_843_95843375_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_843_95843375_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_843_95843375_qa_1/environment/pull_bucket.py b/tasks/0095_843_95843375_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_843_95843375_qa_1/environment/pull_bucket.py +++ b/tasks/0095_843_95843375_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_843_95843375_qa_1/task.toml b/tasks/0095_843_95843375_qa_1/task.toml index fd8efd3000102b297a2d334536cd9a244d32a6f7..5db2a158b1f811e163f34357579ecb539b677525 100644 --- a/tasks/0095_843_95843375_qa_1/task.toml +++ b/tasks/0095_843_95843375_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_843_95843375_qa_3/environment/bootstrap.sh b/tasks/0095_843_95843375_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_843_95843375_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_843_95843375_qa_3/environment/pull_bucket.py b/tasks/0095_843_95843375_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_843_95843375_qa_3/environment/pull_bucket.py +++ b/tasks/0095_843_95843375_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_843_95843375_qa_3/task.toml b/tasks/0095_843_95843375_qa_3/task.toml index 9662861c18eda025913c5fe6a08faec5d415d363..0e282ba1beb6c5da234fad852a673f34ef6cecfa 100644 --- a/tasks/0095_843_95843375_qa_3/task.toml +++ b/tasks/0095_843_95843375_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_843_95843375_qa_4/environment/bootstrap.sh b/tasks/0095_843_95843375_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_843_95843375_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_843_95843375_qa_4/environment/pull_bucket.py b/tasks/0095_843_95843375_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_843_95843375_qa_4/environment/pull_bucket.py +++ b/tasks/0095_843_95843375_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_843_95843375_qa_4/task.toml b/tasks/0095_843_95843375_qa_4/task.toml index 8c614db3101a55c65d887ec894f166a3076188f9..c05b274623c3b5afc50b6f822b67030fe44139c7 100644 --- a/tasks/0095_843_95843375_qa_4/task.toml +++ b/tasks/0095_843_95843375_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_843_95843375_qa_5/environment/bootstrap.sh b/tasks/0095_843_95843375_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_843_95843375_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_843_95843375_qa_5/environment/pull_bucket.py b/tasks/0095_843_95843375_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_843_95843375_qa_5/environment/pull_bucket.py +++ b/tasks/0095_843_95843375_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_843_95843375_qa_5/task.toml b/tasks/0095_843_95843375_qa_5/task.toml index aa003a6535df5225fa83a61b1630fb2e0ad2d2c8..cc6934ee924659c26e21e10536dae335b9c09a3c 100644 --- a/tasks/0095_843_95843375_qa_5/task.toml +++ b/tasks/0095_843_95843375_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_877_95877877_qa_3/environment/bootstrap.sh b/tasks/0095_877_95877877_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_877_95877877_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_877_95877877_qa_3/environment/pull_bucket.py b/tasks/0095_877_95877877_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_877_95877877_qa_3/environment/pull_bucket.py +++ b/tasks/0095_877_95877877_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_877_95877877_qa_3/task.toml b/tasks/0095_877_95877877_qa_3/task.toml index 2fc1f4e0949b662bfaec1d0fcfbd600bebe69b9f..c0b7e6df81a3b086890a6c00e64ffb380a45029a 100644 --- a/tasks/0095_877_95877877_qa_3/task.toml +++ b/tasks/0095_877_95877877_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_909_95909431_qa_3/environment/bootstrap.sh b/tasks/0095_909_95909431_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_909_95909431_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_909_95909431_qa_3/environment/pull_bucket.py b/tasks/0095_909_95909431_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_909_95909431_qa_3/environment/pull_bucket.py +++ b/tasks/0095_909_95909431_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_909_95909431_qa_3/task.toml b/tasks/0095_909_95909431_qa_3/task.toml index 7aae674f4ec7861da39742e8bac5797d7abd9e1f..e5dbb8c955ac6ec3aef039a4e735d096c4a08466 100644 --- a/tasks/0095_909_95909431_qa_3/task.toml +++ b/tasks/0095_909_95909431_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0095_909_95909431_qa_4/environment/bootstrap.sh b/tasks/0095_909_95909431_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0095_909_95909431_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0095_909_95909431_qa_4/environment/pull_bucket.py b/tasks/0095_909_95909431_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0095_909_95909431_qa_4/environment/pull_bucket.py +++ b/tasks/0095_909_95909431_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0095_909_95909431_qa_4/task.toml b/tasks/0095_909_95909431_qa_4/task.toml index d6ea02d0a49e144fd7c520a4e85881cf43b048ca..641c0205a5937f4632b513fb0693481c04aaefbc 100644 --- a/tasks/0095_909_95909431_qa_4/task.toml +++ b/tasks/0095_909_95909431_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_057_96057481_qa_1/environment/bootstrap.sh b/tasks/0096_057_96057481_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_057_96057481_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_057_96057481_qa_1/environment/pull_bucket.py b/tasks/0096_057_96057481_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_057_96057481_qa_1/environment/pull_bucket.py +++ b/tasks/0096_057_96057481_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_057_96057481_qa_1/task.toml b/tasks/0096_057_96057481_qa_1/task.toml index c09cab064a4ea1648ed3eb8fef64952d383ece34..21c5a5984d7bca6bcdd43be6d4024bd7efa87217 100644 --- a/tasks/0096_057_96057481_qa_1/task.toml +++ b/tasks/0096_057_96057481_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_057_96057481_qa_2/environment/bootstrap.sh b/tasks/0096_057_96057481_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_057_96057481_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_057_96057481_qa_2/environment/pull_bucket.py b/tasks/0096_057_96057481_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_057_96057481_qa_2/environment/pull_bucket.py +++ b/tasks/0096_057_96057481_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_057_96057481_qa_2/task.toml b/tasks/0096_057_96057481_qa_2/task.toml index b5ed467e3bd2ae0e964eea45209baa5704387717..27bbacb544e6cd8f14d82a3f98b329806af86c6f 100644 --- a/tasks/0096_057_96057481_qa_2/task.toml +++ b/tasks/0096_057_96057481_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_064_96064872_qa_1/environment/bootstrap.sh b/tasks/0096_064_96064872_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_064_96064872_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_064_96064872_qa_1/environment/pull_bucket.py b/tasks/0096_064_96064872_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_064_96064872_qa_1/environment/pull_bucket.py +++ b/tasks/0096_064_96064872_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_064_96064872_qa_1/task.toml b/tasks/0096_064_96064872_qa_1/task.toml index cb685fab216b0efdeb9928ee73d4d81dda7f56f6..0859bd2ed652bb67e8820dc6aa6b5f724a79bca0 100644 --- a/tasks/0096_064_96064872_qa_1/task.toml +++ b/tasks/0096_064_96064872_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_064_96064872_qa_2/environment/bootstrap.sh b/tasks/0096_064_96064872_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_064_96064872_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_064_96064872_qa_2/environment/pull_bucket.py b/tasks/0096_064_96064872_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_064_96064872_qa_2/environment/pull_bucket.py +++ b/tasks/0096_064_96064872_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_064_96064872_qa_2/task.toml b/tasks/0096_064_96064872_qa_2/task.toml index 071bf5c29a3af07e2925c09fd66b0633aa699640..2390ac6db6235625847d870924ebcbce6e73d6e9 100644 --- a/tasks/0096_064_96064872_qa_2/task.toml +++ b/tasks/0096_064_96064872_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_192_96192841_qa_2/environment/bootstrap.sh b/tasks/0096_192_96192841_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_192_96192841_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_192_96192841_qa_2/environment/pull_bucket.py b/tasks/0096_192_96192841_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_192_96192841_qa_2/environment/pull_bucket.py +++ b/tasks/0096_192_96192841_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_192_96192841_qa_2/task.toml b/tasks/0096_192_96192841_qa_2/task.toml index 5e0161d58e67619019d044ee4716fc1504816f49..c8e0a66ada9620530387b22f476bd827190f092b 100644 --- a/tasks/0096_192_96192841_qa_2/task.toml +++ b/tasks/0096_192_96192841_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_192_96192841_qa_5/environment/bootstrap.sh b/tasks/0096_192_96192841_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_192_96192841_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_192_96192841_qa_5/environment/pull_bucket.py b/tasks/0096_192_96192841_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_192_96192841_qa_5/environment/pull_bucket.py +++ b/tasks/0096_192_96192841_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_192_96192841_qa_5/task.toml b/tasks/0096_192_96192841_qa_5/task.toml index d7459f7aaf1247c79daeee43cdfdc24ed6d6760a..4fe4c120192d9b8e2c09c18ce59550b72d8d9b9b 100644 --- a/tasks/0096_192_96192841_qa_5/task.toml +++ b/tasks/0096_192_96192841_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_217_96217754_qa_3/environment/bootstrap.sh b/tasks/0096_217_96217754_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_217_96217754_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_217_96217754_qa_3/environment/pull_bucket.py b/tasks/0096_217_96217754_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_217_96217754_qa_3/environment/pull_bucket.py +++ b/tasks/0096_217_96217754_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_217_96217754_qa_3/task.toml b/tasks/0096_217_96217754_qa_3/task.toml index f2c19115fb1efd33c2f7bd45f1930d34bf8feafc..127c4ee0ea3ccbc360e08e2565857dfbe8bdceda 100644 --- a/tasks/0096_217_96217754_qa_3/task.toml +++ b/tasks/0096_217_96217754_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_217_96217754_qa_4/environment/bootstrap.sh b/tasks/0096_217_96217754_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_217_96217754_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_217_96217754_qa_4/environment/pull_bucket.py b/tasks/0096_217_96217754_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_217_96217754_qa_4/environment/pull_bucket.py +++ b/tasks/0096_217_96217754_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_217_96217754_qa_4/task.toml b/tasks/0096_217_96217754_qa_4/task.toml index 540f1e6d0bd45c84c0d4d79164b2f3318e81c4c9..72b26ae73e0b69952d7e37692dd6601593691207 100644 --- a/tasks/0096_217_96217754_qa_4/task.toml +++ b/tasks/0096_217_96217754_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_295_96295649_qa_2/environment/bootstrap.sh b/tasks/0096_295_96295649_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_295_96295649_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_295_96295649_qa_2/environment/pull_bucket.py b/tasks/0096_295_96295649_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_295_96295649_qa_2/environment/pull_bucket.py +++ b/tasks/0096_295_96295649_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_295_96295649_qa_2/task.toml b/tasks/0096_295_96295649_qa_2/task.toml index 102a8f9f3300cc74f9fa788620bd00750c5a7e99..73fc3582d64b53d78f14a6a803d6bf1ddd2d5c97 100644 --- a/tasks/0096_295_96295649_qa_2/task.toml +++ b/tasks/0096_295_96295649_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_460_96460762_qa_2/environment/bootstrap.sh b/tasks/0096_460_96460762_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_460_96460762_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_460_96460762_qa_2/environment/pull_bucket.py b/tasks/0096_460_96460762_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_460_96460762_qa_2/environment/pull_bucket.py +++ b/tasks/0096_460_96460762_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_460_96460762_qa_2/task.toml b/tasks/0096_460_96460762_qa_2/task.toml index 55e2ac82c72a9c20ca367910088f67a5380236de..ad9f031018f2fda5118a9e5e63aa37cb79938fd9 100644 --- a/tasks/0096_460_96460762_qa_2/task.toml +++ b/tasks/0096_460_96460762_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_460_96460762_qa_3/environment/bootstrap.sh b/tasks/0096_460_96460762_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_460_96460762_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_460_96460762_qa_3/environment/pull_bucket.py b/tasks/0096_460_96460762_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_460_96460762_qa_3/environment/pull_bucket.py +++ b/tasks/0096_460_96460762_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_460_96460762_qa_3/task.toml b/tasks/0096_460_96460762_qa_3/task.toml index 1a753faea0dabaf2e7504119d211e6ff5cb19dd7..2e18c362b06cef366c85874b78eb654d105064dc 100644 --- a/tasks/0096_460_96460762_qa_3/task.toml +++ b/tasks/0096_460_96460762_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_460_96460762_qa_5/environment/bootstrap.sh b/tasks/0096_460_96460762_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_460_96460762_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_460_96460762_qa_5/environment/pull_bucket.py b/tasks/0096_460_96460762_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_460_96460762_qa_5/environment/pull_bucket.py +++ b/tasks/0096_460_96460762_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_460_96460762_qa_5/task.toml b/tasks/0096_460_96460762_qa_5/task.toml index f4cdf697e0b6ec6477de989c536a215988a7784c..78c0e11e5bacea9d0b00de30c795b80d9b429466 100644 --- a/tasks/0096_460_96460762_qa_5/task.toml +++ b/tasks/0096_460_96460762_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_673_96673455_qa_1/environment/bootstrap.sh b/tasks/0096_673_96673455_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_673_96673455_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_673_96673455_qa_1/environment/pull_bucket.py b/tasks/0096_673_96673455_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_673_96673455_qa_1/environment/pull_bucket.py +++ b/tasks/0096_673_96673455_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_673_96673455_qa_1/task.toml b/tasks/0096_673_96673455_qa_1/task.toml index ecb9df49f7db58e3febeb2239fccb9fba3487998..cff5be957b38a05aa4274ab360ed9b581632bf41 100644 --- a/tasks/0096_673_96673455_qa_1/task.toml +++ b/tasks/0096_673_96673455_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_765_96765273_qa_4/environment/bootstrap.sh b/tasks/0096_765_96765273_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_765_96765273_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_765_96765273_qa_4/environment/pull_bucket.py b/tasks/0096_765_96765273_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_765_96765273_qa_4/environment/pull_bucket.py +++ b/tasks/0096_765_96765273_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_765_96765273_qa_4/task.toml b/tasks/0096_765_96765273_qa_4/task.toml index df20fc5e27257ae7ae26a2cec8bf3fb98b38ff5a..d62cfb2dba7b287652534929835cafa2bd7353f4 100644 --- a/tasks/0096_765_96765273_qa_4/task.toml +++ b/tasks/0096_765_96765273_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_765_96765273_qa_5/environment/bootstrap.sh b/tasks/0096_765_96765273_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_765_96765273_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_765_96765273_qa_5/environment/pull_bucket.py b/tasks/0096_765_96765273_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_765_96765273_qa_5/environment/pull_bucket.py +++ b/tasks/0096_765_96765273_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_765_96765273_qa_5/task.toml b/tasks/0096_765_96765273_qa_5/task.toml index d21c7ae02fc36d68b134318782cf24b0665e8770..f08d647a391c6261292b241bf464443448d69da4 100644 --- a/tasks/0096_765_96765273_qa_5/task.toml +++ b/tasks/0096_765_96765273_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_778_96778684_qa_2/environment/bootstrap.sh b/tasks/0096_778_96778684_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_778_96778684_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_778_96778684_qa_2/environment/pull_bucket.py b/tasks/0096_778_96778684_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_778_96778684_qa_2/environment/pull_bucket.py +++ b/tasks/0096_778_96778684_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_778_96778684_qa_2/task.toml b/tasks/0096_778_96778684_qa_2/task.toml index bb4ae3a9cf78f22114e4db1fbdd7ed09d5eccaa2..2975e415c7018b8ba562a5803b288582c737c87f 100644 --- a/tasks/0096_778_96778684_qa_2/task.toml +++ b/tasks/0096_778_96778684_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_784_96784965_qa_2/environment/bootstrap.sh b/tasks/0096_784_96784965_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_784_96784965_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_784_96784965_qa_2/environment/pull_bucket.py b/tasks/0096_784_96784965_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_784_96784965_qa_2/environment/pull_bucket.py +++ b/tasks/0096_784_96784965_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_784_96784965_qa_2/task.toml b/tasks/0096_784_96784965_qa_2/task.toml index f09529e9b387fb09db904d641b80caa18492a417..30aa322288d9883fc67dc92c4dbad69f82d4cead 100644 --- a/tasks/0096_784_96784965_qa_2/task.toml +++ b/tasks/0096_784_96784965_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_863_96863277_qa_1/environment/bootstrap.sh b/tasks/0096_863_96863277_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_863_96863277_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_863_96863277_qa_1/environment/pull_bucket.py b/tasks/0096_863_96863277_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_863_96863277_qa_1/environment/pull_bucket.py +++ b/tasks/0096_863_96863277_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_863_96863277_qa_1/task.toml b/tasks/0096_863_96863277_qa_1/task.toml index 2c76e6ac43a39548f65d0e4b61b56d17520d1f1d..daacbc4556e372fda0b74c835e0a00cfcc36a192 100644 --- a/tasks/0096_863_96863277_qa_1/task.toml +++ b/tasks/0096_863_96863277_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_889_96889516_qa_4/environment/bootstrap.sh b/tasks/0096_889_96889516_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_889_96889516_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_889_96889516_qa_4/environment/pull_bucket.py b/tasks/0096_889_96889516_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_889_96889516_qa_4/environment/pull_bucket.py +++ b/tasks/0096_889_96889516_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_889_96889516_qa_4/task.toml b/tasks/0096_889_96889516_qa_4/task.toml index f7f8f0079000be01f1d8193e7d301110538319d6..994ac759d49a3b4b43bdd2c9096ee7e131a404e9 100644 --- a/tasks/0096_889_96889516_qa_4/task.toml +++ b/tasks/0096_889_96889516_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_889_96889516_qa_5/environment/bootstrap.sh b/tasks/0096_889_96889516_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_889_96889516_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_889_96889516_qa_5/environment/pull_bucket.py b/tasks/0096_889_96889516_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_889_96889516_qa_5/environment/pull_bucket.py +++ b/tasks/0096_889_96889516_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_889_96889516_qa_5/task.toml b/tasks/0096_889_96889516_qa_5/task.toml index 3d7dbcd8d0bbc996abc1609351dbee8f05c13a50..3fb23249912471c211291da80bff1e41238493ea 100644 --- a/tasks/0096_889_96889516_qa_5/task.toml +++ b/tasks/0096_889_96889516_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_904_96904544_qa_4/environment/bootstrap.sh b/tasks/0096_904_96904544_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_904_96904544_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_904_96904544_qa_4/environment/pull_bucket.py b/tasks/0096_904_96904544_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_904_96904544_qa_4/environment/pull_bucket.py +++ b/tasks/0096_904_96904544_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_904_96904544_qa_4/task.toml b/tasks/0096_904_96904544_qa_4/task.toml index 5b04bfff4bce6c8242e50c2b3ccc4bc524450467..3396ba821b7b1be354af1a2fc92761006329d3e7 100644 --- a/tasks/0096_904_96904544_qa_4/task.toml +++ b/tasks/0096_904_96904544_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_940_96940611_qa_1/environment/bootstrap.sh b/tasks/0096_940_96940611_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_940_96940611_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_940_96940611_qa_1/environment/pull_bucket.py b/tasks/0096_940_96940611_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_940_96940611_qa_1/environment/pull_bucket.py +++ b/tasks/0096_940_96940611_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_940_96940611_qa_1/task.toml b/tasks/0096_940_96940611_qa_1/task.toml index 2efb0b86a366e30cd36bb92ddcd3344406f96595..134b814402df75c42f47a672b70bd38f682b2ec8 100644 --- a/tasks/0096_940_96940611_qa_1/task.toml +++ b/tasks/0096_940_96940611_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_973_96973759_qa_3/environment/bootstrap.sh b/tasks/0096_973_96973759_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_973_96973759_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_973_96973759_qa_3/environment/pull_bucket.py b/tasks/0096_973_96973759_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_973_96973759_qa_3/environment/pull_bucket.py +++ b/tasks/0096_973_96973759_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_973_96973759_qa_3/task.toml b/tasks/0096_973_96973759_qa_3/task.toml index 851208bc805c88d3a98f00e9ff46d1ed4dbb1eb8..727eb64b5fee155aa65c845bfeb4d45b168f8cce 100644 --- a/tasks/0096_973_96973759_qa_3/task.toml +++ b/tasks/0096_973_96973759_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_979_96979035_qa_2/environment/bootstrap.sh b/tasks/0096_979_96979035_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_979_96979035_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_979_96979035_qa_2/environment/pull_bucket.py b/tasks/0096_979_96979035_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_979_96979035_qa_2/environment/pull_bucket.py +++ b/tasks/0096_979_96979035_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_979_96979035_qa_2/task.toml b/tasks/0096_979_96979035_qa_2/task.toml index 71616243744094b97c69947df5efa7da47ff597f..d42de00db04fabdb786fd0f2aedd54b7ee89f2b5 100644 --- a/tasks/0096_979_96979035_qa_2/task.toml +++ b/tasks/0096_979_96979035_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0096_997_96997158_qa_1/environment/bootstrap.sh b/tasks/0096_997_96997158_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0096_997_96997158_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0096_997_96997158_qa_1/environment/pull_bucket.py b/tasks/0096_997_96997158_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0096_997_96997158_qa_1/environment/pull_bucket.py +++ b/tasks/0096_997_96997158_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0096_997_96997158_qa_1/task.toml b/tasks/0096_997_96997158_qa_1/task.toml index 5691b19aa9c364541ed6bc2c0e2d280f399dda1d..6ffb9eb6adf7fa6fe9d4b0d2b6204d6890c5c408 100644 --- a/tasks/0096_997_96997158_qa_1/task.toml +++ b/tasks/0096_997_96997158_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_014_97014488_qa_2/environment/bootstrap.sh b/tasks/0097_014_97014488_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_014_97014488_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_014_97014488_qa_2/environment/pull_bucket.py b/tasks/0097_014_97014488_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_014_97014488_qa_2/environment/pull_bucket.py +++ b/tasks/0097_014_97014488_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_014_97014488_qa_2/task.toml b/tasks/0097_014_97014488_qa_2/task.toml index 9b5db7ec28842a649e322715a998d08881b26db4..42448364ba109732140d280fd748e0293c0473a9 100644 --- a/tasks/0097_014_97014488_qa_2/task.toml +++ b/tasks/0097_014_97014488_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_014_97014488_qa_3/environment/bootstrap.sh b/tasks/0097_014_97014488_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_014_97014488_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_014_97014488_qa_3/environment/pull_bucket.py b/tasks/0097_014_97014488_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_014_97014488_qa_3/environment/pull_bucket.py +++ b/tasks/0097_014_97014488_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_014_97014488_qa_3/task.toml b/tasks/0097_014_97014488_qa_3/task.toml index faf9090fec855c55520c74cd6534bd6b8863ba22..cbcab4fcf40c2d303f2e2e81ad1f240f450de289 100644 --- a/tasks/0097_014_97014488_qa_3/task.toml +++ b/tasks/0097_014_97014488_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_022_97022263_qa_1/environment/bootstrap.sh b/tasks/0097_022_97022263_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_022_97022263_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_022_97022263_qa_1/environment/pull_bucket.py b/tasks/0097_022_97022263_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_022_97022263_qa_1/environment/pull_bucket.py +++ b/tasks/0097_022_97022263_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_022_97022263_qa_1/task.toml b/tasks/0097_022_97022263_qa_1/task.toml index bbf803d76fc6b06c2e2285a55bb308fd17cd5c75..35f1a8fa4273d399fb0a56b7455222e6c934165f 100644 --- a/tasks/0097_022_97022263_qa_1/task.toml +++ b/tasks/0097_022_97022263_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_040_97040168_qa_3/environment/bootstrap.sh b/tasks/0097_040_97040168_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_040_97040168_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_040_97040168_qa_3/environment/pull_bucket.py b/tasks/0097_040_97040168_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_040_97040168_qa_3/environment/pull_bucket.py +++ b/tasks/0097_040_97040168_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_040_97040168_qa_3/task.toml b/tasks/0097_040_97040168_qa_3/task.toml index 1902cdcb066b485ffb5f2ffcfc2ffce6a6b89df0..66b8ae0d17ea0d6681fcdef0798defc382a71e8c 100644 --- a/tasks/0097_040_97040168_qa_3/task.toml +++ b/tasks/0097_040_97040168_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_086_97086766_qa_4/environment/bootstrap.sh b/tasks/0097_086_97086766_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_086_97086766_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_086_97086766_qa_4/environment/pull_bucket.py b/tasks/0097_086_97086766_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_086_97086766_qa_4/environment/pull_bucket.py +++ b/tasks/0097_086_97086766_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_086_97086766_qa_4/task.toml b/tasks/0097_086_97086766_qa_4/task.toml index 22bd20faf0cdb791a77c5a66583b354c3df6e659..2a58f08d7391af6ce064320817507277b625e671 100644 --- a/tasks/0097_086_97086766_qa_4/task.toml +++ b/tasks/0097_086_97086766_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_228_97228368_qa_4/environment/bootstrap.sh b/tasks/0097_228_97228368_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_228_97228368_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_228_97228368_qa_4/environment/pull_bucket.py b/tasks/0097_228_97228368_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_228_97228368_qa_4/environment/pull_bucket.py +++ b/tasks/0097_228_97228368_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_228_97228368_qa_4/task.toml b/tasks/0097_228_97228368_qa_4/task.toml index 4f1831e36e8ad16ab508542631c288aeb1b423cd..449c8efbe6f419751af04787265c53bfe78f90df 100644 --- a/tasks/0097_228_97228368_qa_4/task.toml +++ b/tasks/0097_228_97228368_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_228_97228368_qa_5/environment/bootstrap.sh b/tasks/0097_228_97228368_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_228_97228368_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_228_97228368_qa_5/environment/pull_bucket.py b/tasks/0097_228_97228368_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_228_97228368_qa_5/environment/pull_bucket.py +++ b/tasks/0097_228_97228368_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_228_97228368_qa_5/task.toml b/tasks/0097_228_97228368_qa_5/task.toml index fa5dba46b7cf35011bd0b23652cfb5f0832a1b19..9a78b709c427cc28004b6f0892b2c9d00f1b21b2 100644 --- a/tasks/0097_228_97228368_qa_5/task.toml +++ b/tasks/0097_228_97228368_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_234_97234597_qa_3/environment/bootstrap.sh b/tasks/0097_234_97234597_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_234_97234597_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_234_97234597_qa_3/environment/pull_bucket.py b/tasks/0097_234_97234597_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_234_97234597_qa_3/environment/pull_bucket.py +++ b/tasks/0097_234_97234597_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_234_97234597_qa_3/task.toml b/tasks/0097_234_97234597_qa_3/task.toml index 3bcb9be09267970453613d417737a3cd28ea9d94..75195c59809493aa1663966de04e9e73f3182dcb 100644 --- a/tasks/0097_234_97234597_qa_3/task.toml +++ b/tasks/0097_234_97234597_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_283_97283539_qa_3/environment/bootstrap.sh b/tasks/0097_283_97283539_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_283_97283539_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_283_97283539_qa_3/environment/pull_bucket.py b/tasks/0097_283_97283539_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_283_97283539_qa_3/environment/pull_bucket.py +++ b/tasks/0097_283_97283539_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_283_97283539_qa_3/task.toml b/tasks/0097_283_97283539_qa_3/task.toml index 88f68a6ae82987bdd652167d951d0dbd38d942a4..bf50e85b48cc54667c5716474bf4211d9b804ecc 100644 --- a/tasks/0097_283_97283539_qa_3/task.toml +++ b/tasks/0097_283_97283539_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_326_97326157_qa_5/environment/bootstrap.sh b/tasks/0097_326_97326157_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_326_97326157_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_326_97326157_qa_5/environment/pull_bucket.py b/tasks/0097_326_97326157_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_326_97326157_qa_5/environment/pull_bucket.py +++ b/tasks/0097_326_97326157_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_326_97326157_qa_5/task.toml b/tasks/0097_326_97326157_qa_5/task.toml index a760311e66910e420c0ea421d59e8ba3ee732e93..18b96d707208c1a21530f2e2f2f5d94345a2d550 100644 --- a/tasks/0097_326_97326157_qa_5/task.toml +++ b/tasks/0097_326_97326157_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_377_97377124_qa_1/environment/bootstrap.sh b/tasks/0097_377_97377124_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_377_97377124_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_377_97377124_qa_1/environment/pull_bucket.py b/tasks/0097_377_97377124_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_377_97377124_qa_1/environment/pull_bucket.py +++ b/tasks/0097_377_97377124_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_377_97377124_qa_1/task.toml b/tasks/0097_377_97377124_qa_1/task.toml index 016257a2959207802f16fa3c33a3902061e31cf3..47ce02573015a098c17dd76ab5f52888334ca4b4 100644 --- a/tasks/0097_377_97377124_qa_1/task.toml +++ b/tasks/0097_377_97377124_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_377_97377124_qa_2/environment/bootstrap.sh b/tasks/0097_377_97377124_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_377_97377124_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_377_97377124_qa_2/environment/pull_bucket.py b/tasks/0097_377_97377124_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_377_97377124_qa_2/environment/pull_bucket.py +++ b/tasks/0097_377_97377124_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_377_97377124_qa_2/task.toml b/tasks/0097_377_97377124_qa_2/task.toml index 8a3ae9d5fa7a499c83e5c89b4833a8e047e09a00..1247a973f7791a424e7c3c14082276325660df7b 100644 --- a/tasks/0097_377_97377124_qa_2/task.toml +++ b/tasks/0097_377_97377124_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_409_97409368_qa_2/environment/bootstrap.sh b/tasks/0097_409_97409368_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_409_97409368_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_409_97409368_qa_2/environment/pull_bucket.py b/tasks/0097_409_97409368_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_409_97409368_qa_2/environment/pull_bucket.py +++ b/tasks/0097_409_97409368_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_409_97409368_qa_2/task.toml b/tasks/0097_409_97409368_qa_2/task.toml index 1d05d4e3038c4b0c1796ad91a437e3466a4447d1..43769b595510c0b4ccda71d7a08ea7f4866be2f7 100644 --- a/tasks/0097_409_97409368_qa_2/task.toml +++ b/tasks/0097_409_97409368_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_494_97494334_qa_5/environment/bootstrap.sh b/tasks/0097_494_97494334_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_494_97494334_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_494_97494334_qa_5/environment/pull_bucket.py b/tasks/0097_494_97494334_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_494_97494334_qa_5/environment/pull_bucket.py +++ b/tasks/0097_494_97494334_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_494_97494334_qa_5/task.toml b/tasks/0097_494_97494334_qa_5/task.toml index 2e3b9ead4c5a82577189052fbc740baa256f0092..8f7b065afe157f58aca4880dbd97aa3d79567619 100644 --- a/tasks/0097_494_97494334_qa_5/task.toml +++ b/tasks/0097_494_97494334_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_524_97524649_qa_1/environment/bootstrap.sh b/tasks/0097_524_97524649_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_524_97524649_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_524_97524649_qa_1/environment/pull_bucket.py b/tasks/0097_524_97524649_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_524_97524649_qa_1/environment/pull_bucket.py +++ b/tasks/0097_524_97524649_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_524_97524649_qa_1/task.toml b/tasks/0097_524_97524649_qa_1/task.toml index 1237dd75f9d2965e8662e7325e028aa219288d44..015089e4fbc83b228151223ffc412a7c88537274 100644 --- a/tasks/0097_524_97524649_qa_1/task.toml +++ b/tasks/0097_524_97524649_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_527_97527301_qa_3/environment/bootstrap.sh b/tasks/0097_527_97527301_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_527_97527301_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_527_97527301_qa_3/environment/pull_bucket.py b/tasks/0097_527_97527301_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_527_97527301_qa_3/environment/pull_bucket.py +++ b/tasks/0097_527_97527301_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_527_97527301_qa_3/task.toml b/tasks/0097_527_97527301_qa_3/task.toml index a7c643d614075bd4301ba98180c15380351e0e91..5fa548701062312223555f35637817f4014d78e2 100644 --- a/tasks/0097_527_97527301_qa_3/task.toml +++ b/tasks/0097_527_97527301_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_565_97565207_qa_4/environment/bootstrap.sh b/tasks/0097_565_97565207_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_565_97565207_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_565_97565207_qa_4/environment/pull_bucket.py b/tasks/0097_565_97565207_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_565_97565207_qa_4/environment/pull_bucket.py +++ b/tasks/0097_565_97565207_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_565_97565207_qa_4/task.toml b/tasks/0097_565_97565207_qa_4/task.toml index 2fdfe69084685844d6e24d314bde19ce36f91462..93daaeaace7dbcfa82a1dd54024e20caf3ad5400 100644 --- a/tasks/0097_565_97565207_qa_4/task.toml +++ b/tasks/0097_565_97565207_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_585_97585155_qa_2/environment/bootstrap.sh b/tasks/0097_585_97585155_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_585_97585155_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_585_97585155_qa_2/environment/pull_bucket.py b/tasks/0097_585_97585155_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_585_97585155_qa_2/environment/pull_bucket.py +++ b/tasks/0097_585_97585155_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_585_97585155_qa_2/task.toml b/tasks/0097_585_97585155_qa_2/task.toml index b0030f31e6460d24efc9acaa11a8fce3abbfac71..86d5929053cb770507fbbf69f3a08e3021d88223 100644 --- a/tasks/0097_585_97585155_qa_2/task.toml +++ b/tasks/0097_585_97585155_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_585_97585155_qa_3/environment/bootstrap.sh b/tasks/0097_585_97585155_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_585_97585155_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_585_97585155_qa_3/environment/pull_bucket.py b/tasks/0097_585_97585155_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_585_97585155_qa_3/environment/pull_bucket.py +++ b/tasks/0097_585_97585155_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_585_97585155_qa_3/task.toml b/tasks/0097_585_97585155_qa_3/task.toml index 951234fd2cd9d159bfd10e2e3d5ef8cf12bc04c6..8023a37f1e099764db982b0300281646bfd1e096 100644 --- a/tasks/0097_585_97585155_qa_3/task.toml +++ b/tasks/0097_585_97585155_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_618_97618724_qa_3/environment/bootstrap.sh b/tasks/0097_618_97618724_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_618_97618724_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_618_97618724_qa_3/environment/pull_bucket.py b/tasks/0097_618_97618724_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_618_97618724_qa_3/environment/pull_bucket.py +++ b/tasks/0097_618_97618724_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_618_97618724_qa_3/task.toml b/tasks/0097_618_97618724_qa_3/task.toml index 06305b40a426ffe499d958594bf0237931a9196f..1b12eb3142ade50505b6fcb1ce8b4349fccb83a3 100644 --- a/tasks/0097_618_97618724_qa_3/task.toml +++ b/tasks/0097_618_97618724_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_698_97698987_qa_4/environment/bootstrap.sh b/tasks/0097_698_97698987_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_698_97698987_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_698_97698987_qa_4/environment/pull_bucket.py b/tasks/0097_698_97698987_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_698_97698987_qa_4/environment/pull_bucket.py +++ b/tasks/0097_698_97698987_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_698_97698987_qa_4/task.toml b/tasks/0097_698_97698987_qa_4/task.toml index af4911b6addaf5187822433298e533fcd99e04d1..3d9b080e997fc1a3001ec5bfd3d5959bb7946eb6 100644 --- a/tasks/0097_698_97698987_qa_4/task.toml +++ b/tasks/0097_698_97698987_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_708_97708214_qa_2/environment/bootstrap.sh b/tasks/0097_708_97708214_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_708_97708214_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_708_97708214_qa_2/environment/pull_bucket.py b/tasks/0097_708_97708214_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_708_97708214_qa_2/environment/pull_bucket.py +++ b/tasks/0097_708_97708214_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_708_97708214_qa_2/task.toml b/tasks/0097_708_97708214_qa_2/task.toml index 020a5324dd2b2ebbc130f75a283fa991ae5c4ed3..7e78e4d591e62eba88e8469d3e8aba39205b8d40 100644 --- a/tasks/0097_708_97708214_qa_2/task.toml +++ b/tasks/0097_708_97708214_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_809_97809761_qa_2/environment/bootstrap.sh b/tasks/0097_809_97809761_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_809_97809761_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_809_97809761_qa_2/environment/pull_bucket.py b/tasks/0097_809_97809761_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_809_97809761_qa_2/environment/pull_bucket.py +++ b/tasks/0097_809_97809761_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_809_97809761_qa_2/task.toml b/tasks/0097_809_97809761_qa_2/task.toml index de99cae9293bfedbf8fdf4355c330ca8275ca28f..7333813a6eef4851026f1610ae2fb6b3e497eeca 100644 --- a/tasks/0097_809_97809761_qa_2/task.toml +++ b/tasks/0097_809_97809761_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_844_97844965_qa_2/environment/bootstrap.sh b/tasks/0097_844_97844965_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_844_97844965_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_844_97844965_qa_2/environment/pull_bucket.py b/tasks/0097_844_97844965_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_844_97844965_qa_2/environment/pull_bucket.py +++ b/tasks/0097_844_97844965_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_844_97844965_qa_2/task.toml b/tasks/0097_844_97844965_qa_2/task.toml index 48b9ef649f7fb256e8ea4dadd6416f25da0d7d24..5c04f1819f656961fae4751c213b83eb2c4bd8d6 100644 --- a/tasks/0097_844_97844965_qa_2/task.toml +++ b/tasks/0097_844_97844965_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_932_97932913_qa_1/environment/bootstrap.sh b/tasks/0097_932_97932913_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_932_97932913_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_932_97932913_qa_1/environment/pull_bucket.py b/tasks/0097_932_97932913_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_932_97932913_qa_1/environment/pull_bucket.py +++ b/tasks/0097_932_97932913_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_932_97932913_qa_1/task.toml b/tasks/0097_932_97932913_qa_1/task.toml index 1f11c9e4c98ad13b2bc4ba991d532ac6f67ee863..f8fc35b69956e5c5ee2f7f0b38caee94a5366ff4 100644 --- a/tasks/0097_932_97932913_qa_1/task.toml +++ b/tasks/0097_932_97932913_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0097_932_97932913_qa_4/environment/bootstrap.sh b/tasks/0097_932_97932913_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0097_932_97932913_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0097_932_97932913_qa_4/environment/pull_bucket.py b/tasks/0097_932_97932913_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0097_932_97932913_qa_4/environment/pull_bucket.py +++ b/tasks/0097_932_97932913_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0097_932_97932913_qa_4/task.toml b/tasks/0097_932_97932913_qa_4/task.toml index 9c2db11b44c0262c5e2fff383cdde00266205c2d..cfea9cbfe64cf494e475408bfa7fdb49c86cdc18 100644 --- a/tasks/0097_932_97932913_qa_4/task.toml +++ b/tasks/0097_932_97932913_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_017_98017526_qa_4/environment/bootstrap.sh b/tasks/0098_017_98017526_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_017_98017526_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_017_98017526_qa_4/environment/pull_bucket.py b/tasks/0098_017_98017526_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_017_98017526_qa_4/environment/pull_bucket.py +++ b/tasks/0098_017_98017526_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_017_98017526_qa_4/task.toml b/tasks/0098_017_98017526_qa_4/task.toml index ea66af2875cae528852283d0a32e8f830d61f986..2cc1e8e333ba125d1d6e2ca06b4c91b948eeef5a 100644 --- a/tasks/0098_017_98017526_qa_4/task.toml +++ b/tasks/0098_017_98017526_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_017_98017526_qa_5/environment/bootstrap.sh b/tasks/0098_017_98017526_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_017_98017526_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_017_98017526_qa_5/environment/pull_bucket.py b/tasks/0098_017_98017526_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_017_98017526_qa_5/environment/pull_bucket.py +++ b/tasks/0098_017_98017526_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_017_98017526_qa_5/task.toml b/tasks/0098_017_98017526_qa_5/task.toml index 23638823aee14b31f5eed254b858f67761d34ac7..b74529243297e92559b928f97b99ee9931575e21 100644 --- a/tasks/0098_017_98017526_qa_5/task.toml +++ b/tasks/0098_017_98017526_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_340_98340653_qa_5/environment/bootstrap.sh b/tasks/0098_340_98340653_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_340_98340653_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_340_98340653_qa_5/environment/pull_bucket.py b/tasks/0098_340_98340653_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_340_98340653_qa_5/environment/pull_bucket.py +++ b/tasks/0098_340_98340653_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_340_98340653_qa_5/task.toml b/tasks/0098_340_98340653_qa_5/task.toml index 43125d726760cca6171e2e0e5cea46ed09f5e3a6..73f3c339b57448d5e106d10400f3ff4b64542554 100644 --- a/tasks/0098_340_98340653_qa_5/task.toml +++ b/tasks/0098_340_98340653_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_341_98341485_qa_2/environment/bootstrap.sh b/tasks/0098_341_98341485_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_341_98341485_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_341_98341485_qa_2/environment/pull_bucket.py b/tasks/0098_341_98341485_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_341_98341485_qa_2/environment/pull_bucket.py +++ b/tasks/0098_341_98341485_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_341_98341485_qa_2/task.toml b/tasks/0098_341_98341485_qa_2/task.toml index 1f18845d9f2dcdcc4ea07d7bc967c99751025d3e..44edd7adcf3db5d4c5025d292a72b8ce1b76cb9a 100644 --- a/tasks/0098_341_98341485_qa_2/task.toml +++ b/tasks/0098_341_98341485_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_375_98375855_qa_2/environment/bootstrap.sh b/tasks/0098_375_98375855_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_375_98375855_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_375_98375855_qa_2/environment/pull_bucket.py b/tasks/0098_375_98375855_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_375_98375855_qa_2/environment/pull_bucket.py +++ b/tasks/0098_375_98375855_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_375_98375855_qa_2/task.toml b/tasks/0098_375_98375855_qa_2/task.toml index 0b667b7006b66b8932f85907c6eb0340042b5859..5f8832425b797c1aca2507d97232e2ee57152d2f 100644 --- a/tasks/0098_375_98375855_qa_2/task.toml +++ b/tasks/0098_375_98375855_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_463_98463251_qa_3/environment/bootstrap.sh b/tasks/0098_463_98463251_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_463_98463251_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_463_98463251_qa_3/environment/pull_bucket.py b/tasks/0098_463_98463251_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_463_98463251_qa_3/environment/pull_bucket.py +++ b/tasks/0098_463_98463251_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_463_98463251_qa_3/task.toml b/tasks/0098_463_98463251_qa_3/task.toml index 2e9298b36685ad43b020f5351b4e9214fabb7a39..34afdf9f3b0bee61492573566009a6e4f1847f41 100644 --- a/tasks/0098_463_98463251_qa_3/task.toml +++ b/tasks/0098_463_98463251_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_464_98464481_qa_1/environment/bootstrap.sh b/tasks/0098_464_98464481_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_464_98464481_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_464_98464481_qa_1/environment/pull_bucket.py b/tasks/0098_464_98464481_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_464_98464481_qa_1/environment/pull_bucket.py +++ b/tasks/0098_464_98464481_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_464_98464481_qa_1/task.toml b/tasks/0098_464_98464481_qa_1/task.toml index 90f0cc7c1d6c253bdeddc0850e240aaa752f593d..095432f6244d8c1fc2ab152f5f3c32d86f66b105 100644 --- a/tasks/0098_464_98464481_qa_1/task.toml +++ b/tasks/0098_464_98464481_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_595_98595052_qa_2/environment/bootstrap.sh b/tasks/0098_595_98595052_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_595_98595052_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_595_98595052_qa_2/environment/pull_bucket.py b/tasks/0098_595_98595052_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_595_98595052_qa_2/environment/pull_bucket.py +++ b/tasks/0098_595_98595052_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_595_98595052_qa_2/task.toml b/tasks/0098_595_98595052_qa_2/task.toml index d8c5fa18604ec274a5085b5758efb073a5c8f7bf..ddb6f6e47359c67f62d8c1513f0589bc6a208897 100644 --- a/tasks/0098_595_98595052_qa_2/task.toml +++ b/tasks/0098_595_98595052_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_605_98605018_qa_3/environment/bootstrap.sh b/tasks/0098_605_98605018_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_605_98605018_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_605_98605018_qa_3/environment/pull_bucket.py b/tasks/0098_605_98605018_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_605_98605018_qa_3/environment/pull_bucket.py +++ b/tasks/0098_605_98605018_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_605_98605018_qa_3/task.toml b/tasks/0098_605_98605018_qa_3/task.toml index 57c3e1dc223b1e00094fee072dd1a0baba1b8898..29700c0026497a2e9de1864652e4246980b4bf8d 100644 --- a/tasks/0098_605_98605018_qa_3/task.toml +++ b/tasks/0098_605_98605018_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_620_98620020_qa_2/environment/bootstrap.sh b/tasks/0098_620_98620020_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_620_98620020_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_620_98620020_qa_2/environment/pull_bucket.py b/tasks/0098_620_98620020_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_620_98620020_qa_2/environment/pull_bucket.py +++ b/tasks/0098_620_98620020_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_620_98620020_qa_2/task.toml b/tasks/0098_620_98620020_qa_2/task.toml index c5577b5e39bd89e51acf5866c2d9aaff77a04f26..bdb57dfd0ec4171fb5dcf00a3ad1cb374108ba9f 100644 --- a/tasks/0098_620_98620020_qa_2/task.toml +++ b/tasks/0098_620_98620020_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_681_98681805_qa_3/environment/bootstrap.sh b/tasks/0098_681_98681805_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_681_98681805_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_681_98681805_qa_3/environment/pull_bucket.py b/tasks/0098_681_98681805_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_681_98681805_qa_3/environment/pull_bucket.py +++ b/tasks/0098_681_98681805_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_681_98681805_qa_3/task.toml b/tasks/0098_681_98681805_qa_3/task.toml index da374c27c02ab59dbf7c34a8e8d22e9cab407a7d..b9d6224db97f1211b68b6523e42251e7b98f2b0e 100644 --- a/tasks/0098_681_98681805_qa_3/task.toml +++ b/tasks/0098_681_98681805_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_690_98690564_qa_1/environment/bootstrap.sh b/tasks/0098_690_98690564_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_690_98690564_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_690_98690564_qa_1/environment/pull_bucket.py b/tasks/0098_690_98690564_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_690_98690564_qa_1/environment/pull_bucket.py +++ b/tasks/0098_690_98690564_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_690_98690564_qa_1/task.toml b/tasks/0098_690_98690564_qa_1/task.toml index 2f1a0976a9805f8637d54093e22c490bf6b6db48..3b00377fa39608aaf38653d3521efecea7351061 100644 --- a/tasks/0098_690_98690564_qa_1/task.toml +++ b/tasks/0098_690_98690564_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_690_98690564_qa_2/environment/bootstrap.sh b/tasks/0098_690_98690564_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_690_98690564_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_690_98690564_qa_2/environment/pull_bucket.py b/tasks/0098_690_98690564_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_690_98690564_qa_2/environment/pull_bucket.py +++ b/tasks/0098_690_98690564_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_690_98690564_qa_2/task.toml b/tasks/0098_690_98690564_qa_2/task.toml index 785a2e628229e4cb539f48b0f766672bf0c6f21f..e0a497acc1dbe18e4bcaafea0e1fa21e8214ce60 100644 --- a/tasks/0098_690_98690564_qa_2/task.toml +++ b/tasks/0098_690_98690564_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_690_98690564_qa_3/environment/bootstrap.sh b/tasks/0098_690_98690564_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_690_98690564_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_690_98690564_qa_3/environment/pull_bucket.py b/tasks/0098_690_98690564_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_690_98690564_qa_3/environment/pull_bucket.py +++ b/tasks/0098_690_98690564_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_690_98690564_qa_3/task.toml b/tasks/0098_690_98690564_qa_3/task.toml index 2aa9610cff2fa979678e79a8a0168ac02573ca7d..f6efded21b907a3f20fa61144e53c065a62770cd 100644 --- a/tasks/0098_690_98690564_qa_3/task.toml +++ b/tasks/0098_690_98690564_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_690_98690564_qa_5/environment/bootstrap.sh b/tasks/0098_690_98690564_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_690_98690564_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_690_98690564_qa_5/environment/pull_bucket.py b/tasks/0098_690_98690564_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_690_98690564_qa_5/environment/pull_bucket.py +++ b/tasks/0098_690_98690564_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_690_98690564_qa_5/task.toml b/tasks/0098_690_98690564_qa_5/task.toml index 7bdb0889597803f6a0eaf209d17aa96e33fd5521..f7eca98a5876be5389aab248d97e6e1706b2e160 100644 --- a/tasks/0098_690_98690564_qa_5/task.toml +++ b/tasks/0098_690_98690564_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_760_98760521_qa_3/environment/bootstrap.sh b/tasks/0098_760_98760521_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_760_98760521_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_760_98760521_qa_3/environment/pull_bucket.py b/tasks/0098_760_98760521_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_760_98760521_qa_3/environment/pull_bucket.py +++ b/tasks/0098_760_98760521_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_760_98760521_qa_3/task.toml b/tasks/0098_760_98760521_qa_3/task.toml index 639a423496f2959e80ecdc15407fef1009782311..1424c0b59f14a07ad2909e4662083ab191b1e1a5 100644 --- a/tasks/0098_760_98760521_qa_3/task.toml +++ b/tasks/0098_760_98760521_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_812_98812520_qa_1/environment/bootstrap.sh b/tasks/0098_812_98812520_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_812_98812520_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_812_98812520_qa_1/environment/pull_bucket.py b/tasks/0098_812_98812520_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_812_98812520_qa_1/environment/pull_bucket.py +++ b/tasks/0098_812_98812520_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_812_98812520_qa_1/task.toml b/tasks/0098_812_98812520_qa_1/task.toml index ecb651bb0d29d2c921db4fca5ac4a5611efbb1e8..27b2a9761ca07a8e9e9ca7a30fdc80e2fe6d3800 100644 --- a/tasks/0098_812_98812520_qa_1/task.toml +++ b/tasks/0098_812_98812520_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_812_98812520_qa_4/environment/bootstrap.sh b/tasks/0098_812_98812520_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_812_98812520_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_812_98812520_qa_4/environment/pull_bucket.py b/tasks/0098_812_98812520_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_812_98812520_qa_4/environment/pull_bucket.py +++ b/tasks/0098_812_98812520_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_812_98812520_qa_4/task.toml b/tasks/0098_812_98812520_qa_4/task.toml index 44cb983d0fc528afc2f90a5925daf9684a3a4651..7ae7ebaf8f77676b70d2c457f123b565d9f6915a 100644 --- a/tasks/0098_812_98812520_qa_4/task.toml +++ b/tasks/0098_812_98812520_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_819_98819760_qa_2/environment/bootstrap.sh b/tasks/0098_819_98819760_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_819_98819760_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_819_98819760_qa_2/environment/pull_bucket.py b/tasks/0098_819_98819760_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_819_98819760_qa_2/environment/pull_bucket.py +++ b/tasks/0098_819_98819760_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_819_98819760_qa_2/task.toml b/tasks/0098_819_98819760_qa_2/task.toml index bc03c235c084b9db631685bc90ab286e27f7c221..5cd4214efad0f1c6ab49746d010f9502e538e06d 100644 --- a/tasks/0098_819_98819760_qa_2/task.toml +++ b/tasks/0098_819_98819760_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_819_98819760_qa_5/environment/bootstrap.sh b/tasks/0098_819_98819760_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_819_98819760_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_819_98819760_qa_5/environment/pull_bucket.py b/tasks/0098_819_98819760_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_819_98819760_qa_5/environment/pull_bucket.py +++ b/tasks/0098_819_98819760_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_819_98819760_qa_5/task.toml b/tasks/0098_819_98819760_qa_5/task.toml index 94bb3c1975d411252a3ee97a3b85d6cd7e8d9602..5e84a674372373c69e14cd18557b921054a4c32b 100644 --- a/tasks/0098_819_98819760_qa_5/task.toml +++ b/tasks/0098_819_98819760_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_892_98892916_qa_3/environment/bootstrap.sh b/tasks/0098_892_98892916_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_892_98892916_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_892_98892916_qa_3/environment/pull_bucket.py b/tasks/0098_892_98892916_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_892_98892916_qa_3/environment/pull_bucket.py +++ b/tasks/0098_892_98892916_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_892_98892916_qa_3/task.toml b/tasks/0098_892_98892916_qa_3/task.toml index eae63a006207663efb3fcce0ce16db3a66df7dba..87718d3e3ffaaf6dc145f702ba6fbe2569d3ef5c 100644 --- a/tasks/0098_892_98892916_qa_3/task.toml +++ b/tasks/0098_892_98892916_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_910_98910010_qa_4/environment/bootstrap.sh b/tasks/0098_910_98910010_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_910_98910010_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_910_98910010_qa_4/environment/pull_bucket.py b/tasks/0098_910_98910010_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_910_98910010_qa_4/environment/pull_bucket.py +++ b/tasks/0098_910_98910010_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_910_98910010_qa_4/task.toml b/tasks/0098_910_98910010_qa_4/task.toml index 5093b4a7ff2bbc0bcf90db3e0df056092fb878ee..15fd491284d1939378b50dc70d9c49c31e4036f6 100644 --- a/tasks/0098_910_98910010_qa_4/task.toml +++ b/tasks/0098_910_98910010_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_941_98941500_qa_5/environment/bootstrap.sh b/tasks/0098_941_98941500_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_941_98941500_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_941_98941500_qa_5/environment/pull_bucket.py b/tasks/0098_941_98941500_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_941_98941500_qa_5/environment/pull_bucket.py +++ b/tasks/0098_941_98941500_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_941_98941500_qa_5/task.toml b/tasks/0098_941_98941500_qa_5/task.toml index 83d5742133cf6950245be3e40e8e029849595e07..69df32ad7a9d7aa35d44b429fffa8d0ae99642a4 100644 --- a/tasks/0098_941_98941500_qa_5/task.toml +++ b/tasks/0098_941_98941500_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0098_969_98969166_qa_1/environment/bootstrap.sh b/tasks/0098_969_98969166_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0098_969_98969166_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0098_969_98969166_qa_1/environment/pull_bucket.py b/tasks/0098_969_98969166_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0098_969_98969166_qa_1/environment/pull_bucket.py +++ b/tasks/0098_969_98969166_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0098_969_98969166_qa_1/task.toml b/tasks/0098_969_98969166_qa_1/task.toml index 91aa4380d96f9ee5f83fca4d7ca16152af7e0f04..8da6dd0ddf533e84453b3aed754e32cc7800176a 100644 --- a/tasks/0098_969_98969166_qa_1/task.toml +++ b/tasks/0098_969_98969166_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_029_99029048_qa_4/environment/bootstrap.sh b/tasks/0099_029_99029048_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_029_99029048_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_029_99029048_qa_4/environment/pull_bucket.py b/tasks/0099_029_99029048_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_029_99029048_qa_4/environment/pull_bucket.py +++ b/tasks/0099_029_99029048_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_029_99029048_qa_4/task.toml b/tasks/0099_029_99029048_qa_4/task.toml index 7e32e74f1eca013c19511209c90c5e65f9908bed..980c0a8a110a2869ec18e3638e8bc69d380059d5 100644 --- a/tasks/0099_029_99029048_qa_4/task.toml +++ b/tasks/0099_029_99029048_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_089_99089980_qa_1/environment/bootstrap.sh b/tasks/0099_089_99089980_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_089_99089980_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_089_99089980_qa_1/environment/pull_bucket.py b/tasks/0099_089_99089980_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_089_99089980_qa_1/environment/pull_bucket.py +++ b/tasks/0099_089_99089980_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_089_99089980_qa_1/task.toml b/tasks/0099_089_99089980_qa_1/task.toml index 1cd2e8334d55696a3e52b44d2f869e50b1331eb1..1b5f6f53a6ba0b0f9b13937f761f576e4dd2fa9c 100644 --- a/tasks/0099_089_99089980_qa_1/task.toml +++ b/tasks/0099_089_99089980_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_222_99222402_qa_2/environment/bootstrap.sh b/tasks/0099_222_99222402_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_222_99222402_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_222_99222402_qa_2/environment/pull_bucket.py b/tasks/0099_222_99222402_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_222_99222402_qa_2/environment/pull_bucket.py +++ b/tasks/0099_222_99222402_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_222_99222402_qa_2/task.toml b/tasks/0099_222_99222402_qa_2/task.toml index bba711d37253eecc9a3f3d34539157c58fa888c2..4fe77643bfa054bab659d01f5ff23d9d465602de 100644 --- a/tasks/0099_222_99222402_qa_2/task.toml +++ b/tasks/0099_222_99222402_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_222_99222402_qa_3/environment/bootstrap.sh b/tasks/0099_222_99222402_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_222_99222402_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_222_99222402_qa_3/environment/pull_bucket.py b/tasks/0099_222_99222402_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_222_99222402_qa_3/environment/pull_bucket.py +++ b/tasks/0099_222_99222402_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_222_99222402_qa_3/task.toml b/tasks/0099_222_99222402_qa_3/task.toml index 4f86774cc1f180cb3520ff98648d7d7a8c6f5dfa..a90565553ce18b9056e0505de4cccedc5acc19ac 100644 --- a/tasks/0099_222_99222402_qa_3/task.toml +++ b/tasks/0099_222_99222402_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_268_99268253_qa_1/environment/bootstrap.sh b/tasks/0099_268_99268253_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_268_99268253_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_268_99268253_qa_1/environment/pull_bucket.py b/tasks/0099_268_99268253_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_268_99268253_qa_1/environment/pull_bucket.py +++ b/tasks/0099_268_99268253_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_268_99268253_qa_1/task.toml b/tasks/0099_268_99268253_qa_1/task.toml index b2a97d058ced9c125a6ca1e221bea90b682e33f5..e89da4d33c3333edb1b149fee802abbdc78bfdc3 100644 --- a/tasks/0099_268_99268253_qa_1/task.toml +++ b/tasks/0099_268_99268253_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_302_99302626_qa_3/environment/bootstrap.sh b/tasks/0099_302_99302626_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_302_99302626_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_302_99302626_qa_3/environment/pull_bucket.py b/tasks/0099_302_99302626_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_302_99302626_qa_3/environment/pull_bucket.py +++ b/tasks/0099_302_99302626_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_302_99302626_qa_3/task.toml b/tasks/0099_302_99302626_qa_3/task.toml index 5a180bc2ea0618921dcfd3b3ed4731dc3c5df872..398c56c8d081b39f2aed358326f2745393fb6b3c 100644 --- a/tasks/0099_302_99302626_qa_3/task.toml +++ b/tasks/0099_302_99302626_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_308_99308206_qa_3/environment/bootstrap.sh b/tasks/0099_308_99308206_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_308_99308206_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_308_99308206_qa_3/environment/pull_bucket.py b/tasks/0099_308_99308206_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_308_99308206_qa_3/environment/pull_bucket.py +++ b/tasks/0099_308_99308206_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_308_99308206_qa_3/task.toml b/tasks/0099_308_99308206_qa_3/task.toml index 28dde74e605bd1c6bcb13d7eea368097e3483c69..73bbfa3979a4f996b7f9a367cb540883686f5728 100644 --- a/tasks/0099_308_99308206_qa_3/task.toml +++ b/tasks/0099_308_99308206_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_308_99308206_qa_5/environment/bootstrap.sh b/tasks/0099_308_99308206_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_308_99308206_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_308_99308206_qa_5/environment/pull_bucket.py b/tasks/0099_308_99308206_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_308_99308206_qa_5/environment/pull_bucket.py +++ b/tasks/0099_308_99308206_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_308_99308206_qa_5/task.toml b/tasks/0099_308_99308206_qa_5/task.toml index 7022167a91ffd95a07e7e1f58ddd4db594265899..8c9205194f424e70ff5ccbdd27812430e6e8ef45 100644 --- a/tasks/0099_308_99308206_qa_5/task.toml +++ b/tasks/0099_308_99308206_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_323_99323168_qa_2/environment/bootstrap.sh b/tasks/0099_323_99323168_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_323_99323168_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_323_99323168_qa_2/environment/pull_bucket.py b/tasks/0099_323_99323168_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_323_99323168_qa_2/environment/pull_bucket.py +++ b/tasks/0099_323_99323168_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_323_99323168_qa_2/task.toml b/tasks/0099_323_99323168_qa_2/task.toml index c023e121c44814ce5c2faf89344c2207b217fe90..da39002c77bfd7642f86e103496d653efd6a9e10 100644 --- a/tasks/0099_323_99323168_qa_2/task.toml +++ b/tasks/0099_323_99323168_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_323_99323168_qa_5/environment/bootstrap.sh b/tasks/0099_323_99323168_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_323_99323168_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_323_99323168_qa_5/environment/pull_bucket.py b/tasks/0099_323_99323168_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_323_99323168_qa_5/environment/pull_bucket.py +++ b/tasks/0099_323_99323168_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_323_99323168_qa_5/task.toml b/tasks/0099_323_99323168_qa_5/task.toml index e76c1f40f15fc9887146210b775cdf9df92b29aa..1be4fb58e5f55b0eb5c45a9e1b32fa2fa53ffadc 100644 --- a/tasks/0099_323_99323168_qa_5/task.toml +++ b/tasks/0099_323_99323168_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_334_99334311_qa_4/environment/bootstrap.sh b/tasks/0099_334_99334311_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_334_99334311_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_334_99334311_qa_4/environment/pull_bucket.py b/tasks/0099_334_99334311_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_334_99334311_qa_4/environment/pull_bucket.py +++ b/tasks/0099_334_99334311_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_334_99334311_qa_4/task.toml b/tasks/0099_334_99334311_qa_4/task.toml index a31abd6466dae1c09b46b5da710109441993f360..630c0570fd2a2b1dad121d5ab95fbf154e8c25d3 100644 --- a/tasks/0099_334_99334311_qa_4/task.toml +++ b/tasks/0099_334_99334311_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_456_99456570_qa_1/environment/bootstrap.sh b/tasks/0099_456_99456570_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_456_99456570_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_456_99456570_qa_1/environment/pull_bucket.py b/tasks/0099_456_99456570_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_456_99456570_qa_1/environment/pull_bucket.py +++ b/tasks/0099_456_99456570_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_456_99456570_qa_1/task.toml b/tasks/0099_456_99456570_qa_1/task.toml index 2bdc8e5dedf47d2507f48cb6ea66daee0ad8d2a9..a814eb390518bc5ad2525167ebf5775de23d5fb5 100644 --- a/tasks/0099_456_99456570_qa_1/task.toml +++ b/tasks/0099_456_99456570_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_456_99456570_qa_4/environment/bootstrap.sh b/tasks/0099_456_99456570_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_456_99456570_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_456_99456570_qa_4/environment/pull_bucket.py b/tasks/0099_456_99456570_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_456_99456570_qa_4/environment/pull_bucket.py +++ b/tasks/0099_456_99456570_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_456_99456570_qa_4/task.toml b/tasks/0099_456_99456570_qa_4/task.toml index 314f9e264ef78fb96bc3a74b6dd398f3469bcdab..bca2c6b196b30c4afbad2ee3c231a1c2d942c3df 100644 --- a/tasks/0099_456_99456570_qa_4/task.toml +++ b/tasks/0099_456_99456570_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_456_99456570_qa_5/environment/bootstrap.sh b/tasks/0099_456_99456570_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_456_99456570_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_456_99456570_qa_5/environment/pull_bucket.py b/tasks/0099_456_99456570_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_456_99456570_qa_5/environment/pull_bucket.py +++ b/tasks/0099_456_99456570_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_456_99456570_qa_5/task.toml b/tasks/0099_456_99456570_qa_5/task.toml index bf0042a2327fdfbfaf3a60c7aa3e4fe3f68d8f74..f47d0a54b03a90a68d09765f9de2c207df6d9d70 100644 --- a/tasks/0099_456_99456570_qa_5/task.toml +++ b/tasks/0099_456_99456570_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_460_99460028_qa_2/environment/bootstrap.sh b/tasks/0099_460_99460028_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_460_99460028_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_460_99460028_qa_2/environment/pull_bucket.py b/tasks/0099_460_99460028_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_460_99460028_qa_2/environment/pull_bucket.py +++ b/tasks/0099_460_99460028_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_460_99460028_qa_2/task.toml b/tasks/0099_460_99460028_qa_2/task.toml index 3d15e6cff9f5b9b26c4c89e12eaa01cb69f562ef..b5e4d96eb585f5bee3a3d20a62e8c55d62456142 100644 --- a/tasks/0099_460_99460028_qa_2/task.toml +++ b/tasks/0099_460_99460028_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_464_99464621_qa_1/environment/bootstrap.sh b/tasks/0099_464_99464621_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_464_99464621_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_464_99464621_qa_1/environment/pull_bucket.py b/tasks/0099_464_99464621_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_464_99464621_qa_1/environment/pull_bucket.py +++ b/tasks/0099_464_99464621_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_464_99464621_qa_1/task.toml b/tasks/0099_464_99464621_qa_1/task.toml index 43792764a571f52ae39f0718fd41f0d204b50896..69f1d34c9aaae03f2db763b55ad607fcbe056d51 100644 --- a/tasks/0099_464_99464621_qa_1/task.toml +++ b/tasks/0099_464_99464621_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_538_99538829_qa_2/environment/bootstrap.sh b/tasks/0099_538_99538829_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_538_99538829_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_538_99538829_qa_2/environment/pull_bucket.py b/tasks/0099_538_99538829_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_538_99538829_qa_2/environment/pull_bucket.py +++ b/tasks/0099_538_99538829_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_538_99538829_qa_2/task.toml b/tasks/0099_538_99538829_qa_2/task.toml index 14589c821a8d9eacece7d617ba9cde681cb717fe..38eb9a0d385da59e9bf2039564f2de86da799ebf 100644 --- a/tasks/0099_538_99538829_qa_2/task.toml +++ b/tasks/0099_538_99538829_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_538_99538891_qa_2/environment/bootstrap.sh b/tasks/0099_538_99538891_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_538_99538891_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_538_99538891_qa_2/environment/pull_bucket.py b/tasks/0099_538_99538891_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_538_99538891_qa_2/environment/pull_bucket.py +++ b/tasks/0099_538_99538891_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_538_99538891_qa_2/task.toml b/tasks/0099_538_99538891_qa_2/task.toml index 6559821247735e4227ab519f3e0203033ca0b6c0..477a94447f8079b674055a30d368b912fdc7f310 100644 --- a/tasks/0099_538_99538891_qa_2/task.toml +++ b/tasks/0099_538_99538891_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_540_99540799_qa_1/environment/bootstrap.sh b/tasks/0099_540_99540799_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_540_99540799_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_540_99540799_qa_1/environment/pull_bucket.py b/tasks/0099_540_99540799_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_540_99540799_qa_1/environment/pull_bucket.py +++ b/tasks/0099_540_99540799_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_540_99540799_qa_1/task.toml b/tasks/0099_540_99540799_qa_1/task.toml index d4587517f9128d0afe70b2a673ce94cef2043817..15f79e3f28b1be2e20c1c2f55ccfc038f44ea68c 100644 --- a/tasks/0099_540_99540799_qa_1/task.toml +++ b/tasks/0099_540_99540799_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_540_99540799_qa_4/environment/bootstrap.sh b/tasks/0099_540_99540799_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_540_99540799_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_540_99540799_qa_4/environment/pull_bucket.py b/tasks/0099_540_99540799_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_540_99540799_qa_4/environment/pull_bucket.py +++ b/tasks/0099_540_99540799_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_540_99540799_qa_4/task.toml b/tasks/0099_540_99540799_qa_4/task.toml index ffb4a4f1eab9d83c12cbbd3608ffdc6d4cfaac79..ffdb2a54711d3ff424c3b68a89e85e88d2822f2c 100644 --- a/tasks/0099_540_99540799_qa_4/task.toml +++ b/tasks/0099_540_99540799_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_541_99541129_qa_1/environment/bootstrap.sh b/tasks/0099_541_99541129_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_541_99541129_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_541_99541129_qa_1/environment/pull_bucket.py b/tasks/0099_541_99541129_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_541_99541129_qa_1/environment/pull_bucket.py +++ b/tasks/0099_541_99541129_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_541_99541129_qa_1/task.toml b/tasks/0099_541_99541129_qa_1/task.toml index fc9a07522ab4928032ea031666567f08d04b43e9..d2497a1b7336a79fa96b93fcc71d398249683bc0 100644 --- a/tasks/0099_541_99541129_qa_1/task.toml +++ b/tasks/0099_541_99541129_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_574_99574169_qa_2/environment/bootstrap.sh b/tasks/0099_574_99574169_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_574_99574169_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_574_99574169_qa_2/environment/pull_bucket.py b/tasks/0099_574_99574169_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_574_99574169_qa_2/environment/pull_bucket.py +++ b/tasks/0099_574_99574169_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_574_99574169_qa_2/task.toml b/tasks/0099_574_99574169_qa_2/task.toml index 3926fb1091ba743c26de902bda5f376911b48822..21aab04077e6be3ca02ec92f14680f88a8cf5b17 100644 --- a/tasks/0099_574_99574169_qa_2/task.toml +++ b/tasks/0099_574_99574169_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_587_99587330_qa_5/environment/bootstrap.sh b/tasks/0099_587_99587330_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_587_99587330_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_587_99587330_qa_5/environment/pull_bucket.py b/tasks/0099_587_99587330_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_587_99587330_qa_5/environment/pull_bucket.py +++ b/tasks/0099_587_99587330_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_587_99587330_qa_5/task.toml b/tasks/0099_587_99587330_qa_5/task.toml index a9b9b99ab62eb87a9443aa8e5067e0f7b492344b..1d78dd2116574da97d68ace39ceb993ee16fda69 100644 --- a/tasks/0099_587_99587330_qa_5/task.toml +++ b/tasks/0099_587_99587330_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_589_99589463_qa_1/environment/bootstrap.sh b/tasks/0099_589_99589463_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_589_99589463_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_589_99589463_qa_1/environment/pull_bucket.py b/tasks/0099_589_99589463_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_589_99589463_qa_1/environment/pull_bucket.py +++ b/tasks/0099_589_99589463_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_589_99589463_qa_1/task.toml b/tasks/0099_589_99589463_qa_1/task.toml index 9b55065f5cfbcc4e97b578e0bda0e55d5c30db4e..451b42f18e88afdc9c5bfe6df36856b197a26709 100644 --- a/tasks/0099_589_99589463_qa_1/task.toml +++ b/tasks/0099_589_99589463_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_589_99589463_qa_4/environment/bootstrap.sh b/tasks/0099_589_99589463_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_589_99589463_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_589_99589463_qa_4/environment/pull_bucket.py b/tasks/0099_589_99589463_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_589_99589463_qa_4/environment/pull_bucket.py +++ b/tasks/0099_589_99589463_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_589_99589463_qa_4/task.toml b/tasks/0099_589_99589463_qa_4/task.toml index 4c9178c160013b29d34d438dcb0b243d9cd2e687..6c0894268e223407c50781d61be180a9b5b86f59 100644 --- a/tasks/0099_589_99589463_qa_4/task.toml +++ b/tasks/0099_589_99589463_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_607_99607727_qa_4/environment/bootstrap.sh b/tasks/0099_607_99607727_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_607_99607727_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_607_99607727_qa_4/environment/pull_bucket.py b/tasks/0099_607_99607727_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_607_99607727_qa_4/environment/pull_bucket.py +++ b/tasks/0099_607_99607727_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_607_99607727_qa_4/task.toml b/tasks/0099_607_99607727_qa_4/task.toml index 1afb65703ac3f7d75a1ccc74dbd07bfbf54a2885..2ceb537a1a20ba81e56eca087ec0e36064439165 100644 --- a/tasks/0099_607_99607727_qa_4/task.toml +++ b/tasks/0099_607_99607727_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_607_99607727_qa_5/environment/bootstrap.sh b/tasks/0099_607_99607727_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_607_99607727_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_607_99607727_qa_5/environment/pull_bucket.py b/tasks/0099_607_99607727_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_607_99607727_qa_5/environment/pull_bucket.py +++ b/tasks/0099_607_99607727_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_607_99607727_qa_5/task.toml b/tasks/0099_607_99607727_qa_5/task.toml index 9f25ab58cd38cc420f0eb73ef77f2b6a9923d16d..53d849f1d268bea420ab69c0b8249c505eb8f153 100644 --- a/tasks/0099_607_99607727_qa_5/task.toml +++ b/tasks/0099_607_99607727_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_630_99630146_qa_5/environment/bootstrap.sh b/tasks/0099_630_99630146_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_630_99630146_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_630_99630146_qa_5/environment/pull_bucket.py b/tasks/0099_630_99630146_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_630_99630146_qa_5/environment/pull_bucket.py +++ b/tasks/0099_630_99630146_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_630_99630146_qa_5/task.toml b/tasks/0099_630_99630146_qa_5/task.toml index ba041c3e734388768e3b171cc0b425e0f7b805ee..5221072d4da034d4a94af667e1de8861fc15b632 100644 --- a/tasks/0099_630_99630146_qa_5/task.toml +++ b/tasks/0099_630_99630146_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_650_99650009_qa_4/environment/bootstrap.sh b/tasks/0099_650_99650009_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_650_99650009_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_650_99650009_qa_4/environment/pull_bucket.py b/tasks/0099_650_99650009_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_650_99650009_qa_4/environment/pull_bucket.py +++ b/tasks/0099_650_99650009_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_650_99650009_qa_4/task.toml b/tasks/0099_650_99650009_qa_4/task.toml index 25a1afb9f72c78bebdfd9c4aec7f473e54da4e2a..5e490eb18e0c958561c727c0adbb100d76925bc6 100644 --- a/tasks/0099_650_99650009_qa_4/task.toml +++ b/tasks/0099_650_99650009_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_701_99701449_qa_1/environment/bootstrap.sh b/tasks/0099_701_99701449_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_701_99701449_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_701_99701449_qa_1/environment/pull_bucket.py b/tasks/0099_701_99701449_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_701_99701449_qa_1/environment/pull_bucket.py +++ b/tasks/0099_701_99701449_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_701_99701449_qa_1/task.toml b/tasks/0099_701_99701449_qa_1/task.toml index 4652c535d1012820b1409a1a3381cd7c38ab7f61..5229b0b279614b82cb211723187c50e73a6a423e 100644 --- a/tasks/0099_701_99701449_qa_1/task.toml +++ b/tasks/0099_701_99701449_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_701_99701449_qa_2/environment/bootstrap.sh b/tasks/0099_701_99701449_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_701_99701449_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_701_99701449_qa_2/environment/pull_bucket.py b/tasks/0099_701_99701449_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_701_99701449_qa_2/environment/pull_bucket.py +++ b/tasks/0099_701_99701449_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_701_99701449_qa_2/task.toml b/tasks/0099_701_99701449_qa_2/task.toml index a7ca6593486474f36405c93eb7ab71e8b120bc93..3523aca975925efc5cf9e70590e20f98db718b24 100644 --- a/tasks/0099_701_99701449_qa_2/task.toml +++ b/tasks/0099_701_99701449_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_701_99701449_qa_3/environment/bootstrap.sh b/tasks/0099_701_99701449_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_701_99701449_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_701_99701449_qa_3/environment/pull_bucket.py b/tasks/0099_701_99701449_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_701_99701449_qa_3/environment/pull_bucket.py +++ b/tasks/0099_701_99701449_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_701_99701449_qa_3/task.toml b/tasks/0099_701_99701449_qa_3/task.toml index 5fc7651a6efd96d422692caf220a2b940ac8b5ab..e26b657aa58c123c60598aec1f25a1f22b64e1e4 100644 --- a/tasks/0099_701_99701449_qa_3/task.toml +++ b/tasks/0099_701_99701449_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_701_99701449_qa_5/environment/bootstrap.sh b/tasks/0099_701_99701449_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_701_99701449_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_701_99701449_qa_5/environment/pull_bucket.py b/tasks/0099_701_99701449_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_701_99701449_qa_5/environment/pull_bucket.py +++ b/tasks/0099_701_99701449_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_701_99701449_qa_5/task.toml b/tasks/0099_701_99701449_qa_5/task.toml index 885e03d419c137bc249b011aafe76aa2466e1795..fbe046a572685b86dd958d016d59ebc45dde65bb 100644 --- a/tasks/0099_701_99701449_qa_5/task.toml +++ b/tasks/0099_701_99701449_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_701_99701519_qa_2/environment/bootstrap.sh b/tasks/0099_701_99701519_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_701_99701519_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_701_99701519_qa_2/environment/pull_bucket.py b/tasks/0099_701_99701519_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_701_99701519_qa_2/environment/pull_bucket.py +++ b/tasks/0099_701_99701519_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_701_99701519_qa_2/task.toml b/tasks/0099_701_99701519_qa_2/task.toml index 3a28b19e4bfbed7328adf4a01fa466b47a4468cc..83c9a8b8ecb28b2e54098f45ac0ef238d16d3eb7 100644 --- a/tasks/0099_701_99701519_qa_2/task.toml +++ b/tasks/0099_701_99701519_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_705_99705765_qa_5/environment/bootstrap.sh b/tasks/0099_705_99705765_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_705_99705765_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_705_99705765_qa_5/environment/pull_bucket.py b/tasks/0099_705_99705765_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_705_99705765_qa_5/environment/pull_bucket.py +++ b/tasks/0099_705_99705765_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_705_99705765_qa_5/task.toml b/tasks/0099_705_99705765_qa_5/task.toml index a569b7f6701b347f63ee094071465e34fb7c6031..613115deb6b3a5e7501caf40678d31b30357f765 100644 --- a/tasks/0099_705_99705765_qa_5/task.toml +++ b/tasks/0099_705_99705765_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_730_99730639_qa_2/environment/bootstrap.sh b/tasks/0099_730_99730639_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_730_99730639_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_730_99730639_qa_2/environment/pull_bucket.py b/tasks/0099_730_99730639_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_730_99730639_qa_2/environment/pull_bucket.py +++ b/tasks/0099_730_99730639_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_730_99730639_qa_2/task.toml b/tasks/0099_730_99730639_qa_2/task.toml index a62c6ee6e8aa202ba4daf3e9a81c3f6606716650..227a7ce5c8b6c5890405f5681bde97c8993a3c09 100644 --- a/tasks/0099_730_99730639_qa_2/task.toml +++ b/tasks/0099_730_99730639_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0099_829_99829565_qa_3/environment/bootstrap.sh b/tasks/0099_829_99829565_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0099_829_99829565_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0099_829_99829565_qa_3/environment/pull_bucket.py b/tasks/0099_829_99829565_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0099_829_99829565_qa_3/environment/pull_bucket.py +++ b/tasks/0099_829_99829565_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0099_829_99829565_qa_3/task.toml b/tasks/0099_829_99829565_qa_3/task.toml index 7cbfec2ae6a4e7b203b0d0491a5b50a1b07fd255..f6491e2c8dc8c3a3111589af7a86e17312e04256 100644 --- a/tasks/0099_829_99829565_qa_3/task.toml +++ b/tasks/0099_829_99829565_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_006_100006799_qa_2/environment/bootstrap.sh b/tasks/0100_006_100006799_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_006_100006799_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_006_100006799_qa_2/environment/pull_bucket.py b/tasks/0100_006_100006799_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_006_100006799_qa_2/environment/pull_bucket.py +++ b/tasks/0100_006_100006799_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_006_100006799_qa_2/task.toml b/tasks/0100_006_100006799_qa_2/task.toml index 7d88749201c6337d3cb58f0ac50b49d659e46b1d..358a2b9cef54539eb9897581d83f49beceb6cc62 100644 --- a/tasks/0100_006_100006799_qa_2/task.toml +++ b/tasks/0100_006_100006799_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_006_100006799_qa_3/environment/bootstrap.sh b/tasks/0100_006_100006799_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_006_100006799_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_006_100006799_qa_3/environment/pull_bucket.py b/tasks/0100_006_100006799_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_006_100006799_qa_3/environment/pull_bucket.py +++ b/tasks/0100_006_100006799_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_006_100006799_qa_3/task.toml b/tasks/0100_006_100006799_qa_3/task.toml index ced57885971264d8e583ddec93ceea88a89dda8e..d0ab622af03ad3e067a3fc48f1c884da5168de08 100644 --- a/tasks/0100_006_100006799_qa_3/task.toml +++ b/tasks/0100_006_100006799_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_115_100115013_qa_3/environment/bootstrap.sh b/tasks/0100_115_100115013_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_115_100115013_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_115_100115013_qa_3/environment/pull_bucket.py b/tasks/0100_115_100115013_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_115_100115013_qa_3/environment/pull_bucket.py +++ b/tasks/0100_115_100115013_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_115_100115013_qa_3/task.toml b/tasks/0100_115_100115013_qa_3/task.toml index 6f1fc9239b5a42ac1a028bce9a964f28cc46dc02..f148543b04c5d3a03d79fcf74f354b800655ad6f 100644 --- a/tasks/0100_115_100115013_qa_3/task.toml +++ b/tasks/0100_115_100115013_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_171_100171054_qa_3/environment/bootstrap.sh b/tasks/0100_171_100171054_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_171_100171054_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_171_100171054_qa_3/environment/pull_bucket.py b/tasks/0100_171_100171054_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_171_100171054_qa_3/environment/pull_bucket.py +++ b/tasks/0100_171_100171054_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_171_100171054_qa_3/task.toml b/tasks/0100_171_100171054_qa_3/task.toml index 8f92fba78180b260ec667b3495e9ef4f76254e94..f79697799d66462e79567393a012c100040ba415 100644 --- a/tasks/0100_171_100171054_qa_3/task.toml +++ b/tasks/0100_171_100171054_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_171_100171054_qa_4/environment/bootstrap.sh b/tasks/0100_171_100171054_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_171_100171054_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_171_100171054_qa_4/environment/pull_bucket.py b/tasks/0100_171_100171054_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_171_100171054_qa_4/environment/pull_bucket.py +++ b/tasks/0100_171_100171054_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_171_100171054_qa_4/task.toml b/tasks/0100_171_100171054_qa_4/task.toml index 202845033a4fc13b4674563de9809de01f797a3d..3a4f5d1597f235734b1fefba6845034ec3e397f9 100644 --- a/tasks/0100_171_100171054_qa_4/task.toml +++ b/tasks/0100_171_100171054_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_203_100203819_qa_1/environment/bootstrap.sh b/tasks/0100_203_100203819_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_203_100203819_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_203_100203819_qa_1/environment/pull_bucket.py b/tasks/0100_203_100203819_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_203_100203819_qa_1/environment/pull_bucket.py +++ b/tasks/0100_203_100203819_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_203_100203819_qa_1/task.toml b/tasks/0100_203_100203819_qa_1/task.toml index 1f719a9994d510e818f1c41555d42a2aa0c5b2fa..f8a8db3451dffc6655ffe60b505eb319e51914be 100644 --- a/tasks/0100_203_100203819_qa_1/task.toml +++ b/tasks/0100_203_100203819_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_322_100322575_qa_1/environment/bootstrap.sh b/tasks/0100_322_100322575_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_322_100322575_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_322_100322575_qa_1/environment/pull_bucket.py b/tasks/0100_322_100322575_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_322_100322575_qa_1/environment/pull_bucket.py +++ b/tasks/0100_322_100322575_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_322_100322575_qa_1/task.toml b/tasks/0100_322_100322575_qa_1/task.toml index 5219a3a0567abc245b429e8e8947b45ea448fc83..ccf5373fec167ce720cf93cfeeed9cef4bc92b62 100644 --- a/tasks/0100_322_100322575_qa_1/task.toml +++ b/tasks/0100_322_100322575_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_352_100352234_qa_2/environment/bootstrap.sh b/tasks/0100_352_100352234_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_352_100352234_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_352_100352234_qa_2/environment/pull_bucket.py b/tasks/0100_352_100352234_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_352_100352234_qa_2/environment/pull_bucket.py +++ b/tasks/0100_352_100352234_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_352_100352234_qa_2/task.toml b/tasks/0100_352_100352234_qa_2/task.toml index 1ebd7552df5dd1fcf1438ec26d670f357a63ddf2..da3921fa039ada592393fff0fbf30cf8609184e7 100644 --- a/tasks/0100_352_100352234_qa_2/task.toml +++ b/tasks/0100_352_100352234_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_352_100352234_qa_4/environment/bootstrap.sh b/tasks/0100_352_100352234_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_352_100352234_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_352_100352234_qa_4/environment/pull_bucket.py b/tasks/0100_352_100352234_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_352_100352234_qa_4/environment/pull_bucket.py +++ b/tasks/0100_352_100352234_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_352_100352234_qa_4/task.toml b/tasks/0100_352_100352234_qa_4/task.toml index 39481c118be112cb4d83bfb6f6ec16f65109e84d..cf0eb9d36ab9a46a3cefe65fd15489f66423b93b 100644 --- a/tasks/0100_352_100352234_qa_4/task.toml +++ b/tasks/0100_352_100352234_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_352_100352234_qa_5/environment/bootstrap.sh b/tasks/0100_352_100352234_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_352_100352234_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_352_100352234_qa_5/environment/pull_bucket.py b/tasks/0100_352_100352234_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_352_100352234_qa_5/environment/pull_bucket.py +++ b/tasks/0100_352_100352234_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_352_100352234_qa_5/task.toml b/tasks/0100_352_100352234_qa_5/task.toml index 58c48d909ca5e4a9716cf6970618fd1560cad374..3f548a7163e7838f4c22a9e8bf0fb7bb0fcb41f8 100644 --- a/tasks/0100_352_100352234_qa_5/task.toml +++ b/tasks/0100_352_100352234_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_390_100390572_qa_1/environment/bootstrap.sh b/tasks/0100_390_100390572_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_390_100390572_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_390_100390572_qa_1/environment/pull_bucket.py b/tasks/0100_390_100390572_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_390_100390572_qa_1/environment/pull_bucket.py +++ b/tasks/0100_390_100390572_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_390_100390572_qa_1/task.toml b/tasks/0100_390_100390572_qa_1/task.toml index 6266323a9b60b9b0aff380ffb0d7dc97d812c872..f7781b938a854556a14dd57e6a3ed5d2ab2b1368 100644 --- a/tasks/0100_390_100390572_qa_1/task.toml +++ b/tasks/0100_390_100390572_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_390_100390572_qa_2/environment/bootstrap.sh b/tasks/0100_390_100390572_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_390_100390572_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_390_100390572_qa_2/environment/pull_bucket.py b/tasks/0100_390_100390572_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_390_100390572_qa_2/environment/pull_bucket.py +++ b/tasks/0100_390_100390572_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_390_100390572_qa_2/task.toml b/tasks/0100_390_100390572_qa_2/task.toml index d63dd4fd73cdf227a9b8a71f8b4c17a1c42dce8f..3c2ea0a67643ded982d9ba5b0d6c94aa1b492fd9 100644 --- a/tasks/0100_390_100390572_qa_2/task.toml +++ b/tasks/0100_390_100390572_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_415_100415914_qa_5/environment/bootstrap.sh b/tasks/0100_415_100415914_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_415_100415914_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_415_100415914_qa_5/environment/pull_bucket.py b/tasks/0100_415_100415914_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_415_100415914_qa_5/environment/pull_bucket.py +++ b/tasks/0100_415_100415914_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_415_100415914_qa_5/task.toml b/tasks/0100_415_100415914_qa_5/task.toml index ac1c4ab85ee875ea27db2262f5816507285504ff..efc17cfd857f734d927954593937db8b048a0734 100644 --- a/tasks/0100_415_100415914_qa_5/task.toml +++ b/tasks/0100_415_100415914_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_534_100534890_qa_1/environment/bootstrap.sh b/tasks/0100_534_100534890_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_534_100534890_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_534_100534890_qa_1/environment/pull_bucket.py b/tasks/0100_534_100534890_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_534_100534890_qa_1/environment/pull_bucket.py +++ b/tasks/0100_534_100534890_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_534_100534890_qa_1/task.toml b/tasks/0100_534_100534890_qa_1/task.toml index f4afa7e40ef9f041efa010755a7cd870d06770c6..e04cb7c169f1331bf46944c0341996db57250a94 100644 --- a/tasks/0100_534_100534890_qa_1/task.toml +++ b/tasks/0100_534_100534890_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_534_100534890_qa_4/environment/bootstrap.sh b/tasks/0100_534_100534890_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_534_100534890_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_534_100534890_qa_4/environment/pull_bucket.py b/tasks/0100_534_100534890_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_534_100534890_qa_4/environment/pull_bucket.py +++ b/tasks/0100_534_100534890_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_534_100534890_qa_4/task.toml b/tasks/0100_534_100534890_qa_4/task.toml index 6ba8abab1b5b07ca62ac273c5233fdfe5f53429c..cef2e9521243495296f495f6f2c191d5fe521309 100644 --- a/tasks/0100_534_100534890_qa_4/task.toml +++ b/tasks/0100_534_100534890_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_631_100631764_qa_3/environment/bootstrap.sh b/tasks/0100_631_100631764_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_631_100631764_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_631_100631764_qa_3/environment/pull_bucket.py b/tasks/0100_631_100631764_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_631_100631764_qa_3/environment/pull_bucket.py +++ b/tasks/0100_631_100631764_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_631_100631764_qa_3/task.toml b/tasks/0100_631_100631764_qa_3/task.toml index f908a959b60d087479ef411ff8126624d25e4787..d9a3d6dda14927178e0c701d21e333e2b4861506 100644 --- a/tasks/0100_631_100631764_qa_3/task.toml +++ b/tasks/0100_631_100631764_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_636_100636293_qa_1/environment/bootstrap.sh b/tasks/0100_636_100636293_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_636_100636293_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_636_100636293_qa_1/environment/pull_bucket.py b/tasks/0100_636_100636293_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_636_100636293_qa_1/environment/pull_bucket.py +++ b/tasks/0100_636_100636293_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_636_100636293_qa_1/task.toml b/tasks/0100_636_100636293_qa_1/task.toml index 8d9c1da7cbd664fb2a55a53aef6d51c9612b105b..1a76a93bedc6f4d14907900f45be06f4d5b0adf3 100644 --- a/tasks/0100_636_100636293_qa_1/task.toml +++ b/tasks/0100_636_100636293_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_636_100636293_qa_5/environment/bootstrap.sh b/tasks/0100_636_100636293_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_636_100636293_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_636_100636293_qa_5/environment/pull_bucket.py b/tasks/0100_636_100636293_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_636_100636293_qa_5/environment/pull_bucket.py +++ b/tasks/0100_636_100636293_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_636_100636293_qa_5/task.toml b/tasks/0100_636_100636293_qa_5/task.toml index d57291f65ef9589e09c8d6e55e52638df70fc9e0..3ad005f2b19131492829bee7892c673fe2328c86 100644 --- a/tasks/0100_636_100636293_qa_5/task.toml +++ b/tasks/0100_636_100636293_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_668_100668614_qa_1/environment/bootstrap.sh b/tasks/0100_668_100668614_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_668_100668614_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_668_100668614_qa_1/environment/pull_bucket.py b/tasks/0100_668_100668614_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_668_100668614_qa_1/environment/pull_bucket.py +++ b/tasks/0100_668_100668614_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_668_100668614_qa_1/task.toml b/tasks/0100_668_100668614_qa_1/task.toml index fa38634cea394cc37832dddf47355109e03a6e72..e5da0d29e53de14b298892c3c0d8def9e0f393e3 100644 --- a/tasks/0100_668_100668614_qa_1/task.toml +++ b/tasks/0100_668_100668614_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_711_100711073_qa_2/environment/bootstrap.sh b/tasks/0100_711_100711073_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_711_100711073_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_711_100711073_qa_2/environment/pull_bucket.py b/tasks/0100_711_100711073_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_711_100711073_qa_2/environment/pull_bucket.py +++ b/tasks/0100_711_100711073_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_711_100711073_qa_2/task.toml b/tasks/0100_711_100711073_qa_2/task.toml index 1a8237f8a1f930eaaead844f8d480a908ec3fee8..7239bd96f438096b5879a61de2168e18356f7a67 100644 --- a/tasks/0100_711_100711073_qa_2/task.toml +++ b/tasks/0100_711_100711073_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_715_100715048_qa_2/environment/bootstrap.sh b/tasks/0100_715_100715048_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_715_100715048_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_715_100715048_qa_2/environment/pull_bucket.py b/tasks/0100_715_100715048_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_715_100715048_qa_2/environment/pull_bucket.py +++ b/tasks/0100_715_100715048_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_715_100715048_qa_2/task.toml b/tasks/0100_715_100715048_qa_2/task.toml index 7373eb8e34afc6f0d45c94b325d05e3b01b94cb0..7991c493be8fa0a5b5b0e23cb6667f4bb3017c60 100644 --- a/tasks/0100_715_100715048_qa_2/task.toml +++ b/tasks/0100_715_100715048_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_729_100729925_qa_4/environment/bootstrap.sh b/tasks/0100_729_100729925_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_729_100729925_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_729_100729925_qa_4/environment/pull_bucket.py b/tasks/0100_729_100729925_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_729_100729925_qa_4/environment/pull_bucket.py +++ b/tasks/0100_729_100729925_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_729_100729925_qa_4/task.toml b/tasks/0100_729_100729925_qa_4/task.toml index 96914f910b45f6ce18e1100c3b9478031a66fd46..53c3c4270412a3f5102aee813e7df90d90a7d519 100644 --- a/tasks/0100_729_100729925_qa_4/task.toml +++ b/tasks/0100_729_100729925_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_732_100732711_qa_1/environment/bootstrap.sh b/tasks/0100_732_100732711_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_732_100732711_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_732_100732711_qa_1/environment/pull_bucket.py b/tasks/0100_732_100732711_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_732_100732711_qa_1/environment/pull_bucket.py +++ b/tasks/0100_732_100732711_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_732_100732711_qa_1/task.toml b/tasks/0100_732_100732711_qa_1/task.toml index 88a430575a34ff999fc2be9031e341b092508970..c6248cbbb9860e928520c51099b564f5454f5355 100644 --- a/tasks/0100_732_100732711_qa_1/task.toml +++ b/tasks/0100_732_100732711_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_734_100734661_qa_1/environment/bootstrap.sh b/tasks/0100_734_100734661_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_734_100734661_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_734_100734661_qa_1/environment/pull_bucket.py b/tasks/0100_734_100734661_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_734_100734661_qa_1/environment/pull_bucket.py +++ b/tasks/0100_734_100734661_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_734_100734661_qa_1/task.toml b/tasks/0100_734_100734661_qa_1/task.toml index b593044273927a281383d93edce589721478f25e..037b2fbbcdecfe19eee95ad05fac758d47559ae7 100644 --- a/tasks/0100_734_100734661_qa_1/task.toml +++ b/tasks/0100_734_100734661_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_734_100734661_qa_5/environment/bootstrap.sh b/tasks/0100_734_100734661_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_734_100734661_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_734_100734661_qa_5/environment/pull_bucket.py b/tasks/0100_734_100734661_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_734_100734661_qa_5/environment/pull_bucket.py +++ b/tasks/0100_734_100734661_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_734_100734661_qa_5/task.toml b/tasks/0100_734_100734661_qa_5/task.toml index 7891204a2346798c97963bba9bb619f66f90d8a0..642dd10860c44a4a121972abee1b8322a381d18f 100644 --- a/tasks/0100_734_100734661_qa_5/task.toml +++ b/tasks/0100_734_100734661_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_900_100900717_qa_5/environment/bootstrap.sh b/tasks/0100_900_100900717_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_900_100900717_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_900_100900717_qa_5/environment/pull_bucket.py b/tasks/0100_900_100900717_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_900_100900717_qa_5/environment/pull_bucket.py +++ b/tasks/0100_900_100900717_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_900_100900717_qa_5/task.toml b/tasks/0100_900_100900717_qa_5/task.toml index 4f0bf0e11b758493577799695631d7f715bf1a53..0342aed7212d6453ed2d88d4f05f47dad8ce0d28 100644 --- a/tasks/0100_900_100900717_qa_5/task.toml +++ b/tasks/0100_900_100900717_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_969_100969953_qa_1/environment/bootstrap.sh b/tasks/0100_969_100969953_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_969_100969953_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_969_100969953_qa_1/environment/pull_bucket.py b/tasks/0100_969_100969953_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_969_100969953_qa_1/environment/pull_bucket.py +++ b/tasks/0100_969_100969953_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_969_100969953_qa_1/task.toml b/tasks/0100_969_100969953_qa_1/task.toml index 21e7ebeab9fc2a8ca34d880dea13c9dc84051588..c3dbdbebfdb7fa69bfd031f1d61546e9209a17bb 100644 --- a/tasks/0100_969_100969953_qa_1/task.toml +++ b/tasks/0100_969_100969953_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_969_100969953_qa_2/environment/bootstrap.sh b/tasks/0100_969_100969953_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_969_100969953_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_969_100969953_qa_2/environment/pull_bucket.py b/tasks/0100_969_100969953_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_969_100969953_qa_2/environment/pull_bucket.py +++ b/tasks/0100_969_100969953_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_969_100969953_qa_2/task.toml b/tasks/0100_969_100969953_qa_2/task.toml index 3e10ccd594eab796c10cd94b03a5440c3071afed..0a5917a1576a01ebc28687b7c5ad989c5b69e50c 100644 --- a/tasks/0100_969_100969953_qa_2/task.toml +++ b/tasks/0100_969_100969953_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_986_100986965_qa_1/environment/bootstrap.sh b/tasks/0100_986_100986965_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_986_100986965_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_986_100986965_qa_1/environment/pull_bucket.py b/tasks/0100_986_100986965_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_986_100986965_qa_1/environment/pull_bucket.py +++ b/tasks/0100_986_100986965_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_986_100986965_qa_1/task.toml b/tasks/0100_986_100986965_qa_1/task.toml index 31296db8d7651788d147547e8dfed39967592b3a..ea1d709b99b60560a81c89d9a2968db34a3bf91b 100644 --- a/tasks/0100_986_100986965_qa_1/task.toml +++ b/tasks/0100_986_100986965_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0100_986_100986965_qa_5/environment/bootstrap.sh b/tasks/0100_986_100986965_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0100_986_100986965_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0100_986_100986965_qa_5/environment/pull_bucket.py b/tasks/0100_986_100986965_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0100_986_100986965_qa_5/environment/pull_bucket.py +++ b/tasks/0100_986_100986965_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0100_986_100986965_qa_5/task.toml b/tasks/0100_986_100986965_qa_5/task.toml index c494bd980fdc412eb48ad3b3d2e2c9987b3831a1..cebba6b50c88d6da6db66ba6d890934c5ed3804d 100644 --- a/tasks/0100_986_100986965_qa_5/task.toml +++ b/tasks/0100_986_100986965_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_030_101030529_qa_3/environment/bootstrap.sh b/tasks/0101_030_101030529_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_030_101030529_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_030_101030529_qa_3/environment/pull_bucket.py b/tasks/0101_030_101030529_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_030_101030529_qa_3/environment/pull_bucket.py +++ b/tasks/0101_030_101030529_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_030_101030529_qa_3/task.toml b/tasks/0101_030_101030529_qa_3/task.toml index a619ee6600d60063df456e2bc5138fdbe3b26341..12a4463b6d358cac769fc73d4aeb69d78b2bc8ac 100644 --- a/tasks/0101_030_101030529_qa_3/task.toml +++ b/tasks/0101_030_101030529_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_030_101030529_qa_5/environment/bootstrap.sh b/tasks/0101_030_101030529_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_030_101030529_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_030_101030529_qa_5/environment/pull_bucket.py b/tasks/0101_030_101030529_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_030_101030529_qa_5/environment/pull_bucket.py +++ b/tasks/0101_030_101030529_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_030_101030529_qa_5/task.toml b/tasks/0101_030_101030529_qa_5/task.toml index c647714648a214fc6cc109700848726196fd43e3..145732326c2bcd2269bb949b2f4436adb5626814 100644 --- a/tasks/0101_030_101030529_qa_5/task.toml +++ b/tasks/0101_030_101030529_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_045_101045351_qa_4/environment/bootstrap.sh b/tasks/0101_045_101045351_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_045_101045351_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_045_101045351_qa_4/environment/pull_bucket.py b/tasks/0101_045_101045351_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_045_101045351_qa_4/environment/pull_bucket.py +++ b/tasks/0101_045_101045351_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_045_101045351_qa_4/task.toml b/tasks/0101_045_101045351_qa_4/task.toml index 840b12d2004c7e90a747044dad60baaede7eaa82..554f1b3aa1a3cb2e8d22057d5174bddc58031d56 100644 --- a/tasks/0101_045_101045351_qa_4/task.toml +++ b/tasks/0101_045_101045351_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_045_101045351_qa_5/environment/bootstrap.sh b/tasks/0101_045_101045351_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_045_101045351_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_045_101045351_qa_5/environment/pull_bucket.py b/tasks/0101_045_101045351_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_045_101045351_qa_5/environment/pull_bucket.py +++ b/tasks/0101_045_101045351_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_045_101045351_qa_5/task.toml b/tasks/0101_045_101045351_qa_5/task.toml index f23f405e91e24b96c0b7798fac4631208ea93978..e65377e17f89063d66e39ab7af2547767d0353d2 100644 --- a/tasks/0101_045_101045351_qa_5/task.toml +++ b/tasks/0101_045_101045351_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_142_101142803_qa_4/environment/bootstrap.sh b/tasks/0101_142_101142803_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_142_101142803_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_142_101142803_qa_4/environment/pull_bucket.py b/tasks/0101_142_101142803_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_142_101142803_qa_4/environment/pull_bucket.py +++ b/tasks/0101_142_101142803_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_142_101142803_qa_4/task.toml b/tasks/0101_142_101142803_qa_4/task.toml index 27fbc6dc8039c90fa04da23bd58cca8214e9b4e2..e81794864afe5bdfa2636a7fc594f3da71dd8da2 100644 --- a/tasks/0101_142_101142803_qa_4/task.toml +++ b/tasks/0101_142_101142803_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_159_101159435_qa_2/environment/bootstrap.sh b/tasks/0101_159_101159435_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_159_101159435_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_159_101159435_qa_2/environment/pull_bucket.py b/tasks/0101_159_101159435_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_159_101159435_qa_2/environment/pull_bucket.py +++ b/tasks/0101_159_101159435_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_159_101159435_qa_2/task.toml b/tasks/0101_159_101159435_qa_2/task.toml index 0805e5e3f874d28be86c73397552423635bf8ee8..b12d760c99f5e358f96b611dcc12d9e33fa0e8bd 100644 --- a/tasks/0101_159_101159435_qa_2/task.toml +++ b/tasks/0101_159_101159435_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_232_101232922_qa_1/environment/bootstrap.sh b/tasks/0101_232_101232922_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_232_101232922_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_232_101232922_qa_1/environment/pull_bucket.py b/tasks/0101_232_101232922_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_232_101232922_qa_1/environment/pull_bucket.py +++ b/tasks/0101_232_101232922_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_232_101232922_qa_1/task.toml b/tasks/0101_232_101232922_qa_1/task.toml index 38f41f606bc954e501dd1273de9186a7898f467d..59f1ca4aa133266f849810331c04dec3c0918263 100644 --- a/tasks/0101_232_101232922_qa_1/task.toml +++ b/tasks/0101_232_101232922_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_292_101292104_qa_1/environment/bootstrap.sh b/tasks/0101_292_101292104_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_292_101292104_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_292_101292104_qa_1/environment/pull_bucket.py b/tasks/0101_292_101292104_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_292_101292104_qa_1/environment/pull_bucket.py +++ b/tasks/0101_292_101292104_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_292_101292104_qa_1/task.toml b/tasks/0101_292_101292104_qa_1/task.toml index 067168731a0395ac38305c8afc9eabe7b3b6ad52..78204435ae950e2d9b70aa08485edc3ac7dafcc7 100644 --- a/tasks/0101_292_101292104_qa_1/task.toml +++ b/tasks/0101_292_101292104_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_296_101296258_qa_3/environment/bootstrap.sh b/tasks/0101_296_101296258_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_296_101296258_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_296_101296258_qa_3/environment/pull_bucket.py b/tasks/0101_296_101296258_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_296_101296258_qa_3/environment/pull_bucket.py +++ b/tasks/0101_296_101296258_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_296_101296258_qa_3/task.toml b/tasks/0101_296_101296258_qa_3/task.toml index cfe80c1c21ed2515cf626f641a6f98f589af00e7..5c8e5a1e3caad6314c1c654f46fe9892f1b6e57f 100644 --- a/tasks/0101_296_101296258_qa_3/task.toml +++ b/tasks/0101_296_101296258_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_390_101390239_qa_3/environment/bootstrap.sh b/tasks/0101_390_101390239_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_390_101390239_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_390_101390239_qa_3/environment/pull_bucket.py b/tasks/0101_390_101390239_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_390_101390239_qa_3/environment/pull_bucket.py +++ b/tasks/0101_390_101390239_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_390_101390239_qa_3/task.toml b/tasks/0101_390_101390239_qa_3/task.toml index 470bc32694e38ee07dc11dc2250691f337e21ae7..dbb04ec17db0c2258a8cc096d74746792278c475 100644 --- a/tasks/0101_390_101390239_qa_3/task.toml +++ b/tasks/0101_390_101390239_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_390_101390239_qa_4/environment/bootstrap.sh b/tasks/0101_390_101390239_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_390_101390239_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_390_101390239_qa_4/environment/pull_bucket.py b/tasks/0101_390_101390239_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_390_101390239_qa_4/environment/pull_bucket.py +++ b/tasks/0101_390_101390239_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_390_101390239_qa_4/task.toml b/tasks/0101_390_101390239_qa_4/task.toml index ad512ac8bb839978680512877337eead8378f448..d889a3d1470c3596d7a5aeaa829649efc49f4677 100644 --- a/tasks/0101_390_101390239_qa_4/task.toml +++ b/tasks/0101_390_101390239_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_507_101507409_qa_3/environment/bootstrap.sh b/tasks/0101_507_101507409_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_507_101507409_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_507_101507409_qa_3/environment/pull_bucket.py b/tasks/0101_507_101507409_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_507_101507409_qa_3/environment/pull_bucket.py +++ b/tasks/0101_507_101507409_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_507_101507409_qa_3/task.toml b/tasks/0101_507_101507409_qa_3/task.toml index 8199bacdea350fba2a5af28b09e4db397f4939f4..bcf9492025787cc4c4ed22e6d7a4e2443b7adc1a 100644 --- a/tasks/0101_507_101507409_qa_3/task.toml +++ b/tasks/0101_507_101507409_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_507_101507409_qa_4/environment/bootstrap.sh b/tasks/0101_507_101507409_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_507_101507409_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_507_101507409_qa_4/environment/pull_bucket.py b/tasks/0101_507_101507409_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_507_101507409_qa_4/environment/pull_bucket.py +++ b/tasks/0101_507_101507409_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_507_101507409_qa_4/task.toml b/tasks/0101_507_101507409_qa_4/task.toml index 774ea1da18aead7f478ac11786468debed0370f0..a7646cc035649ee10edd42d9ca7972787ab383c0 100644 --- a/tasks/0101_507_101507409_qa_4/task.toml +++ b/tasks/0101_507_101507409_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_507_101507712_qa_1/environment/bootstrap.sh b/tasks/0101_507_101507712_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_507_101507712_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_507_101507712_qa_1/environment/pull_bucket.py b/tasks/0101_507_101507712_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_507_101507712_qa_1/environment/pull_bucket.py +++ b/tasks/0101_507_101507712_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_507_101507712_qa_1/task.toml b/tasks/0101_507_101507712_qa_1/task.toml index 1b9e407c1d748c276f25df5e851d4b7021177fa0..d571f657fc7c8c24a0c05aa71a4d642bf1c70b8d 100644 --- a/tasks/0101_507_101507712_qa_1/task.toml +++ b/tasks/0101_507_101507712_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_509_101509299_qa_5/environment/bootstrap.sh b/tasks/0101_509_101509299_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_509_101509299_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_509_101509299_qa_5/environment/pull_bucket.py b/tasks/0101_509_101509299_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_509_101509299_qa_5/environment/pull_bucket.py +++ b/tasks/0101_509_101509299_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_509_101509299_qa_5/task.toml b/tasks/0101_509_101509299_qa_5/task.toml index 7d08c587989dc4e3012f66dddfdfa9095e5a72c7..34a19a826ec99b7ec7995d5c677660d1500f934b 100644 --- a/tasks/0101_509_101509299_qa_5/task.toml +++ b/tasks/0101_509_101509299_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_569_101569659_qa_2/environment/bootstrap.sh b/tasks/0101_569_101569659_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_569_101569659_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_569_101569659_qa_2/environment/pull_bucket.py b/tasks/0101_569_101569659_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_569_101569659_qa_2/environment/pull_bucket.py +++ b/tasks/0101_569_101569659_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_569_101569659_qa_2/task.toml b/tasks/0101_569_101569659_qa_2/task.toml index 3744bfc0e5e5762a3c71921a4d5197e149df68fd..cb68934d897982a45ce1f06448ed076e7f7beef8 100644 --- a/tasks/0101_569_101569659_qa_2/task.toml +++ b/tasks/0101_569_101569659_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_593_101593150_qa_3/environment/bootstrap.sh b/tasks/0101_593_101593150_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_593_101593150_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_593_101593150_qa_3/environment/pull_bucket.py b/tasks/0101_593_101593150_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_593_101593150_qa_3/environment/pull_bucket.py +++ b/tasks/0101_593_101593150_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_593_101593150_qa_3/task.toml b/tasks/0101_593_101593150_qa_3/task.toml index 592d503beb24ea76e079329e7e4f6c8b9bfa3f35..150d30d920b2be3e64ed87ac31410dd2c236febc 100644 --- a/tasks/0101_593_101593150_qa_3/task.toml +++ b/tasks/0101_593_101593150_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_773_101773827_qa_4/environment/bootstrap.sh b/tasks/0101_773_101773827_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_773_101773827_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_773_101773827_qa_4/environment/pull_bucket.py b/tasks/0101_773_101773827_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_773_101773827_qa_4/environment/pull_bucket.py +++ b/tasks/0101_773_101773827_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_773_101773827_qa_4/task.toml b/tasks/0101_773_101773827_qa_4/task.toml index 52f93fc8f3fafc84c5a6e3ceb8177b35be418d4b..4448012914fa751b2f291b84b878c0a2b4039f14 100644 --- a/tasks/0101_773_101773827_qa_4/task.toml +++ b/tasks/0101_773_101773827_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_787_101787137_qa_5/environment/bootstrap.sh b/tasks/0101_787_101787137_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_787_101787137_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_787_101787137_qa_5/environment/pull_bucket.py b/tasks/0101_787_101787137_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_787_101787137_qa_5/environment/pull_bucket.py +++ b/tasks/0101_787_101787137_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_787_101787137_qa_5/task.toml b/tasks/0101_787_101787137_qa_5/task.toml index da015d19647a16f950f9b9e86994077e4d054556..ef71977bc57fd0225fb646990e606f39f46bb1c9 100644 --- a/tasks/0101_787_101787137_qa_5/task.toml +++ b/tasks/0101_787_101787137_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_866_101866934_qa_4/environment/bootstrap.sh b/tasks/0101_866_101866934_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_866_101866934_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_866_101866934_qa_4/environment/pull_bucket.py b/tasks/0101_866_101866934_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_866_101866934_qa_4/environment/pull_bucket.py +++ b/tasks/0101_866_101866934_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_866_101866934_qa_4/task.toml b/tasks/0101_866_101866934_qa_4/task.toml index 8cfc305963f9f50e078c3ddcbcafb78821cf930b..d8faee993058205e5f64d7e063807e95a88b957a 100644 --- a/tasks/0101_866_101866934_qa_4/task.toml +++ b/tasks/0101_866_101866934_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_914_101914929_qa_1/environment/bootstrap.sh b/tasks/0101_914_101914929_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_914_101914929_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_914_101914929_qa_1/environment/pull_bucket.py b/tasks/0101_914_101914929_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_914_101914929_qa_1/environment/pull_bucket.py +++ b/tasks/0101_914_101914929_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_914_101914929_qa_1/task.toml b/tasks/0101_914_101914929_qa_1/task.toml index 1eafab07a9843c0b5f8de1180e641451612410b2..706d703b74221d52ec8f1a561747d2fe7fc765a9 100644 --- a/tasks/0101_914_101914929_qa_1/task.toml +++ b/tasks/0101_914_101914929_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_917_101917756_qa_3/environment/bootstrap.sh b/tasks/0101_917_101917756_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_917_101917756_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_917_101917756_qa_3/environment/pull_bucket.py b/tasks/0101_917_101917756_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_917_101917756_qa_3/environment/pull_bucket.py +++ b/tasks/0101_917_101917756_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_917_101917756_qa_3/task.toml b/tasks/0101_917_101917756_qa_3/task.toml index 2df328eeb931ba86d0b5c256e0370107fd2430d1..b9085a72e8c8a920142530df461ce6246a6e0b61 100644 --- a/tasks/0101_917_101917756_qa_3/task.toml +++ b/tasks/0101_917_101917756_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_994_101994234_qa_2/environment/bootstrap.sh b/tasks/0101_994_101994234_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_994_101994234_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_994_101994234_qa_2/environment/pull_bucket.py b/tasks/0101_994_101994234_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_994_101994234_qa_2/environment/pull_bucket.py +++ b/tasks/0101_994_101994234_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_994_101994234_qa_2/task.toml b/tasks/0101_994_101994234_qa_2/task.toml index 443da80e346323919c47bd652e1ffe966d779e4c..761f032c43b1c990fa44c50d0e877c5bb2478472 100644 --- a/tasks/0101_994_101994234_qa_2/task.toml +++ b/tasks/0101_994_101994234_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0101_994_101994234_qa_4/environment/bootstrap.sh b/tasks/0101_994_101994234_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0101_994_101994234_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0101_994_101994234_qa_4/environment/pull_bucket.py b/tasks/0101_994_101994234_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0101_994_101994234_qa_4/environment/pull_bucket.py +++ b/tasks/0101_994_101994234_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0101_994_101994234_qa_4/task.toml b/tasks/0101_994_101994234_qa_4/task.toml index f5946074bce1b369a667aec6dd2ca8d0585d32f3..2f061e85547aaba0b65b64af1f36ae5a5442ac9b 100644 --- a/tasks/0101_994_101994234_qa_4/task.toml +++ b/tasks/0101_994_101994234_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_128_102128950_qa_1/environment/bootstrap.sh b/tasks/0102_128_102128950_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_128_102128950_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_128_102128950_qa_1/environment/pull_bucket.py b/tasks/0102_128_102128950_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_128_102128950_qa_1/environment/pull_bucket.py +++ b/tasks/0102_128_102128950_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_128_102128950_qa_1/task.toml b/tasks/0102_128_102128950_qa_1/task.toml index 56104900dae0f1b253c8d6cdbd54f54fbf184fe8..5f66692c690b5858e5787e51039fcf69d49dd284 100644 --- a/tasks/0102_128_102128950_qa_1/task.toml +++ b/tasks/0102_128_102128950_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_128_102128950_qa_2/environment/bootstrap.sh b/tasks/0102_128_102128950_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_128_102128950_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_128_102128950_qa_2/environment/pull_bucket.py b/tasks/0102_128_102128950_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_128_102128950_qa_2/environment/pull_bucket.py +++ b/tasks/0102_128_102128950_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_128_102128950_qa_2/task.toml b/tasks/0102_128_102128950_qa_2/task.toml index 7f51e83c02bd6138532fc823a8038b60b8d08d10..163123591b62637466c75c358d215801e936f960 100644 --- a/tasks/0102_128_102128950_qa_2/task.toml +++ b/tasks/0102_128_102128950_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_158_102158700_qa_5/environment/bootstrap.sh b/tasks/0102_158_102158700_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_158_102158700_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_158_102158700_qa_5/environment/pull_bucket.py b/tasks/0102_158_102158700_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_158_102158700_qa_5/environment/pull_bucket.py +++ b/tasks/0102_158_102158700_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_158_102158700_qa_5/task.toml b/tasks/0102_158_102158700_qa_5/task.toml index 8a6ae344ef92b93aa1cfc2e3dd60667f1136155a..85b1f30c3764f439c93ca009c4c2312b3b766338 100644 --- a/tasks/0102_158_102158700_qa_5/task.toml +++ b/tasks/0102_158_102158700_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_190_102190555_qa_2/environment/bootstrap.sh b/tasks/0102_190_102190555_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_190_102190555_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_190_102190555_qa_2/environment/pull_bucket.py b/tasks/0102_190_102190555_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_190_102190555_qa_2/environment/pull_bucket.py +++ b/tasks/0102_190_102190555_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_190_102190555_qa_2/task.toml b/tasks/0102_190_102190555_qa_2/task.toml index 3070110c09355860de147575be4dcec5cb7b39ac..0e125053a17b021bacadf08de187cd2879238072 100644 --- a/tasks/0102_190_102190555_qa_2/task.toml +++ b/tasks/0102_190_102190555_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_190_102190555_qa_3/environment/bootstrap.sh b/tasks/0102_190_102190555_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_190_102190555_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_190_102190555_qa_3/environment/pull_bucket.py b/tasks/0102_190_102190555_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_190_102190555_qa_3/environment/pull_bucket.py +++ b/tasks/0102_190_102190555_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_190_102190555_qa_3/task.toml b/tasks/0102_190_102190555_qa_3/task.toml index 8491a25c38255ccc9df1911c72a00f59988a362f..fbe42ac803fb712cc2412e281af43ef071182c80 100644 --- a/tasks/0102_190_102190555_qa_3/task.toml +++ b/tasks/0102_190_102190555_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_198_102198537_qa_3/environment/bootstrap.sh b/tasks/0102_198_102198537_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_198_102198537_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_198_102198537_qa_3/environment/pull_bucket.py b/tasks/0102_198_102198537_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_198_102198537_qa_3/environment/pull_bucket.py +++ b/tasks/0102_198_102198537_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_198_102198537_qa_3/task.toml b/tasks/0102_198_102198537_qa_3/task.toml index 882d3b5a36d55ddabc64fae2e9bffc047beff91f..8ba906ee74216fae0d5c5e81d901c0d26ce7bc8f 100644 --- a/tasks/0102_198_102198537_qa_3/task.toml +++ b/tasks/0102_198_102198537_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_198_102198537_qa_5/environment/bootstrap.sh b/tasks/0102_198_102198537_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_198_102198537_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_198_102198537_qa_5/environment/pull_bucket.py b/tasks/0102_198_102198537_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_198_102198537_qa_5/environment/pull_bucket.py +++ b/tasks/0102_198_102198537_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_198_102198537_qa_5/task.toml b/tasks/0102_198_102198537_qa_5/task.toml index 257cd79fdfb83d0121131742d68d7eb4e596e5ae..4626e654b78475d90b427ad8dbfef096d06159e0 100644 --- a/tasks/0102_198_102198537_qa_5/task.toml +++ b/tasks/0102_198_102198537_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_213_102213799_qa_1/environment/bootstrap.sh b/tasks/0102_213_102213799_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_213_102213799_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_213_102213799_qa_1/environment/pull_bucket.py b/tasks/0102_213_102213799_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_213_102213799_qa_1/environment/pull_bucket.py +++ b/tasks/0102_213_102213799_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_213_102213799_qa_1/task.toml b/tasks/0102_213_102213799_qa_1/task.toml index 34ef85f39805b5203dd8b1b3233022b5147f4117..3ffd45d9af4be4dd440b28ca39e36e8387683e24 100644 --- a/tasks/0102_213_102213799_qa_1/task.toml +++ b/tasks/0102_213_102213799_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_253_102253165_qa_5/environment/bootstrap.sh b/tasks/0102_253_102253165_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_253_102253165_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_253_102253165_qa_5/environment/pull_bucket.py b/tasks/0102_253_102253165_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_253_102253165_qa_5/environment/pull_bucket.py +++ b/tasks/0102_253_102253165_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_253_102253165_qa_5/task.toml b/tasks/0102_253_102253165_qa_5/task.toml index 9ba3d5f1e42864809621ef4361191f8696a807a4..8b1b932db5c84388b970e6b9c4eaaae3090f865a 100644 --- a/tasks/0102_253_102253165_qa_5/task.toml +++ b/tasks/0102_253_102253165_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_350_102350231_qa_5/environment/bootstrap.sh b/tasks/0102_350_102350231_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_350_102350231_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_350_102350231_qa_5/environment/pull_bucket.py b/tasks/0102_350_102350231_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_350_102350231_qa_5/environment/pull_bucket.py +++ b/tasks/0102_350_102350231_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_350_102350231_qa_5/task.toml b/tasks/0102_350_102350231_qa_5/task.toml index 66dec7f85f13007e1839d8c9117673ccd12b6aa0..df0f7d45aa05dbc5a00596031986482032ed1f84 100644 --- a/tasks/0102_350_102350231_qa_5/task.toml +++ b/tasks/0102_350_102350231_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_368_102368775_qa_1/environment/bootstrap.sh b/tasks/0102_368_102368775_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_368_102368775_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_368_102368775_qa_1/environment/pull_bucket.py b/tasks/0102_368_102368775_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_368_102368775_qa_1/environment/pull_bucket.py +++ b/tasks/0102_368_102368775_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_368_102368775_qa_1/task.toml b/tasks/0102_368_102368775_qa_1/task.toml index b2b8625d992693603757a789428fa830ee818933..3fc8baf130bfc136f87362e4d2d1561670e00a17 100644 --- a/tasks/0102_368_102368775_qa_1/task.toml +++ b/tasks/0102_368_102368775_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_369_102369672_qa_1/environment/bootstrap.sh b/tasks/0102_369_102369672_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_369_102369672_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_369_102369672_qa_1/environment/pull_bucket.py b/tasks/0102_369_102369672_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_369_102369672_qa_1/environment/pull_bucket.py +++ b/tasks/0102_369_102369672_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_369_102369672_qa_1/task.toml b/tasks/0102_369_102369672_qa_1/task.toml index 6065b8c49bd44a9251ec9cda31054a6911e20794..7c4432b844c698c600c35697664018cf86865a6f 100644 --- a/tasks/0102_369_102369672_qa_1/task.toml +++ b/tasks/0102_369_102369672_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_369_102369672_qa_3/environment/bootstrap.sh b/tasks/0102_369_102369672_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_369_102369672_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_369_102369672_qa_3/environment/pull_bucket.py b/tasks/0102_369_102369672_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_369_102369672_qa_3/environment/pull_bucket.py +++ b/tasks/0102_369_102369672_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_369_102369672_qa_3/task.toml b/tasks/0102_369_102369672_qa_3/task.toml index ef8199b75b61d5331829c43aec92ac507f1edf26..6d04c03b44bf9f9c8f623172b308b1a32173c094 100644 --- a/tasks/0102_369_102369672_qa_3/task.toml +++ b/tasks/0102_369_102369672_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_369_102369672_qa_4/environment/bootstrap.sh b/tasks/0102_369_102369672_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_369_102369672_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_369_102369672_qa_4/environment/pull_bucket.py b/tasks/0102_369_102369672_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_369_102369672_qa_4/environment/pull_bucket.py +++ b/tasks/0102_369_102369672_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_369_102369672_qa_4/task.toml b/tasks/0102_369_102369672_qa_4/task.toml index a5cae875a919779d2ea94b9504d1accaa703c0b8..5575c7d239379a8cf755bffed5d4328d58728a1f 100644 --- a/tasks/0102_369_102369672_qa_4/task.toml +++ b/tasks/0102_369_102369672_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_377_102377716_qa_2/environment/bootstrap.sh b/tasks/0102_377_102377716_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_377_102377716_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_377_102377716_qa_2/environment/pull_bucket.py b/tasks/0102_377_102377716_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_377_102377716_qa_2/environment/pull_bucket.py +++ b/tasks/0102_377_102377716_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_377_102377716_qa_2/task.toml b/tasks/0102_377_102377716_qa_2/task.toml index 4de064b0f5808a1d8303904c78c27058a66cb790..88175f5649d73586395e5e610c3b31e3d3935e0c 100644 --- a/tasks/0102_377_102377716_qa_2/task.toml +++ b/tasks/0102_377_102377716_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_377_102377716_qa_4/environment/bootstrap.sh b/tasks/0102_377_102377716_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_377_102377716_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_377_102377716_qa_4/environment/pull_bucket.py b/tasks/0102_377_102377716_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_377_102377716_qa_4/environment/pull_bucket.py +++ b/tasks/0102_377_102377716_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_377_102377716_qa_4/task.toml b/tasks/0102_377_102377716_qa_4/task.toml index 829692075fadbfc8f1a0078aa2446c4d37d2244b..e174c4520ef1f6969b91ea9ce48f2b552acfe3df 100644 --- a/tasks/0102_377_102377716_qa_4/task.toml +++ b/tasks/0102_377_102377716_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_377_102377716_qa_5/environment/bootstrap.sh b/tasks/0102_377_102377716_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_377_102377716_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_377_102377716_qa_5/environment/pull_bucket.py b/tasks/0102_377_102377716_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_377_102377716_qa_5/environment/pull_bucket.py +++ b/tasks/0102_377_102377716_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_377_102377716_qa_5/task.toml b/tasks/0102_377_102377716_qa_5/task.toml index 47f9745516d2833635a3804db36d2cbe36d755a8..284947ee38168473bf35cc3779bd1f9e4220f202 100644 --- a/tasks/0102_377_102377716_qa_5/task.toml +++ b/tasks/0102_377_102377716_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_378_102378485_qa_2/environment/bootstrap.sh b/tasks/0102_378_102378485_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_378_102378485_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_378_102378485_qa_2/environment/pull_bucket.py b/tasks/0102_378_102378485_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_378_102378485_qa_2/environment/pull_bucket.py +++ b/tasks/0102_378_102378485_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_378_102378485_qa_2/task.toml b/tasks/0102_378_102378485_qa_2/task.toml index 86dfe5a259d1685c903a7b4ace997ff2a9579bfe..885255b5113314ea084629316259616acb56270c 100644 --- a/tasks/0102_378_102378485_qa_2/task.toml +++ b/tasks/0102_378_102378485_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_378_102378485_qa_3/environment/bootstrap.sh b/tasks/0102_378_102378485_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_378_102378485_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_378_102378485_qa_3/environment/pull_bucket.py b/tasks/0102_378_102378485_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_378_102378485_qa_3/environment/pull_bucket.py +++ b/tasks/0102_378_102378485_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_378_102378485_qa_3/task.toml b/tasks/0102_378_102378485_qa_3/task.toml index 369ea652823a7acc8a36d5a41391c7771643477c..940a79280f9bba9ce405ce4b9ce70785e9f1fc54 100644 --- a/tasks/0102_378_102378485_qa_3/task.toml +++ b/tasks/0102_378_102378485_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_401_102401343_qa_1/environment/bootstrap.sh b/tasks/0102_401_102401343_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_401_102401343_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_401_102401343_qa_1/environment/pull_bucket.py b/tasks/0102_401_102401343_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_401_102401343_qa_1/environment/pull_bucket.py +++ b/tasks/0102_401_102401343_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_401_102401343_qa_1/task.toml b/tasks/0102_401_102401343_qa_1/task.toml index 1c2c46e2645e1c194b999856e6511d95d5932bf9..378fe7647b9dbeed8097ef44dfd2c6017877a2b7 100644 --- a/tasks/0102_401_102401343_qa_1/task.toml +++ b/tasks/0102_401_102401343_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_436_102436012_qa_1/environment/bootstrap.sh b/tasks/0102_436_102436012_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_436_102436012_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_436_102436012_qa_1/environment/pull_bucket.py b/tasks/0102_436_102436012_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_436_102436012_qa_1/environment/pull_bucket.py +++ b/tasks/0102_436_102436012_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_436_102436012_qa_1/task.toml b/tasks/0102_436_102436012_qa_1/task.toml index a09e5a566089d8b68d9bf4edf7f672cdfa1170ae..f6e0d1a7d1a38578f37a78a5d9baddb259b0b3ca 100644 --- a/tasks/0102_436_102436012_qa_1/task.toml +++ b/tasks/0102_436_102436012_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_483_102483504_qa_3/environment/bootstrap.sh b/tasks/0102_483_102483504_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_483_102483504_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_483_102483504_qa_3/environment/pull_bucket.py b/tasks/0102_483_102483504_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_483_102483504_qa_3/environment/pull_bucket.py +++ b/tasks/0102_483_102483504_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_483_102483504_qa_3/task.toml b/tasks/0102_483_102483504_qa_3/task.toml index 1d71ead535a1b8eeb2a1f56719c57cc89634ff87..2182d370a5de67b5fae9c2dbed13633a90fe19d5 100644 --- a/tasks/0102_483_102483504_qa_3/task.toml +++ b/tasks/0102_483_102483504_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_526_102526690_qa_1/environment/bootstrap.sh b/tasks/0102_526_102526690_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_526_102526690_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_526_102526690_qa_1/environment/pull_bucket.py b/tasks/0102_526_102526690_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_526_102526690_qa_1/environment/pull_bucket.py +++ b/tasks/0102_526_102526690_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_526_102526690_qa_1/task.toml b/tasks/0102_526_102526690_qa_1/task.toml index 6beb8d61ef40bd2728923ea9d8f8052a2e83bf18..b19a72944ba8c7c7e408ffb355a3de9f8eb14aac 100644 --- a/tasks/0102_526_102526690_qa_1/task.toml +++ b/tasks/0102_526_102526690_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_526_102526690_qa_2/environment/bootstrap.sh b/tasks/0102_526_102526690_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_526_102526690_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_526_102526690_qa_2/environment/pull_bucket.py b/tasks/0102_526_102526690_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_526_102526690_qa_2/environment/pull_bucket.py +++ b/tasks/0102_526_102526690_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_526_102526690_qa_2/task.toml b/tasks/0102_526_102526690_qa_2/task.toml index cc5cde9f2c85fc10d8a2f5ada183ff93de044b45..4b929917660ce5492a513ce5e2c9b467813ecbe5 100644 --- a/tasks/0102_526_102526690_qa_2/task.toml +++ b/tasks/0102_526_102526690_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_526_102526690_qa_3/environment/bootstrap.sh b/tasks/0102_526_102526690_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_526_102526690_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_526_102526690_qa_3/environment/pull_bucket.py b/tasks/0102_526_102526690_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_526_102526690_qa_3/environment/pull_bucket.py +++ b/tasks/0102_526_102526690_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_526_102526690_qa_3/task.toml b/tasks/0102_526_102526690_qa_3/task.toml index fc1a51031cc9e44790c61f12650028f1cd8585f8..0493073ddb6a133152221769212119872dbe0367 100644 --- a/tasks/0102_526_102526690_qa_3/task.toml +++ b/tasks/0102_526_102526690_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_751_102751358_qa_4/environment/bootstrap.sh b/tasks/0102_751_102751358_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_751_102751358_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_751_102751358_qa_4/environment/pull_bucket.py b/tasks/0102_751_102751358_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_751_102751358_qa_4/environment/pull_bucket.py +++ b/tasks/0102_751_102751358_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_751_102751358_qa_4/task.toml b/tasks/0102_751_102751358_qa_4/task.toml index 0433d26cde852a7504f00dcc6a82714b8605043d..375beb51c6ad0310d4700adb55990a6ed3fdc184 100644 --- a/tasks/0102_751_102751358_qa_4/task.toml +++ b/tasks/0102_751_102751358_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_769_102769080_qa_1/environment/bootstrap.sh b/tasks/0102_769_102769080_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_769_102769080_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_769_102769080_qa_1/environment/pull_bucket.py b/tasks/0102_769_102769080_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_769_102769080_qa_1/environment/pull_bucket.py +++ b/tasks/0102_769_102769080_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_769_102769080_qa_1/task.toml b/tasks/0102_769_102769080_qa_1/task.toml index 23186774717602267dadec24b02111ad997b6701..3968d6526d2df4b947fe721dbd76dff9d3ad8bc9 100644 --- a/tasks/0102_769_102769080_qa_1/task.toml +++ b/tasks/0102_769_102769080_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_781_102781194_qa_2/environment/bootstrap.sh b/tasks/0102_781_102781194_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_781_102781194_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_781_102781194_qa_2/environment/pull_bucket.py b/tasks/0102_781_102781194_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_781_102781194_qa_2/environment/pull_bucket.py +++ b/tasks/0102_781_102781194_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_781_102781194_qa_2/task.toml b/tasks/0102_781_102781194_qa_2/task.toml index 404c611f0c37320683e82c455c9ce8f54341cb3c..1059c7282529a2753713546631f0f7b735fef799 100644 --- a/tasks/0102_781_102781194_qa_2/task.toml +++ b/tasks/0102_781_102781194_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_826_102826628_qa_5/environment/bootstrap.sh b/tasks/0102_826_102826628_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_826_102826628_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_826_102826628_qa_5/environment/pull_bucket.py b/tasks/0102_826_102826628_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_826_102826628_qa_5/environment/pull_bucket.py +++ b/tasks/0102_826_102826628_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_826_102826628_qa_5/task.toml b/tasks/0102_826_102826628_qa_5/task.toml index 7d0aa71737ef1918a42d768bf65c355b9198389c..411f989027fc3a03fc9b7025f901f517fa847dbe 100644 --- a/tasks/0102_826_102826628_qa_5/task.toml +++ b/tasks/0102_826_102826628_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_875_102875624_qa_2/environment/bootstrap.sh b/tasks/0102_875_102875624_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_875_102875624_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_875_102875624_qa_2/environment/pull_bucket.py b/tasks/0102_875_102875624_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_875_102875624_qa_2/environment/pull_bucket.py +++ b/tasks/0102_875_102875624_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_875_102875624_qa_2/task.toml b/tasks/0102_875_102875624_qa_2/task.toml index 6856a84ee7724d515c68e45d49575426d27692f9..d1ca74f6be08c07a3deb860d4e894cf2f5e290f6 100644 --- a/tasks/0102_875_102875624_qa_2/task.toml +++ b/tasks/0102_875_102875624_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_875_102875624_qa_5/environment/bootstrap.sh b/tasks/0102_875_102875624_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_875_102875624_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_875_102875624_qa_5/environment/pull_bucket.py b/tasks/0102_875_102875624_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_875_102875624_qa_5/environment/pull_bucket.py +++ b/tasks/0102_875_102875624_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_875_102875624_qa_5/task.toml b/tasks/0102_875_102875624_qa_5/task.toml index 55b910b437bc56513c3ffea8b66f30f6dd085126..6c08d33189ef70fca6bd49c4c76f0493b1664815 100644 --- a/tasks/0102_875_102875624_qa_5/task.toml +++ b/tasks/0102_875_102875624_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_882_102882563_qa_1/environment/bootstrap.sh b/tasks/0102_882_102882563_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_882_102882563_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_882_102882563_qa_1/environment/pull_bucket.py b/tasks/0102_882_102882563_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_882_102882563_qa_1/environment/pull_bucket.py +++ b/tasks/0102_882_102882563_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_882_102882563_qa_1/task.toml b/tasks/0102_882_102882563_qa_1/task.toml index ccead610863a1acd391d2c6a3176230a9f84f16e..19ab1b4616ae8c49754c16b51f9870986dd79fe6 100644 --- a/tasks/0102_882_102882563_qa_1/task.toml +++ b/tasks/0102_882_102882563_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_919_102919379_qa_1/environment/bootstrap.sh b/tasks/0102_919_102919379_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_919_102919379_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_919_102919379_qa_1/environment/pull_bucket.py b/tasks/0102_919_102919379_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_919_102919379_qa_1/environment/pull_bucket.py +++ b/tasks/0102_919_102919379_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_919_102919379_qa_1/task.toml b/tasks/0102_919_102919379_qa_1/task.toml index 7ddd13d3d2edb5791f4d5d3f031001c4e507d5f3..ced179a705a1a6b98ffed9a8d78531a360f5da3e 100644 --- a/tasks/0102_919_102919379_qa_1/task.toml +++ b/tasks/0102_919_102919379_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_923_102923439_qa_2/environment/bootstrap.sh b/tasks/0102_923_102923439_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_923_102923439_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_923_102923439_qa_2/environment/pull_bucket.py b/tasks/0102_923_102923439_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_923_102923439_qa_2/environment/pull_bucket.py +++ b/tasks/0102_923_102923439_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_923_102923439_qa_2/task.toml b/tasks/0102_923_102923439_qa_2/task.toml index b707c7df95a414d8c42b9bd76d0358f467769340..add22bcb3159845ca4df3a4c3657eae1671fa2e1 100644 --- a/tasks/0102_923_102923439_qa_2/task.toml +++ b/tasks/0102_923_102923439_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_923_102923439_qa_3/environment/bootstrap.sh b/tasks/0102_923_102923439_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_923_102923439_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_923_102923439_qa_3/environment/pull_bucket.py b/tasks/0102_923_102923439_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_923_102923439_qa_3/environment/pull_bucket.py +++ b/tasks/0102_923_102923439_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_923_102923439_qa_3/task.toml b/tasks/0102_923_102923439_qa_3/task.toml index eb894f748f30ec813f19ea027f0e7d795e341bf8..38e88f0215bbbb794ec189e25b3cf3b641d09b8d 100644 --- a/tasks/0102_923_102923439_qa_3/task.toml +++ b/tasks/0102_923_102923439_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_974_102974493_qa_3/environment/bootstrap.sh b/tasks/0102_974_102974493_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_974_102974493_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_974_102974493_qa_3/environment/pull_bucket.py b/tasks/0102_974_102974493_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_974_102974493_qa_3/environment/pull_bucket.py +++ b/tasks/0102_974_102974493_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_974_102974493_qa_3/task.toml b/tasks/0102_974_102974493_qa_3/task.toml index 1ec746c503c3664e715610bb9ab6255776ac4f79..e9a4038015148927cdfdaa8b4a823434f9d88a07 100644 --- a/tasks/0102_974_102974493_qa_3/task.toml +++ b/tasks/0102_974_102974493_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_982_102982156_qa_3/environment/bootstrap.sh b/tasks/0102_982_102982156_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_982_102982156_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_982_102982156_qa_3/environment/pull_bucket.py b/tasks/0102_982_102982156_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_982_102982156_qa_3/environment/pull_bucket.py +++ b/tasks/0102_982_102982156_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_982_102982156_qa_3/task.toml b/tasks/0102_982_102982156_qa_3/task.toml index 36a5bd65ed15c3c597df36d896df786dfdcc9d3e..5069592c1984794b9fba5eb148235c28753a34ac 100644 --- a/tasks/0102_982_102982156_qa_3/task.toml +++ b/tasks/0102_982_102982156_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0102_982_102982156_qa_4/environment/bootstrap.sh b/tasks/0102_982_102982156_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0102_982_102982156_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0102_982_102982156_qa_4/environment/pull_bucket.py b/tasks/0102_982_102982156_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0102_982_102982156_qa_4/environment/pull_bucket.py +++ b/tasks/0102_982_102982156_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0102_982_102982156_qa_4/task.toml b/tasks/0102_982_102982156_qa_4/task.toml index 10c2fbaaa9ad7d702d1b1d3ad07b5b0e501b8cae..fec79c004ce0a9ae5c3e40874fd302e2e2a6d3ca 100644 --- a/tasks/0102_982_102982156_qa_4/task.toml +++ b/tasks/0102_982_102982156_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_040_103040019_qa_2/environment/bootstrap.sh b/tasks/0103_040_103040019_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_040_103040019_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_040_103040019_qa_2/environment/pull_bucket.py b/tasks/0103_040_103040019_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_040_103040019_qa_2/environment/pull_bucket.py +++ b/tasks/0103_040_103040019_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_040_103040019_qa_2/task.toml b/tasks/0103_040_103040019_qa_2/task.toml index ec6df4799d199535abee67aa5a8745440bda59ae..91c9466032973f771fcad0f134b74852e3a9a75b 100644 --- a/tasks/0103_040_103040019_qa_2/task.toml +++ b/tasks/0103_040_103040019_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_040_103040019_qa_4/environment/bootstrap.sh b/tasks/0103_040_103040019_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_040_103040019_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_040_103040019_qa_4/environment/pull_bucket.py b/tasks/0103_040_103040019_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_040_103040019_qa_4/environment/pull_bucket.py +++ b/tasks/0103_040_103040019_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_040_103040019_qa_4/task.toml b/tasks/0103_040_103040019_qa_4/task.toml index 8dc190d4e7742ba433a05118c9e9541f00f1b326..00c436934d9980a3c8ba3e442809719387a78257 100644 --- a/tasks/0103_040_103040019_qa_4/task.toml +++ b/tasks/0103_040_103040019_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_096_103096538_qa_3/environment/bootstrap.sh b/tasks/0103_096_103096538_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_096_103096538_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_096_103096538_qa_3/environment/pull_bucket.py b/tasks/0103_096_103096538_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_096_103096538_qa_3/environment/pull_bucket.py +++ b/tasks/0103_096_103096538_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_096_103096538_qa_3/task.toml b/tasks/0103_096_103096538_qa_3/task.toml index 53728c48c3d1d123f0249b3247b5bc94871fca12..8dd1b77e642267e396be2750e823c0bc80bf1082 100644 --- a/tasks/0103_096_103096538_qa_3/task.toml +++ b/tasks/0103_096_103096538_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_108_103108639_qa_4/environment/bootstrap.sh b/tasks/0103_108_103108639_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_108_103108639_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_108_103108639_qa_4/environment/pull_bucket.py b/tasks/0103_108_103108639_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_108_103108639_qa_4/environment/pull_bucket.py +++ b/tasks/0103_108_103108639_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_108_103108639_qa_4/task.toml b/tasks/0103_108_103108639_qa_4/task.toml index 235bda8f4254d4566f12e27fb4057d9433228e7f..ee4b991788bc2539eac9e1b53b03529c1598af7a 100644 --- a/tasks/0103_108_103108639_qa_4/task.toml +++ b/tasks/0103_108_103108639_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_134_103134692_qa_1/environment/bootstrap.sh b/tasks/0103_134_103134692_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_134_103134692_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_134_103134692_qa_1/environment/pull_bucket.py b/tasks/0103_134_103134692_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_134_103134692_qa_1/environment/pull_bucket.py +++ b/tasks/0103_134_103134692_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_134_103134692_qa_1/task.toml b/tasks/0103_134_103134692_qa_1/task.toml index bba16b6c9e6a7f935b883b5fcf3972ded57837a3..ba3bedeb00b7d158f97987a109b5f746019cbd49 100644 --- a/tasks/0103_134_103134692_qa_1/task.toml +++ b/tasks/0103_134_103134692_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_134_103134692_qa_4/environment/bootstrap.sh b/tasks/0103_134_103134692_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_134_103134692_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_134_103134692_qa_4/environment/pull_bucket.py b/tasks/0103_134_103134692_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_134_103134692_qa_4/environment/pull_bucket.py +++ b/tasks/0103_134_103134692_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_134_103134692_qa_4/task.toml b/tasks/0103_134_103134692_qa_4/task.toml index 1ee8505ec2c48b6aea33ba033269c124578c9310..67b276e9a6ceca9957c90044413843a5560d696b 100644 --- a/tasks/0103_134_103134692_qa_4/task.toml +++ b/tasks/0103_134_103134692_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_147_103147643_qa_3/environment/bootstrap.sh b/tasks/0103_147_103147643_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_147_103147643_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_147_103147643_qa_3/environment/pull_bucket.py b/tasks/0103_147_103147643_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_147_103147643_qa_3/environment/pull_bucket.py +++ b/tasks/0103_147_103147643_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_147_103147643_qa_3/task.toml b/tasks/0103_147_103147643_qa_3/task.toml index b58728be63eadd0a06391f17ecca7eff8ba1262c..fbe650c58ffb87077dbeb5bcbf0433ef4da3c9f9 100644 --- a/tasks/0103_147_103147643_qa_3/task.toml +++ b/tasks/0103_147_103147643_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_290_103290674_qa_3/environment/bootstrap.sh b/tasks/0103_290_103290674_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_290_103290674_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_290_103290674_qa_3/environment/pull_bucket.py b/tasks/0103_290_103290674_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_290_103290674_qa_3/environment/pull_bucket.py +++ b/tasks/0103_290_103290674_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_290_103290674_qa_3/task.toml b/tasks/0103_290_103290674_qa_3/task.toml index 89e835a9b8b32e96c3aef414fdf7fd581b5a0527..a15aeaef03b906ea6188db96e2a67ed88fe18902 100644 --- a/tasks/0103_290_103290674_qa_3/task.toml +++ b/tasks/0103_290_103290674_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_290_103290674_qa_4/environment/bootstrap.sh b/tasks/0103_290_103290674_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_290_103290674_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_290_103290674_qa_4/environment/pull_bucket.py b/tasks/0103_290_103290674_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_290_103290674_qa_4/environment/pull_bucket.py +++ b/tasks/0103_290_103290674_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_290_103290674_qa_4/task.toml b/tasks/0103_290_103290674_qa_4/task.toml index 9a10c7e5330eef9924e99aec8d101cefd7c19987..d090cb96a884b81de112176cfc2356d7698c1366 100644 --- a/tasks/0103_290_103290674_qa_4/task.toml +++ b/tasks/0103_290_103290674_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_336_103336687_qa_4/environment/bootstrap.sh b/tasks/0103_336_103336687_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_336_103336687_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_336_103336687_qa_4/environment/pull_bucket.py b/tasks/0103_336_103336687_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_336_103336687_qa_4/environment/pull_bucket.py +++ b/tasks/0103_336_103336687_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_336_103336687_qa_4/task.toml b/tasks/0103_336_103336687_qa_4/task.toml index df5d54ce65c33b8f12bb503702f085a99f474187..67fbb4e4f5219c555c758e34d418ad70f29b29bf 100644 --- a/tasks/0103_336_103336687_qa_4/task.toml +++ b/tasks/0103_336_103336687_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_361_103361984_qa_1/environment/bootstrap.sh b/tasks/0103_361_103361984_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_361_103361984_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_361_103361984_qa_1/environment/pull_bucket.py b/tasks/0103_361_103361984_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_361_103361984_qa_1/environment/pull_bucket.py +++ b/tasks/0103_361_103361984_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_361_103361984_qa_1/task.toml b/tasks/0103_361_103361984_qa_1/task.toml index e4e7eefcabbc01fd775b75780d2cbac34367beb9..4d57c19d7d280290d0bf1f9df7f124e179213e85 100644 --- a/tasks/0103_361_103361984_qa_1/task.toml +++ b/tasks/0103_361_103361984_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_361_103361984_qa_4/environment/bootstrap.sh b/tasks/0103_361_103361984_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_361_103361984_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_361_103361984_qa_4/environment/pull_bucket.py b/tasks/0103_361_103361984_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_361_103361984_qa_4/environment/pull_bucket.py +++ b/tasks/0103_361_103361984_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_361_103361984_qa_4/task.toml b/tasks/0103_361_103361984_qa_4/task.toml index d3a39c4b75c5c643be5c86e6123b3346a77e762f..34d6d066d0b291bd75657f70c1d9b9c328af7640 100644 --- a/tasks/0103_361_103361984_qa_4/task.toml +++ b/tasks/0103_361_103361984_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_407_103407932_qa_1/environment/bootstrap.sh b/tasks/0103_407_103407932_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_407_103407932_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_407_103407932_qa_1/environment/pull_bucket.py b/tasks/0103_407_103407932_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_407_103407932_qa_1/environment/pull_bucket.py +++ b/tasks/0103_407_103407932_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_407_103407932_qa_1/task.toml b/tasks/0103_407_103407932_qa_1/task.toml index a427f7d24c509ab24170b2bda8e23e309b78afe0..86d2adcf7c2f692e5b48ad756a02fd7335a70cc2 100644 --- a/tasks/0103_407_103407932_qa_1/task.toml +++ b/tasks/0103_407_103407932_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_438_103438013_qa_1/environment/bootstrap.sh b/tasks/0103_438_103438013_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_438_103438013_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_438_103438013_qa_1/environment/pull_bucket.py b/tasks/0103_438_103438013_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_438_103438013_qa_1/environment/pull_bucket.py +++ b/tasks/0103_438_103438013_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_438_103438013_qa_1/task.toml b/tasks/0103_438_103438013_qa_1/task.toml index 45fd01818532a8a31203925d0240d33bee9f2e7f..a2984e55dea3c7112d57525fc98f1b0af924fd7e 100644 --- a/tasks/0103_438_103438013_qa_1/task.toml +++ b/tasks/0103_438_103438013_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_452_103452394_qa_1/environment/bootstrap.sh b/tasks/0103_452_103452394_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_452_103452394_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_452_103452394_qa_1/environment/pull_bucket.py b/tasks/0103_452_103452394_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_452_103452394_qa_1/environment/pull_bucket.py +++ b/tasks/0103_452_103452394_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_452_103452394_qa_1/task.toml b/tasks/0103_452_103452394_qa_1/task.toml index ad6afded19df18d1d7c0055947fa5bfd6232d83a..308569e80cb68ae4fd8e32a0d0165fa03db30f74 100644 --- a/tasks/0103_452_103452394_qa_1/task.toml +++ b/tasks/0103_452_103452394_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_452_103452394_qa_2/environment/bootstrap.sh b/tasks/0103_452_103452394_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_452_103452394_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_452_103452394_qa_2/environment/pull_bucket.py b/tasks/0103_452_103452394_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_452_103452394_qa_2/environment/pull_bucket.py +++ b/tasks/0103_452_103452394_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_452_103452394_qa_2/task.toml b/tasks/0103_452_103452394_qa_2/task.toml index c76e76b9defc61fc289cca1f28ca834ac6d48b47..ebf1d9fc1a7e76ce001758dbeb83bcc14cff0363 100644 --- a/tasks/0103_452_103452394_qa_2/task.toml +++ b/tasks/0103_452_103452394_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_502_103502811_qa_4/environment/bootstrap.sh b/tasks/0103_502_103502811_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_502_103502811_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_502_103502811_qa_4/environment/pull_bucket.py b/tasks/0103_502_103502811_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_502_103502811_qa_4/environment/pull_bucket.py +++ b/tasks/0103_502_103502811_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_502_103502811_qa_4/task.toml b/tasks/0103_502_103502811_qa_4/task.toml index e085ff945eebc8955aa07d0a4da3c0a20d835074..d4d1966f59746c6c10e4048eaa58faa2509ae9db 100644 --- a/tasks/0103_502_103502811_qa_4/task.toml +++ b/tasks/0103_502_103502811_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_513_103513049_qa_3/environment/bootstrap.sh b/tasks/0103_513_103513049_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_513_103513049_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_513_103513049_qa_3/environment/pull_bucket.py b/tasks/0103_513_103513049_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_513_103513049_qa_3/environment/pull_bucket.py +++ b/tasks/0103_513_103513049_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_513_103513049_qa_3/task.toml b/tasks/0103_513_103513049_qa_3/task.toml index 63737d57a1be49ffc5ff9e11e7e4edf4740b31be..e2c0864b10f913de74ea0452ee0a51b91e07893e 100644 --- a/tasks/0103_513_103513049_qa_3/task.toml +++ b/tasks/0103_513_103513049_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_514_103514732_qa_1/environment/bootstrap.sh b/tasks/0103_514_103514732_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_514_103514732_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_514_103514732_qa_1/environment/pull_bucket.py b/tasks/0103_514_103514732_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_514_103514732_qa_1/environment/pull_bucket.py +++ b/tasks/0103_514_103514732_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_514_103514732_qa_1/task.toml b/tasks/0103_514_103514732_qa_1/task.toml index c625d99212b61de8bff10c604281ed790d26e9b9..c45401c9bba3d33ce2c6ad1b4eb0b4440cbaca61 100644 --- a/tasks/0103_514_103514732_qa_1/task.toml +++ b/tasks/0103_514_103514732_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_514_103514732_qa_4/environment/bootstrap.sh b/tasks/0103_514_103514732_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_514_103514732_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_514_103514732_qa_4/environment/pull_bucket.py b/tasks/0103_514_103514732_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_514_103514732_qa_4/environment/pull_bucket.py +++ b/tasks/0103_514_103514732_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_514_103514732_qa_4/task.toml b/tasks/0103_514_103514732_qa_4/task.toml index 0b1911903d0720a644327ca9b447a16eca4d0dba..90e59508623e01c3274daee7bf4eeb7467662124 100644 --- a/tasks/0103_514_103514732_qa_4/task.toml +++ b/tasks/0103_514_103514732_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_514_103514732_qa_5/environment/bootstrap.sh b/tasks/0103_514_103514732_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_514_103514732_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_514_103514732_qa_5/environment/pull_bucket.py b/tasks/0103_514_103514732_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_514_103514732_qa_5/environment/pull_bucket.py +++ b/tasks/0103_514_103514732_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_514_103514732_qa_5/task.toml b/tasks/0103_514_103514732_qa_5/task.toml index 60fc455de4cfdca6667d696d16957e943b0e888f..6f72fbcb7b96a16f8b10edebcefc133580c5126f 100644 --- a/tasks/0103_514_103514732_qa_5/task.toml +++ b/tasks/0103_514_103514732_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_567_103567040_qa_1/environment/bootstrap.sh b/tasks/0103_567_103567040_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_567_103567040_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_567_103567040_qa_1/environment/pull_bucket.py b/tasks/0103_567_103567040_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_567_103567040_qa_1/environment/pull_bucket.py +++ b/tasks/0103_567_103567040_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_567_103567040_qa_1/task.toml b/tasks/0103_567_103567040_qa_1/task.toml index 2651c67f80d59fb065e75217afff124a1ca311c2..09ee472b07ba4596d8a3df4b3d78212814723f65 100644 --- a/tasks/0103_567_103567040_qa_1/task.toml +++ b/tasks/0103_567_103567040_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_567_103567040_qa_3/environment/bootstrap.sh b/tasks/0103_567_103567040_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_567_103567040_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_567_103567040_qa_3/environment/pull_bucket.py b/tasks/0103_567_103567040_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_567_103567040_qa_3/environment/pull_bucket.py +++ b/tasks/0103_567_103567040_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_567_103567040_qa_3/task.toml b/tasks/0103_567_103567040_qa_3/task.toml index 10a17979b3945d73b5f8b790b4f4978df47ff5a0..af0ac2f7ab25c3632965926f8fd6edb9c438fbb8 100644 --- a/tasks/0103_567_103567040_qa_3/task.toml +++ b/tasks/0103_567_103567040_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_644_103644122_qa_1/environment/bootstrap.sh b/tasks/0103_644_103644122_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_644_103644122_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_644_103644122_qa_1/environment/pull_bucket.py b/tasks/0103_644_103644122_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_644_103644122_qa_1/environment/pull_bucket.py +++ b/tasks/0103_644_103644122_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_644_103644122_qa_1/task.toml b/tasks/0103_644_103644122_qa_1/task.toml index 84bdb9c56012540cd8a7c30b8ee0174f55d032a2..7d12ef47375422b0f91b02c9f69cfc7b0754b05f 100644 --- a/tasks/0103_644_103644122_qa_1/task.toml +++ b/tasks/0103_644_103644122_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_655_103655219_qa_3/environment/bootstrap.sh b/tasks/0103_655_103655219_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_655_103655219_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_655_103655219_qa_3/environment/pull_bucket.py b/tasks/0103_655_103655219_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_655_103655219_qa_3/environment/pull_bucket.py +++ b/tasks/0103_655_103655219_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_655_103655219_qa_3/task.toml b/tasks/0103_655_103655219_qa_3/task.toml index cb33bf7fe7c6b8c9069c91947f91888b15e9c9dc..78fbb42af4a6baa8beb0e823e791414cd19fdf51 100644 --- a/tasks/0103_655_103655219_qa_3/task.toml +++ b/tasks/0103_655_103655219_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_696_103696372_qa_1/environment/bootstrap.sh b/tasks/0103_696_103696372_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_696_103696372_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_696_103696372_qa_1/environment/pull_bucket.py b/tasks/0103_696_103696372_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_696_103696372_qa_1/environment/pull_bucket.py +++ b/tasks/0103_696_103696372_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_696_103696372_qa_1/task.toml b/tasks/0103_696_103696372_qa_1/task.toml index c3d239672c57806c1a1d874a80fa0b5f3fda1665..07eec45793312411f5bc20586e5e8dab72d01662 100644 --- a/tasks/0103_696_103696372_qa_1/task.toml +++ b/tasks/0103_696_103696372_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_696_103696372_qa_4/environment/bootstrap.sh b/tasks/0103_696_103696372_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_696_103696372_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_696_103696372_qa_4/environment/pull_bucket.py b/tasks/0103_696_103696372_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_696_103696372_qa_4/environment/pull_bucket.py +++ b/tasks/0103_696_103696372_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_696_103696372_qa_4/task.toml b/tasks/0103_696_103696372_qa_4/task.toml index 4e0b7ab4eb1fbc2aac36e29598474b57ab1d5035..fd60e8c02d8a4411febd6dd161f4dace90ba134b 100644 --- a/tasks/0103_696_103696372_qa_4/task.toml +++ b/tasks/0103_696_103696372_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_724_103724181_qa_4/environment/bootstrap.sh b/tasks/0103_724_103724181_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_724_103724181_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_724_103724181_qa_4/environment/pull_bucket.py b/tasks/0103_724_103724181_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_724_103724181_qa_4/environment/pull_bucket.py +++ b/tasks/0103_724_103724181_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_724_103724181_qa_4/task.toml b/tasks/0103_724_103724181_qa_4/task.toml index c0422ac6053915289203bf910b44219ea8c8c911..ad214da60c9ef68a2e5395ff5cef05bb31c36368 100644 --- a/tasks/0103_724_103724181_qa_4/task.toml +++ b/tasks/0103_724_103724181_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_747_103747907_qa_1/environment/bootstrap.sh b/tasks/0103_747_103747907_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_747_103747907_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_747_103747907_qa_1/environment/pull_bucket.py b/tasks/0103_747_103747907_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_747_103747907_qa_1/environment/pull_bucket.py +++ b/tasks/0103_747_103747907_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_747_103747907_qa_1/task.toml b/tasks/0103_747_103747907_qa_1/task.toml index b08f122911e479152a7286676b3e14c40ffc0d98..26d765d2be0e4e42d40e383cbbb12718099c8d68 100644 --- a/tasks/0103_747_103747907_qa_1/task.toml +++ b/tasks/0103_747_103747907_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_747_103747907_qa_3/environment/bootstrap.sh b/tasks/0103_747_103747907_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_747_103747907_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_747_103747907_qa_3/environment/pull_bucket.py b/tasks/0103_747_103747907_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_747_103747907_qa_3/environment/pull_bucket.py +++ b/tasks/0103_747_103747907_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_747_103747907_qa_3/task.toml b/tasks/0103_747_103747907_qa_3/task.toml index 26f6e6175b5fd7369f0095c5678866c0578408e9..8e2e18dce83aa3dba571c7a24d9283ffc07d6db6 100644 --- a/tasks/0103_747_103747907_qa_3/task.toml +++ b/tasks/0103_747_103747907_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_757_103757929_qa_2/environment/bootstrap.sh b/tasks/0103_757_103757929_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_757_103757929_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_757_103757929_qa_2/environment/pull_bucket.py b/tasks/0103_757_103757929_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_757_103757929_qa_2/environment/pull_bucket.py +++ b/tasks/0103_757_103757929_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_757_103757929_qa_2/task.toml b/tasks/0103_757_103757929_qa_2/task.toml index 9c4a1b8e5d6e5860e92e778801cf2bb2ab598788..4ef64b587e727c950850d8999e2db1d2227b0575 100644 --- a/tasks/0103_757_103757929_qa_2/task.toml +++ b/tasks/0103_757_103757929_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_757_103757929_qa_3/environment/bootstrap.sh b/tasks/0103_757_103757929_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_757_103757929_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_757_103757929_qa_3/environment/pull_bucket.py b/tasks/0103_757_103757929_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_757_103757929_qa_3/environment/pull_bucket.py +++ b/tasks/0103_757_103757929_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_757_103757929_qa_3/task.toml b/tasks/0103_757_103757929_qa_3/task.toml index 75d4fd4090614398ebafcaa9bb9c94492b887351..1a0609947fb1ad5fa4f6f0513a6226cafd6b9f08 100644 --- a/tasks/0103_757_103757929_qa_3/task.toml +++ b/tasks/0103_757_103757929_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_757_103757929_qa_4/environment/bootstrap.sh b/tasks/0103_757_103757929_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_757_103757929_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_757_103757929_qa_4/environment/pull_bucket.py b/tasks/0103_757_103757929_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_757_103757929_qa_4/environment/pull_bucket.py +++ b/tasks/0103_757_103757929_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_757_103757929_qa_4/task.toml b/tasks/0103_757_103757929_qa_4/task.toml index ce67720e0a877d2635c1198987ff488194cc4004..343cc4e6ca667cd59fc05c268fe5849412f1ca61 100644 --- a/tasks/0103_757_103757929_qa_4/task.toml +++ b/tasks/0103_757_103757929_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_757_103757929_qa_5/environment/bootstrap.sh b/tasks/0103_757_103757929_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_757_103757929_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_757_103757929_qa_5/environment/pull_bucket.py b/tasks/0103_757_103757929_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_757_103757929_qa_5/environment/pull_bucket.py +++ b/tasks/0103_757_103757929_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_757_103757929_qa_5/task.toml b/tasks/0103_757_103757929_qa_5/task.toml index 26388e2f9e0c1a5e9e0a234540fcee77119ce655..c3ad0092b90cdb896905723d14e0b5898a146466 100644 --- a/tasks/0103_757_103757929_qa_5/task.toml +++ b/tasks/0103_757_103757929_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_797_103797974_qa_1/environment/bootstrap.sh b/tasks/0103_797_103797974_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_797_103797974_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_797_103797974_qa_1/environment/pull_bucket.py b/tasks/0103_797_103797974_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_797_103797974_qa_1/environment/pull_bucket.py +++ b/tasks/0103_797_103797974_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_797_103797974_qa_1/task.toml b/tasks/0103_797_103797974_qa_1/task.toml index f526d65865f42ca8aba0b013f1dad0618869851f..5b8da532f3ce202273d58b0c938dd91bbcced09a 100644 --- a/tasks/0103_797_103797974_qa_1/task.toml +++ b/tasks/0103_797_103797974_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_859_103859537_qa_1/environment/bootstrap.sh b/tasks/0103_859_103859537_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_859_103859537_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_859_103859537_qa_1/environment/pull_bucket.py b/tasks/0103_859_103859537_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_859_103859537_qa_1/environment/pull_bucket.py +++ b/tasks/0103_859_103859537_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_859_103859537_qa_1/task.toml b/tasks/0103_859_103859537_qa_1/task.toml index 944ecab00b995529f927f78765db7d4f711f4fe4..828cddd2b8807f9c72e040dafdb2dc7289475cd6 100644 --- a/tasks/0103_859_103859537_qa_1/task.toml +++ b/tasks/0103_859_103859537_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_884_103884351_qa_1/environment/bootstrap.sh b/tasks/0103_884_103884351_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_884_103884351_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_884_103884351_qa_1/environment/pull_bucket.py b/tasks/0103_884_103884351_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_884_103884351_qa_1/environment/pull_bucket.py +++ b/tasks/0103_884_103884351_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_884_103884351_qa_1/task.toml b/tasks/0103_884_103884351_qa_1/task.toml index 14de8034492b131a3f3e1bb1d8840e7693bf7770..faad0499d79b9b594cd34acc47f7d1cb304e6a9f 100644 --- a/tasks/0103_884_103884351_qa_1/task.toml +++ b/tasks/0103_884_103884351_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_889_103889952_qa_2/environment/bootstrap.sh b/tasks/0103_889_103889952_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_889_103889952_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_889_103889952_qa_2/environment/pull_bucket.py b/tasks/0103_889_103889952_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_889_103889952_qa_2/environment/pull_bucket.py +++ b/tasks/0103_889_103889952_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_889_103889952_qa_2/task.toml b/tasks/0103_889_103889952_qa_2/task.toml index 891dab1f0fcf2752f91c78bac64b228bd15eea1e..4e36677965cef71bc03d86dc9ae628f908e85ea6 100644 --- a/tasks/0103_889_103889952_qa_2/task.toml +++ b/tasks/0103_889_103889952_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_889_103889952_qa_3/environment/bootstrap.sh b/tasks/0103_889_103889952_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_889_103889952_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_889_103889952_qa_3/environment/pull_bucket.py b/tasks/0103_889_103889952_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_889_103889952_qa_3/environment/pull_bucket.py +++ b/tasks/0103_889_103889952_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_889_103889952_qa_3/task.toml b/tasks/0103_889_103889952_qa_3/task.toml index 73813ca0fc9a64aaf29aff4f5f9502ff989aeb5f..4cb8427707b2051845422236586d36e881f3ecf1 100644 --- a/tasks/0103_889_103889952_qa_3/task.toml +++ b/tasks/0103_889_103889952_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_923_103923129_qa_1/environment/bootstrap.sh b/tasks/0103_923_103923129_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_923_103923129_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_923_103923129_qa_1/environment/pull_bucket.py b/tasks/0103_923_103923129_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_923_103923129_qa_1/environment/pull_bucket.py +++ b/tasks/0103_923_103923129_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_923_103923129_qa_1/task.toml b/tasks/0103_923_103923129_qa_1/task.toml index 338106b024adc633f3173548300a5ef50a4d1353..879970c5582a4541f3f8ca5bc50ad90845c57b4b 100644 --- a/tasks/0103_923_103923129_qa_1/task.toml +++ b/tasks/0103_923_103923129_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0103_977_103977416_qa_5/environment/bootstrap.sh b/tasks/0103_977_103977416_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0103_977_103977416_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0103_977_103977416_qa_5/environment/pull_bucket.py b/tasks/0103_977_103977416_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0103_977_103977416_qa_5/environment/pull_bucket.py +++ b/tasks/0103_977_103977416_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0103_977_103977416_qa_5/task.toml b/tasks/0103_977_103977416_qa_5/task.toml index def35b3ff94422526122f29b12b94af9505b67b8..0dd4ac166df17dffe0d77797ee769c1b58eaf64b 100644 --- a/tasks/0103_977_103977416_qa_5/task.toml +++ b/tasks/0103_977_103977416_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_079_104079493_qa_3/environment/bootstrap.sh b/tasks/0104_079_104079493_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_079_104079493_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_079_104079493_qa_3/environment/pull_bucket.py b/tasks/0104_079_104079493_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_079_104079493_qa_3/environment/pull_bucket.py +++ b/tasks/0104_079_104079493_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_079_104079493_qa_3/task.toml b/tasks/0104_079_104079493_qa_3/task.toml index a983c2450030561f52cbf9d1df8e908b731d1f78..91ae3442d44959a92252a6b72b1decbc515a1f38 100644 --- a/tasks/0104_079_104079493_qa_3/task.toml +++ b/tasks/0104_079_104079493_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_115_104115135_qa_4/environment/bootstrap.sh b/tasks/0104_115_104115135_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_115_104115135_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_115_104115135_qa_4/environment/pull_bucket.py b/tasks/0104_115_104115135_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_115_104115135_qa_4/environment/pull_bucket.py +++ b/tasks/0104_115_104115135_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_115_104115135_qa_4/task.toml b/tasks/0104_115_104115135_qa_4/task.toml index 2a282614e08c13b88549e4c40d977b1b73688bce..d8953975637ba2f612e19c464cee25eabca636e4 100644 --- a/tasks/0104_115_104115135_qa_4/task.toml +++ b/tasks/0104_115_104115135_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_115_104115755_qa_1/environment/bootstrap.sh b/tasks/0104_115_104115755_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_115_104115755_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_115_104115755_qa_1/environment/pull_bucket.py b/tasks/0104_115_104115755_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_115_104115755_qa_1/environment/pull_bucket.py +++ b/tasks/0104_115_104115755_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_115_104115755_qa_1/task.toml b/tasks/0104_115_104115755_qa_1/task.toml index 8633af0a1230ffef6a744aee40251421ac66594c..4dbdd31dbea1150df975e805fe8edc07172970a6 100644 --- a/tasks/0104_115_104115755_qa_1/task.toml +++ b/tasks/0104_115_104115755_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_115_104115755_qa_3/environment/bootstrap.sh b/tasks/0104_115_104115755_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_115_104115755_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_115_104115755_qa_3/environment/pull_bucket.py b/tasks/0104_115_104115755_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_115_104115755_qa_3/environment/pull_bucket.py +++ b/tasks/0104_115_104115755_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_115_104115755_qa_3/task.toml b/tasks/0104_115_104115755_qa_3/task.toml index 7b7bfb3f0dddfe14a03f5d7966e8cb488f51cb04..3585ec02b72a0a883172088e02679fa084b0363f 100644 --- a/tasks/0104_115_104115755_qa_3/task.toml +++ b/tasks/0104_115_104115755_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_115_104115755_qa_4/environment/bootstrap.sh b/tasks/0104_115_104115755_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_115_104115755_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_115_104115755_qa_4/environment/pull_bucket.py b/tasks/0104_115_104115755_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_115_104115755_qa_4/environment/pull_bucket.py +++ b/tasks/0104_115_104115755_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_115_104115755_qa_4/task.toml b/tasks/0104_115_104115755_qa_4/task.toml index 48f054eaef4bb989f1725753e72b3dbd5265d240..8b93951b8fccdfb3df6a633e97bbc7eaa148b455 100644 --- a/tasks/0104_115_104115755_qa_4/task.toml +++ b/tasks/0104_115_104115755_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_138_104138961_qa_2/environment/bootstrap.sh b/tasks/0104_138_104138961_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_138_104138961_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_138_104138961_qa_2/environment/pull_bucket.py b/tasks/0104_138_104138961_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_138_104138961_qa_2/environment/pull_bucket.py +++ b/tasks/0104_138_104138961_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_138_104138961_qa_2/task.toml b/tasks/0104_138_104138961_qa_2/task.toml index 5c452733990457c5fcd68b660dfa57fd5f3906bf..54019de53476b616b5ef2f4522c5d1336255417b 100644 --- a/tasks/0104_138_104138961_qa_2/task.toml +++ b/tasks/0104_138_104138961_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_138_104138961_qa_3/environment/bootstrap.sh b/tasks/0104_138_104138961_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_138_104138961_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_138_104138961_qa_3/environment/pull_bucket.py b/tasks/0104_138_104138961_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_138_104138961_qa_3/environment/pull_bucket.py +++ b/tasks/0104_138_104138961_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_138_104138961_qa_3/task.toml b/tasks/0104_138_104138961_qa_3/task.toml index 26c0158f0b9a3ac3ed5fe6231a6179ba06fccede..dbe512979d27e91c7397c23f98145df9ae28dd1f 100644 --- a/tasks/0104_138_104138961_qa_3/task.toml +++ b/tasks/0104_138_104138961_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_143_104143863_qa_1/environment/bootstrap.sh b/tasks/0104_143_104143863_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_143_104143863_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_143_104143863_qa_1/environment/pull_bucket.py b/tasks/0104_143_104143863_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_143_104143863_qa_1/environment/pull_bucket.py +++ b/tasks/0104_143_104143863_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_143_104143863_qa_1/task.toml b/tasks/0104_143_104143863_qa_1/task.toml index b8065f740c57ac024275d1be0197bab260a5b505..f51f9b2e7f7318db38d7ea0fea5c8b5eae444a65 100644 --- a/tasks/0104_143_104143863_qa_1/task.toml +++ b/tasks/0104_143_104143863_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_143_104143863_qa_3/environment/bootstrap.sh b/tasks/0104_143_104143863_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_143_104143863_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_143_104143863_qa_3/environment/pull_bucket.py b/tasks/0104_143_104143863_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_143_104143863_qa_3/environment/pull_bucket.py +++ b/tasks/0104_143_104143863_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_143_104143863_qa_3/task.toml b/tasks/0104_143_104143863_qa_3/task.toml index c1acf107d31ea81620977cbc1ae071375514c7b7..bef70ad3c7b6539ceba7780cdf1312b8f0f70a82 100644 --- a/tasks/0104_143_104143863_qa_3/task.toml +++ b/tasks/0104_143_104143863_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_159_104159135_qa_3/environment/bootstrap.sh b/tasks/0104_159_104159135_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_159_104159135_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_159_104159135_qa_3/environment/pull_bucket.py b/tasks/0104_159_104159135_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_159_104159135_qa_3/environment/pull_bucket.py +++ b/tasks/0104_159_104159135_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_159_104159135_qa_3/task.toml b/tasks/0104_159_104159135_qa_3/task.toml index 4862a1ce06b9efed6fb18616fce1005ba091e05e..4c13997b8157e0c40f996e22a1acfe0cbc69b7cc 100644 --- a/tasks/0104_159_104159135_qa_3/task.toml +++ b/tasks/0104_159_104159135_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_159_104159135_qa_4/environment/bootstrap.sh b/tasks/0104_159_104159135_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_159_104159135_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_159_104159135_qa_4/environment/pull_bucket.py b/tasks/0104_159_104159135_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_159_104159135_qa_4/environment/pull_bucket.py +++ b/tasks/0104_159_104159135_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_159_104159135_qa_4/task.toml b/tasks/0104_159_104159135_qa_4/task.toml index 62ab133daf4e1fda1a338c104d49a3658cf9e89a..9e203070503050326f6331757076f2e3abcf708c 100644 --- a/tasks/0104_159_104159135_qa_4/task.toml +++ b/tasks/0104_159_104159135_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_159_104159135_qa_5/environment/bootstrap.sh b/tasks/0104_159_104159135_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_159_104159135_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_159_104159135_qa_5/environment/pull_bucket.py b/tasks/0104_159_104159135_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_159_104159135_qa_5/environment/pull_bucket.py +++ b/tasks/0104_159_104159135_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_159_104159135_qa_5/task.toml b/tasks/0104_159_104159135_qa_5/task.toml index e46568a52263979b28f4997b2b055781eac9a437..198899172db09faad9c9fbf335e86a06bf542597 100644 --- a/tasks/0104_159_104159135_qa_5/task.toml +++ b/tasks/0104_159_104159135_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_172_104172936_qa_1/environment/bootstrap.sh b/tasks/0104_172_104172936_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_172_104172936_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_172_104172936_qa_1/environment/pull_bucket.py b/tasks/0104_172_104172936_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_172_104172936_qa_1/environment/pull_bucket.py +++ b/tasks/0104_172_104172936_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_172_104172936_qa_1/task.toml b/tasks/0104_172_104172936_qa_1/task.toml index a185b6e6a9bbbb1f73c86f4214d72138a2dade1d..9006c8931732a0db6530fa1aa6fbe828afc7ed62 100644 --- a/tasks/0104_172_104172936_qa_1/task.toml +++ b/tasks/0104_172_104172936_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_172_104172936_qa_3/environment/bootstrap.sh b/tasks/0104_172_104172936_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_172_104172936_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_172_104172936_qa_3/environment/pull_bucket.py b/tasks/0104_172_104172936_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_172_104172936_qa_3/environment/pull_bucket.py +++ b/tasks/0104_172_104172936_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_172_104172936_qa_3/task.toml b/tasks/0104_172_104172936_qa_3/task.toml index 016f26e37a9897333c3d9e3b5a7740a85c248cc2..317f186d313b9890315316e6ff0322ce985a25a8 100644 --- a/tasks/0104_172_104172936_qa_3/task.toml +++ b/tasks/0104_172_104172936_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_194_104194599_qa_4/environment/bootstrap.sh b/tasks/0104_194_104194599_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_194_104194599_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_194_104194599_qa_4/environment/pull_bucket.py b/tasks/0104_194_104194599_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_194_104194599_qa_4/environment/pull_bucket.py +++ b/tasks/0104_194_104194599_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_194_104194599_qa_4/task.toml b/tasks/0104_194_104194599_qa_4/task.toml index 8143c0b15833afed6bbc887d16017a2fb1a840ca..a7f5e0b9d541744b72f1b617d75aa90e9fa4c04f 100644 --- a/tasks/0104_194_104194599_qa_4/task.toml +++ b/tasks/0104_194_104194599_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_261_104261137_qa_1/environment/bootstrap.sh b/tasks/0104_261_104261137_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_261_104261137_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_261_104261137_qa_1/environment/pull_bucket.py b/tasks/0104_261_104261137_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_261_104261137_qa_1/environment/pull_bucket.py +++ b/tasks/0104_261_104261137_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_261_104261137_qa_1/task.toml b/tasks/0104_261_104261137_qa_1/task.toml index aafbc9839b601192a1caac15e474d94097d15f79..d7192c6e04c66fd8d4e86be9a734530048e77c96 100644 --- a/tasks/0104_261_104261137_qa_1/task.toml +++ b/tasks/0104_261_104261137_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_261_104261356_qa_5/environment/bootstrap.sh b/tasks/0104_261_104261356_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_261_104261356_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_261_104261356_qa_5/environment/pull_bucket.py b/tasks/0104_261_104261356_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_261_104261356_qa_5/environment/pull_bucket.py +++ b/tasks/0104_261_104261356_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_261_104261356_qa_5/task.toml b/tasks/0104_261_104261356_qa_5/task.toml index ef1ae7914754025d6fe24104fd454eaeeaf1e2f4..bdff3e510a501a1551a4a27b466f460b49aca666 100644 --- a/tasks/0104_261_104261356_qa_5/task.toml +++ b/tasks/0104_261_104261356_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_333_104333921_qa_3/environment/bootstrap.sh b/tasks/0104_333_104333921_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_333_104333921_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_333_104333921_qa_3/environment/pull_bucket.py b/tasks/0104_333_104333921_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_333_104333921_qa_3/environment/pull_bucket.py +++ b/tasks/0104_333_104333921_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_333_104333921_qa_3/task.toml b/tasks/0104_333_104333921_qa_3/task.toml index 24227255718f4145dde73ff96b71aabf1f8999a2..8d75df9b0c9b6420366ccbd3f88f3119cc5d943a 100644 --- a/tasks/0104_333_104333921_qa_3/task.toml +++ b/tasks/0104_333_104333921_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_333_104333921_qa_4/environment/bootstrap.sh b/tasks/0104_333_104333921_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_333_104333921_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_333_104333921_qa_4/environment/pull_bucket.py b/tasks/0104_333_104333921_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_333_104333921_qa_4/environment/pull_bucket.py +++ b/tasks/0104_333_104333921_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_333_104333921_qa_4/task.toml b/tasks/0104_333_104333921_qa_4/task.toml index d5874e99cfff459cf9c5c62efe5c583a023a097f..e2b21a72b6626ae4d3e43da2c0199ecc379a1802 100644 --- a/tasks/0104_333_104333921_qa_4/task.toml +++ b/tasks/0104_333_104333921_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_391_104391116_qa_1/environment/bootstrap.sh b/tasks/0104_391_104391116_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_391_104391116_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_391_104391116_qa_1/environment/pull_bucket.py b/tasks/0104_391_104391116_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_391_104391116_qa_1/environment/pull_bucket.py +++ b/tasks/0104_391_104391116_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_391_104391116_qa_1/task.toml b/tasks/0104_391_104391116_qa_1/task.toml index 4ab0c5558d22aa12c7f9211886f0d13c892d95b2..c3ef62806f78217171ff68316839c2dc4a92406b 100644 --- a/tasks/0104_391_104391116_qa_1/task.toml +++ b/tasks/0104_391_104391116_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_399_104399279_qa_1/environment/bootstrap.sh b/tasks/0104_399_104399279_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_399_104399279_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_399_104399279_qa_1/environment/pull_bucket.py b/tasks/0104_399_104399279_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_399_104399279_qa_1/environment/pull_bucket.py +++ b/tasks/0104_399_104399279_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_399_104399279_qa_1/task.toml b/tasks/0104_399_104399279_qa_1/task.toml index bc9d6090df680a766f90f8be163af20217cd6abb..7d4d8d5bfb5be6bc9f2c36388ddac34e1e03c1e2 100644 --- a/tasks/0104_399_104399279_qa_1/task.toml +++ b/tasks/0104_399_104399279_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_399_104399279_qa_3/environment/bootstrap.sh b/tasks/0104_399_104399279_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_399_104399279_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_399_104399279_qa_3/environment/pull_bucket.py b/tasks/0104_399_104399279_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_399_104399279_qa_3/environment/pull_bucket.py +++ b/tasks/0104_399_104399279_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_399_104399279_qa_3/task.toml b/tasks/0104_399_104399279_qa_3/task.toml index 63d29e003647296d663a57bfa92d11ed29db1b23..8a509055e4d2fd9458d01752cfe06cbaee0d23db 100644 --- a/tasks/0104_399_104399279_qa_3/task.toml +++ b/tasks/0104_399_104399279_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_425_104425249_qa_1/environment/bootstrap.sh b/tasks/0104_425_104425249_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_425_104425249_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_425_104425249_qa_1/environment/pull_bucket.py b/tasks/0104_425_104425249_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_425_104425249_qa_1/environment/pull_bucket.py +++ b/tasks/0104_425_104425249_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_425_104425249_qa_1/task.toml b/tasks/0104_425_104425249_qa_1/task.toml index 01af1928442fab205862f9069336b29291129b4c..14fbcd1d08397f310b37fe79a6de032cad4dda17 100644 --- a/tasks/0104_425_104425249_qa_1/task.toml +++ b/tasks/0104_425_104425249_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_503_104503087_qa_2/environment/bootstrap.sh b/tasks/0104_503_104503087_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_503_104503087_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_503_104503087_qa_2/environment/pull_bucket.py b/tasks/0104_503_104503087_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_503_104503087_qa_2/environment/pull_bucket.py +++ b/tasks/0104_503_104503087_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_503_104503087_qa_2/task.toml b/tasks/0104_503_104503087_qa_2/task.toml index 0ae05d8cb881ea9ae2dec0cfbde5886d2e163bc9..bd19143844b3a55faf8e3b59f24ba70c8dc27507 100644 --- a/tasks/0104_503_104503087_qa_2/task.toml +++ b/tasks/0104_503_104503087_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_503_104503087_qa_3/environment/bootstrap.sh b/tasks/0104_503_104503087_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_503_104503087_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_503_104503087_qa_3/environment/pull_bucket.py b/tasks/0104_503_104503087_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_503_104503087_qa_3/environment/pull_bucket.py +++ b/tasks/0104_503_104503087_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_503_104503087_qa_3/task.toml b/tasks/0104_503_104503087_qa_3/task.toml index 7cf37ecdb2ae91b5efc277def157940c808d31fa..0b196c94ae7b18958a2d173ac58cc8d30774ad29 100644 --- a/tasks/0104_503_104503087_qa_3/task.toml +++ b/tasks/0104_503_104503087_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_518_104518190_qa_2/environment/bootstrap.sh b/tasks/0104_518_104518190_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_518_104518190_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_518_104518190_qa_2/environment/pull_bucket.py b/tasks/0104_518_104518190_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_518_104518190_qa_2/environment/pull_bucket.py +++ b/tasks/0104_518_104518190_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_518_104518190_qa_2/task.toml b/tasks/0104_518_104518190_qa_2/task.toml index 3a17d8f946225e446b9338d70b6b2e44848e7f02..8a5360e85913978a683076332fc8ad5288f2ad98 100644 --- a/tasks/0104_518_104518190_qa_2/task.toml +++ b/tasks/0104_518_104518190_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_518_104518190_qa_4/environment/bootstrap.sh b/tasks/0104_518_104518190_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_518_104518190_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_518_104518190_qa_4/environment/pull_bucket.py b/tasks/0104_518_104518190_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_518_104518190_qa_4/environment/pull_bucket.py +++ b/tasks/0104_518_104518190_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_518_104518190_qa_4/task.toml b/tasks/0104_518_104518190_qa_4/task.toml index c27381cf39c31711614d9a521ccf123b4548601d..f9aa98962bd2065655ae31bc68083d4fb57e0c5b 100644 --- a/tasks/0104_518_104518190_qa_4/task.toml +++ b/tasks/0104_518_104518190_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_567_104567275_qa_5/environment/bootstrap.sh b/tasks/0104_567_104567275_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_567_104567275_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_567_104567275_qa_5/environment/pull_bucket.py b/tasks/0104_567_104567275_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_567_104567275_qa_5/environment/pull_bucket.py +++ b/tasks/0104_567_104567275_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_567_104567275_qa_5/task.toml b/tasks/0104_567_104567275_qa_5/task.toml index c5fdc5c28f1d6bd3d3bcc72d081ce2779172ef92..a77cce224437a77dd8a6bed1de3f53e168deb56a 100644 --- a/tasks/0104_567_104567275_qa_5/task.toml +++ b/tasks/0104_567_104567275_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_591_104591892_qa_3/environment/bootstrap.sh b/tasks/0104_591_104591892_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_591_104591892_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_591_104591892_qa_3/environment/pull_bucket.py b/tasks/0104_591_104591892_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_591_104591892_qa_3/environment/pull_bucket.py +++ b/tasks/0104_591_104591892_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_591_104591892_qa_3/task.toml b/tasks/0104_591_104591892_qa_3/task.toml index 8446cc4ce6144333519b1c6f347c69122585775d..8c369a9320b37dc4f689674cf049f783e4672e21 100644 --- a/tasks/0104_591_104591892_qa_3/task.toml +++ b/tasks/0104_591_104591892_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_591_104591892_qa_4/environment/bootstrap.sh b/tasks/0104_591_104591892_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_591_104591892_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_591_104591892_qa_4/environment/pull_bucket.py b/tasks/0104_591_104591892_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_591_104591892_qa_4/environment/pull_bucket.py +++ b/tasks/0104_591_104591892_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_591_104591892_qa_4/task.toml b/tasks/0104_591_104591892_qa_4/task.toml index 87ac8ceabbd200d2080eada7d27c6cd7b9608fa4..535526f693adb3a384ba62cf3740c5a53178394d 100644 --- a/tasks/0104_591_104591892_qa_4/task.toml +++ b/tasks/0104_591_104591892_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_601_104601398_qa_4/environment/bootstrap.sh b/tasks/0104_601_104601398_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_601_104601398_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_601_104601398_qa_4/environment/pull_bucket.py b/tasks/0104_601_104601398_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_601_104601398_qa_4/environment/pull_bucket.py +++ b/tasks/0104_601_104601398_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_601_104601398_qa_4/task.toml b/tasks/0104_601_104601398_qa_4/task.toml index c3746c878d9ada890060624e7a5f3d63b003bf11..83ccdbc4e51b975f18e6952ab33cf8ab8f10d592 100644 --- a/tasks/0104_601_104601398_qa_4/task.toml +++ b/tasks/0104_601_104601398_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_747_104747466_qa_2/environment/bootstrap.sh b/tasks/0104_747_104747466_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_747_104747466_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_747_104747466_qa_2/environment/pull_bucket.py b/tasks/0104_747_104747466_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_747_104747466_qa_2/environment/pull_bucket.py +++ b/tasks/0104_747_104747466_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_747_104747466_qa_2/task.toml b/tasks/0104_747_104747466_qa_2/task.toml index 2bae965ec2b4eede41f2cf688b6e159841e6d1c4..6c7e2962968a043c1843c0ce3e56c33034318e8a 100644 --- a/tasks/0104_747_104747466_qa_2/task.toml +++ b/tasks/0104_747_104747466_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_747_104747466_qa_3/environment/bootstrap.sh b/tasks/0104_747_104747466_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_747_104747466_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_747_104747466_qa_3/environment/pull_bucket.py b/tasks/0104_747_104747466_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_747_104747466_qa_3/environment/pull_bucket.py +++ b/tasks/0104_747_104747466_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_747_104747466_qa_3/task.toml b/tasks/0104_747_104747466_qa_3/task.toml index 252c4c9324d88c1d020c1a6e7270dab60b05b71f..a5c1b2d3f39ab659a8cc3acd672f4cb34d9c7898 100644 --- a/tasks/0104_747_104747466_qa_3/task.toml +++ b/tasks/0104_747_104747466_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_867_104867600_qa_5/environment/bootstrap.sh b/tasks/0104_867_104867600_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_867_104867600_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_867_104867600_qa_5/environment/pull_bucket.py b/tasks/0104_867_104867600_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_867_104867600_qa_5/environment/pull_bucket.py +++ b/tasks/0104_867_104867600_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_867_104867600_qa_5/task.toml b/tasks/0104_867_104867600_qa_5/task.toml index 92bf192c2c256fbb4779c06f9e156b152159f285..d0b23fcbe9f864d61c7feb0dbf7a150357cb0987 100644 --- a/tasks/0104_867_104867600_qa_5/task.toml +++ b/tasks/0104_867_104867600_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_868_104868299_qa_1/environment/bootstrap.sh b/tasks/0104_868_104868299_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_868_104868299_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_868_104868299_qa_1/environment/pull_bucket.py b/tasks/0104_868_104868299_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_868_104868299_qa_1/environment/pull_bucket.py +++ b/tasks/0104_868_104868299_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_868_104868299_qa_1/task.toml b/tasks/0104_868_104868299_qa_1/task.toml index 7ec708dc64234536cffe6f19ab486858af613f2a..21d0ceca88419db98f77126ce4f75efba6336181 100644 --- a/tasks/0104_868_104868299_qa_1/task.toml +++ b/tasks/0104_868_104868299_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_868_104868299_qa_2/environment/bootstrap.sh b/tasks/0104_868_104868299_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_868_104868299_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_868_104868299_qa_2/environment/pull_bucket.py b/tasks/0104_868_104868299_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_868_104868299_qa_2/environment/pull_bucket.py +++ b/tasks/0104_868_104868299_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_868_104868299_qa_2/task.toml b/tasks/0104_868_104868299_qa_2/task.toml index 80895a5e8b968f3d7a8a1a136692aa6e03b86bd3..57c32ef9b377738c39d606163bf2398b6f77c3cf 100644 --- a/tasks/0104_868_104868299_qa_2/task.toml +++ b/tasks/0104_868_104868299_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_905_104905979_qa_1/environment/bootstrap.sh b/tasks/0104_905_104905979_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_905_104905979_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_905_104905979_qa_1/environment/pull_bucket.py b/tasks/0104_905_104905979_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_905_104905979_qa_1/environment/pull_bucket.py +++ b/tasks/0104_905_104905979_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_905_104905979_qa_1/task.toml b/tasks/0104_905_104905979_qa_1/task.toml index 2fece21639f9b65fc0bd240913ddc98cf88c9321..391f3a31531a8169509ee929886d498cbee4826f 100644 --- a/tasks/0104_905_104905979_qa_1/task.toml +++ b/tasks/0104_905_104905979_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_905_104905979_qa_3/environment/bootstrap.sh b/tasks/0104_905_104905979_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_905_104905979_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_905_104905979_qa_3/environment/pull_bucket.py b/tasks/0104_905_104905979_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_905_104905979_qa_3/environment/pull_bucket.py +++ b/tasks/0104_905_104905979_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_905_104905979_qa_3/task.toml b/tasks/0104_905_104905979_qa_3/task.toml index 1c2c5dcd1053c9b7f7b4beb9f63cb8cfa0fc9e60..fe4d8c00b85bb812e764f21170f5e2a61cb843dc 100644 --- a/tasks/0104_905_104905979_qa_3/task.toml +++ b/tasks/0104_905_104905979_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_919_104919033_qa_4/environment/bootstrap.sh b/tasks/0104_919_104919033_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_919_104919033_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_919_104919033_qa_4/environment/pull_bucket.py b/tasks/0104_919_104919033_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_919_104919033_qa_4/environment/pull_bucket.py +++ b/tasks/0104_919_104919033_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_919_104919033_qa_4/task.toml b/tasks/0104_919_104919033_qa_4/task.toml index e1feffea235581a099f5d4b6eda884ed9f424481..505c46266c31227e05f4a04478c5c5470a2f3c34 100644 --- a/tasks/0104_919_104919033_qa_4/task.toml +++ b/tasks/0104_919_104919033_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_947_104947882_qa_3/environment/bootstrap.sh b/tasks/0104_947_104947882_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_947_104947882_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_947_104947882_qa_3/environment/pull_bucket.py b/tasks/0104_947_104947882_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_947_104947882_qa_3/environment/pull_bucket.py +++ b/tasks/0104_947_104947882_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_947_104947882_qa_3/task.toml b/tasks/0104_947_104947882_qa_3/task.toml index 2e67c22f361a7b482ab782da2e084abbc1c79da4..66e4ac8dc12a100d93b8b798799176d4c0be301a 100644 --- a/tasks/0104_947_104947882_qa_3/task.toml +++ b/tasks/0104_947_104947882_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_955_104955589_qa_3/environment/bootstrap.sh b/tasks/0104_955_104955589_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_955_104955589_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_955_104955589_qa_3/environment/pull_bucket.py b/tasks/0104_955_104955589_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_955_104955589_qa_3/environment/pull_bucket.py +++ b/tasks/0104_955_104955589_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_955_104955589_qa_3/task.toml b/tasks/0104_955_104955589_qa_3/task.toml index c815185689c094dd3fa4405c64e020c87f500927..efa46b63685111b9bfae2ba4fd3a416ca31f2611 100644 --- a/tasks/0104_955_104955589_qa_3/task.toml +++ b/tasks/0104_955_104955589_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_955_104955589_qa_5/environment/bootstrap.sh b/tasks/0104_955_104955589_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_955_104955589_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_955_104955589_qa_5/environment/pull_bucket.py b/tasks/0104_955_104955589_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_955_104955589_qa_5/environment/pull_bucket.py +++ b/tasks/0104_955_104955589_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_955_104955589_qa_5/task.toml b/tasks/0104_955_104955589_qa_5/task.toml index edb6181693fd216ad49eb150a9fb0f829bd459da..9f27fa3de5d4fc95efa45a801ffad7042290adef 100644 --- a/tasks/0104_955_104955589_qa_5/task.toml +++ b/tasks/0104_955_104955589_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_975_104975340_qa_4/environment/bootstrap.sh b/tasks/0104_975_104975340_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_975_104975340_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_975_104975340_qa_4/environment/pull_bucket.py b/tasks/0104_975_104975340_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_975_104975340_qa_4/environment/pull_bucket.py +++ b/tasks/0104_975_104975340_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_975_104975340_qa_4/task.toml b/tasks/0104_975_104975340_qa_4/task.toml index fc3a2eb50d48cd15a689b2d6179a2a876c947abe..069959d2cf6740c52f0e4066e34b5a0a00bd94b2 100644 --- a/tasks/0104_975_104975340_qa_4/task.toml +++ b/tasks/0104_975_104975340_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_975_104975438_qa_3/environment/bootstrap.sh b/tasks/0104_975_104975438_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_975_104975438_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_975_104975438_qa_3/environment/pull_bucket.py b/tasks/0104_975_104975438_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_975_104975438_qa_3/environment/pull_bucket.py +++ b/tasks/0104_975_104975438_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_975_104975438_qa_3/task.toml b/tasks/0104_975_104975438_qa_3/task.toml index 34ec234c3452d343bef51e346af8d3b510f9032f..25b67e5a5217e2ef8f41d557ab689e8312bb09ea 100644 --- a/tasks/0104_975_104975438_qa_3/task.toml +++ b/tasks/0104_975_104975438_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_985_104985612_qa_1/environment/bootstrap.sh b/tasks/0104_985_104985612_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_985_104985612_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_985_104985612_qa_1/environment/pull_bucket.py b/tasks/0104_985_104985612_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_985_104985612_qa_1/environment/pull_bucket.py +++ b/tasks/0104_985_104985612_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_985_104985612_qa_1/task.toml b/tasks/0104_985_104985612_qa_1/task.toml index 1fe5447ced895657a299408121486beb62af0b7a..0dcf996bd5d05bb947ad385a8eb0de3d1420cf88 100644 --- a/tasks/0104_985_104985612_qa_1/task.toml +++ b/tasks/0104_985_104985612_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_985_104985612_qa_4/environment/bootstrap.sh b/tasks/0104_985_104985612_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_985_104985612_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_985_104985612_qa_4/environment/pull_bucket.py b/tasks/0104_985_104985612_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_985_104985612_qa_4/environment/pull_bucket.py +++ b/tasks/0104_985_104985612_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_985_104985612_qa_4/task.toml b/tasks/0104_985_104985612_qa_4/task.toml index 78d50c60d1d5305e7aa341aa19278eee417fd17b..9e3fd8731b838d4b409acdd86293a9bee4cbd4db 100644 --- a/tasks/0104_985_104985612_qa_4/task.toml +++ b/tasks/0104_985_104985612_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0104_985_104985612_qa_5/environment/bootstrap.sh b/tasks/0104_985_104985612_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0104_985_104985612_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0104_985_104985612_qa_5/environment/pull_bucket.py b/tasks/0104_985_104985612_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0104_985_104985612_qa_5/environment/pull_bucket.py +++ b/tasks/0104_985_104985612_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0104_985_104985612_qa_5/task.toml b/tasks/0104_985_104985612_qa_5/task.toml index 1db07225684ff3e0558b2cfc8fe9acdd8685f79e..0c4ca88d0c3e325d6ed91c1f6b19032b95e271fc 100644 --- a/tasks/0104_985_104985612_qa_5/task.toml +++ b/tasks/0104_985_104985612_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_052_105052091_qa_1/environment/bootstrap.sh b/tasks/0105_052_105052091_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_052_105052091_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_052_105052091_qa_1/environment/pull_bucket.py b/tasks/0105_052_105052091_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_052_105052091_qa_1/environment/pull_bucket.py +++ b/tasks/0105_052_105052091_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_052_105052091_qa_1/task.toml b/tasks/0105_052_105052091_qa_1/task.toml index 5171edc48b9a3903fd0a8441bb29605f0f225865..d5fef93852d1fb4fd5940eb9a099244a04baa2be 100644 --- a/tasks/0105_052_105052091_qa_1/task.toml +++ b/tasks/0105_052_105052091_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_052_105052091_qa_2/environment/bootstrap.sh b/tasks/0105_052_105052091_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_052_105052091_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_052_105052091_qa_2/environment/pull_bucket.py b/tasks/0105_052_105052091_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_052_105052091_qa_2/environment/pull_bucket.py +++ b/tasks/0105_052_105052091_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_052_105052091_qa_2/task.toml b/tasks/0105_052_105052091_qa_2/task.toml index 24e5209716d1a4dc605e1f7cdadf24d90b54d59a..7bdb92c887086c4e0c80269216bba154b43c9fc2 100644 --- a/tasks/0105_052_105052091_qa_2/task.toml +++ b/tasks/0105_052_105052091_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_054_105054048_qa_1/environment/bootstrap.sh b/tasks/0105_054_105054048_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_054_105054048_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_054_105054048_qa_1/environment/pull_bucket.py b/tasks/0105_054_105054048_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_054_105054048_qa_1/environment/pull_bucket.py +++ b/tasks/0105_054_105054048_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_054_105054048_qa_1/task.toml b/tasks/0105_054_105054048_qa_1/task.toml index c76e06391d5e7aed01cbda1cc01976041d800dca..65ae1e92dd1508f4538d8cd686e9272d8ed3f874 100644 --- a/tasks/0105_054_105054048_qa_1/task.toml +++ b/tasks/0105_054_105054048_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_054_105054048_qa_4/environment/bootstrap.sh b/tasks/0105_054_105054048_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_054_105054048_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_054_105054048_qa_4/environment/pull_bucket.py b/tasks/0105_054_105054048_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_054_105054048_qa_4/environment/pull_bucket.py +++ b/tasks/0105_054_105054048_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_054_105054048_qa_4/task.toml b/tasks/0105_054_105054048_qa_4/task.toml index f0c85b7474f4f0fb9cd2971a791278e4e2e0e1f5..ba8532145d44d19d74c7619fc0870a10c214b20a 100644 --- a/tasks/0105_054_105054048_qa_4/task.toml +++ b/tasks/0105_054_105054048_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_059_105059592_qa_1/environment/bootstrap.sh b/tasks/0105_059_105059592_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_059_105059592_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_059_105059592_qa_1/environment/pull_bucket.py b/tasks/0105_059_105059592_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_059_105059592_qa_1/environment/pull_bucket.py +++ b/tasks/0105_059_105059592_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_059_105059592_qa_1/task.toml b/tasks/0105_059_105059592_qa_1/task.toml index 97e0674c1a61259d9a4af344f4194aaa67ea416e..281b1adf2339e5ec3d27636ce3aa9cb8291fb929 100644 --- a/tasks/0105_059_105059592_qa_1/task.toml +++ b/tasks/0105_059_105059592_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_059_105059592_qa_2/environment/bootstrap.sh b/tasks/0105_059_105059592_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_059_105059592_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_059_105059592_qa_2/environment/pull_bucket.py b/tasks/0105_059_105059592_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_059_105059592_qa_2/environment/pull_bucket.py +++ b/tasks/0105_059_105059592_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_059_105059592_qa_2/task.toml b/tasks/0105_059_105059592_qa_2/task.toml index 793f924ffb2e174725f068b45d5569390c929079..3f7f2ce38142c71ad4f5afdc4118454ba8bb06e5 100644 --- a/tasks/0105_059_105059592_qa_2/task.toml +++ b/tasks/0105_059_105059592_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_059_105059592_qa_3/environment/bootstrap.sh b/tasks/0105_059_105059592_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_059_105059592_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_059_105059592_qa_3/environment/pull_bucket.py b/tasks/0105_059_105059592_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_059_105059592_qa_3/environment/pull_bucket.py +++ b/tasks/0105_059_105059592_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_059_105059592_qa_3/task.toml b/tasks/0105_059_105059592_qa_3/task.toml index adad690a1b882ab1107190fbd799044ce9491ccd..c048385845ba028c1cd44ad5f20176711bc1eb1d 100644 --- a/tasks/0105_059_105059592_qa_3/task.toml +++ b/tasks/0105_059_105059592_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_059_105059592_qa_4/environment/bootstrap.sh b/tasks/0105_059_105059592_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_059_105059592_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_059_105059592_qa_4/environment/pull_bucket.py b/tasks/0105_059_105059592_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_059_105059592_qa_4/environment/pull_bucket.py +++ b/tasks/0105_059_105059592_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_059_105059592_qa_4/task.toml b/tasks/0105_059_105059592_qa_4/task.toml index 31852afd69665f4002d430f7bfaaf548f6308714..22cd3fa0268e1c9a86ec119a0be98b66567a2b92 100644 --- a/tasks/0105_059_105059592_qa_4/task.toml +++ b/tasks/0105_059_105059592_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_059_105059592_qa_5/environment/bootstrap.sh b/tasks/0105_059_105059592_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_059_105059592_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_059_105059592_qa_5/environment/pull_bucket.py b/tasks/0105_059_105059592_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_059_105059592_qa_5/environment/pull_bucket.py +++ b/tasks/0105_059_105059592_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_059_105059592_qa_5/task.toml b/tasks/0105_059_105059592_qa_5/task.toml index 3b7ef82290177e69c883b1b3b99e3b294704ab4c..e0a24ccea54562c6ac252a0fb02a1a1ad3469f36 100644 --- a/tasks/0105_059_105059592_qa_5/task.toml +++ b/tasks/0105_059_105059592_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_060_105060710_qa_5/environment/bootstrap.sh b/tasks/0105_060_105060710_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_060_105060710_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_060_105060710_qa_5/environment/pull_bucket.py b/tasks/0105_060_105060710_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_060_105060710_qa_5/environment/pull_bucket.py +++ b/tasks/0105_060_105060710_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_060_105060710_qa_5/task.toml b/tasks/0105_060_105060710_qa_5/task.toml index ba852a335313598011b8fbc5283ebe625fb07c5a..2223f005caa7a9fd30ba632664937d65c9cbd397 100644 --- a/tasks/0105_060_105060710_qa_5/task.toml +++ b/tasks/0105_060_105060710_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_079_105079385_qa_4/environment/bootstrap.sh b/tasks/0105_079_105079385_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_079_105079385_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_079_105079385_qa_4/environment/pull_bucket.py b/tasks/0105_079_105079385_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_079_105079385_qa_4/environment/pull_bucket.py +++ b/tasks/0105_079_105079385_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_079_105079385_qa_4/task.toml b/tasks/0105_079_105079385_qa_4/task.toml index 4a3461e1c9a97f0de9b6c16ff6f2ea1500122948..3c935f413528aa1dc557a83d5ae094f9b13b16a0 100644 --- a/tasks/0105_079_105079385_qa_4/task.toml +++ b/tasks/0105_079_105079385_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_115_105115907_qa_1/environment/bootstrap.sh b/tasks/0105_115_105115907_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_115_105115907_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_115_105115907_qa_1/environment/pull_bucket.py b/tasks/0105_115_105115907_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_115_105115907_qa_1/environment/pull_bucket.py +++ b/tasks/0105_115_105115907_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_115_105115907_qa_1/task.toml b/tasks/0105_115_105115907_qa_1/task.toml index c4ea5b029e797af765b2c963421ee2c3c936339e..b89a3ced7617bd020f82a068894326e5268de33a 100644 --- a/tasks/0105_115_105115907_qa_1/task.toml +++ b/tasks/0105_115_105115907_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_131_105131890_qa_1/environment/bootstrap.sh b/tasks/0105_131_105131890_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_131_105131890_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_131_105131890_qa_1/environment/pull_bucket.py b/tasks/0105_131_105131890_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_131_105131890_qa_1/environment/pull_bucket.py +++ b/tasks/0105_131_105131890_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_131_105131890_qa_1/task.toml b/tasks/0105_131_105131890_qa_1/task.toml index 57a5ceaea33033bea567f603cbe4df8890a0dcaf..dbff3ec8bd6732a1be200c5aef13ae31f8ff922d 100644 --- a/tasks/0105_131_105131890_qa_1/task.toml +++ b/tasks/0105_131_105131890_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_131_105131890_qa_4/environment/bootstrap.sh b/tasks/0105_131_105131890_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_131_105131890_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_131_105131890_qa_4/environment/pull_bucket.py b/tasks/0105_131_105131890_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_131_105131890_qa_4/environment/pull_bucket.py +++ b/tasks/0105_131_105131890_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_131_105131890_qa_4/task.toml b/tasks/0105_131_105131890_qa_4/task.toml index 492f3ae747fb63047b5d4bd8aee675c3cd9ca78b..b118e3ce384dff93b3c9abddc32be1eff6aadee1 100644 --- a/tasks/0105_131_105131890_qa_4/task.toml +++ b/tasks/0105_131_105131890_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_135_105135715_qa_3/environment/bootstrap.sh b/tasks/0105_135_105135715_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_135_105135715_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_135_105135715_qa_3/environment/pull_bucket.py b/tasks/0105_135_105135715_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_135_105135715_qa_3/environment/pull_bucket.py +++ b/tasks/0105_135_105135715_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_135_105135715_qa_3/task.toml b/tasks/0105_135_105135715_qa_3/task.toml index 9ffe12dc34a12c1cd82f6449673bdc1fd1a74af4..1bcdbd516054b16c221f890fd27d1aac5f58488c 100644 --- a/tasks/0105_135_105135715_qa_3/task.toml +++ b/tasks/0105_135_105135715_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_159_105159869_qa_5/environment/bootstrap.sh b/tasks/0105_159_105159869_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_159_105159869_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_159_105159869_qa_5/environment/pull_bucket.py b/tasks/0105_159_105159869_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_159_105159869_qa_5/environment/pull_bucket.py +++ b/tasks/0105_159_105159869_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_159_105159869_qa_5/task.toml b/tasks/0105_159_105159869_qa_5/task.toml index 17140520930168ca5c018fb10225fe9faca15ada..09ac7ea40cd1f79f4a38f5fbe73e67a0b2992e71 100644 --- a/tasks/0105_159_105159869_qa_5/task.toml +++ b/tasks/0105_159_105159869_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_167_105167491_qa_2/environment/bootstrap.sh b/tasks/0105_167_105167491_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_167_105167491_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_167_105167491_qa_2/environment/pull_bucket.py b/tasks/0105_167_105167491_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_167_105167491_qa_2/environment/pull_bucket.py +++ b/tasks/0105_167_105167491_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_167_105167491_qa_2/task.toml b/tasks/0105_167_105167491_qa_2/task.toml index e128edadc46233eac52cc9cf3f8bb5f47b00fe0e..7dde091f8d428c254e23970fb99ef83790b8e2a1 100644 --- a/tasks/0105_167_105167491_qa_2/task.toml +++ b/tasks/0105_167_105167491_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_167_105167491_qa_3/environment/bootstrap.sh b/tasks/0105_167_105167491_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_167_105167491_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_167_105167491_qa_3/environment/pull_bucket.py b/tasks/0105_167_105167491_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_167_105167491_qa_3/environment/pull_bucket.py +++ b/tasks/0105_167_105167491_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_167_105167491_qa_3/task.toml b/tasks/0105_167_105167491_qa_3/task.toml index 788f5443eeca48d61601d40773051b9295a199fc..dc421d675b181780903642fa91ca8869b5579394 100644 --- a/tasks/0105_167_105167491_qa_3/task.toml +++ b/tasks/0105_167_105167491_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_301_105301672_qa_2/environment/bootstrap.sh b/tasks/0105_301_105301672_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_301_105301672_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_301_105301672_qa_2/environment/pull_bucket.py b/tasks/0105_301_105301672_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_301_105301672_qa_2/environment/pull_bucket.py +++ b/tasks/0105_301_105301672_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_301_105301672_qa_2/task.toml b/tasks/0105_301_105301672_qa_2/task.toml index e8f4f1f5a4d714cd323b4f6ee7b51c22cab60b52..20f7b44bbecd84f01eff46a07aa17806b0028ccc 100644 --- a/tasks/0105_301_105301672_qa_2/task.toml +++ b/tasks/0105_301_105301672_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_332_105332394_qa_3/environment/bootstrap.sh b/tasks/0105_332_105332394_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_332_105332394_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_332_105332394_qa_3/environment/pull_bucket.py b/tasks/0105_332_105332394_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_332_105332394_qa_3/environment/pull_bucket.py +++ b/tasks/0105_332_105332394_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_332_105332394_qa_3/task.toml b/tasks/0105_332_105332394_qa_3/task.toml index 239016bbeae5b4d577975863da243db39c406af3..f2650ccbfd6ead21a3a7c8d9dddbb28bc5ab26fc 100644 --- a/tasks/0105_332_105332394_qa_3/task.toml +++ b/tasks/0105_332_105332394_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_332_105332394_qa_5/environment/bootstrap.sh b/tasks/0105_332_105332394_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_332_105332394_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_332_105332394_qa_5/environment/pull_bucket.py b/tasks/0105_332_105332394_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_332_105332394_qa_5/environment/pull_bucket.py +++ b/tasks/0105_332_105332394_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_332_105332394_qa_5/task.toml b/tasks/0105_332_105332394_qa_5/task.toml index 07ce49de9ccdea493d4756f261ed2c49b7364f01..a785e05ca60740e807ba88dd1f067a66cc6eea66 100644 --- a/tasks/0105_332_105332394_qa_5/task.toml +++ b/tasks/0105_332_105332394_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_388_105388778_qa_3/environment/bootstrap.sh b/tasks/0105_388_105388778_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_388_105388778_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_388_105388778_qa_3/environment/pull_bucket.py b/tasks/0105_388_105388778_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_388_105388778_qa_3/environment/pull_bucket.py +++ b/tasks/0105_388_105388778_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_388_105388778_qa_3/task.toml b/tasks/0105_388_105388778_qa_3/task.toml index e41e779424967439bcf99cf49ab59fe4ff8db756..fbaa07e3bb0449ad308779e5d4ae4f77d3effbe8 100644 --- a/tasks/0105_388_105388778_qa_3/task.toml +++ b/tasks/0105_388_105388778_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_422_105422995_qa_1/environment/bootstrap.sh b/tasks/0105_422_105422995_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_422_105422995_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_422_105422995_qa_1/environment/pull_bucket.py b/tasks/0105_422_105422995_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_422_105422995_qa_1/environment/pull_bucket.py +++ b/tasks/0105_422_105422995_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_422_105422995_qa_1/task.toml b/tasks/0105_422_105422995_qa_1/task.toml index 34a26ea2fbb3a2fc44060e5bbb8af21b2ac08f5b..dccdf545f2d7560e76dc5a0ccba963373757214b 100644 --- a/tasks/0105_422_105422995_qa_1/task.toml +++ b/tasks/0105_422_105422995_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_422_105422995_qa_2/environment/bootstrap.sh b/tasks/0105_422_105422995_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_422_105422995_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_422_105422995_qa_2/environment/pull_bucket.py b/tasks/0105_422_105422995_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_422_105422995_qa_2/environment/pull_bucket.py +++ b/tasks/0105_422_105422995_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_422_105422995_qa_2/task.toml b/tasks/0105_422_105422995_qa_2/task.toml index 32a5911734483c3443b95671db102cb6af698605..8eb522dc48675039a7e3eb1e61bcc439a475f725 100644 --- a/tasks/0105_422_105422995_qa_2/task.toml +++ b/tasks/0105_422_105422995_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_477_105477138_qa_1/environment/bootstrap.sh b/tasks/0105_477_105477138_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_477_105477138_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_477_105477138_qa_1/environment/pull_bucket.py b/tasks/0105_477_105477138_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_477_105477138_qa_1/environment/pull_bucket.py +++ b/tasks/0105_477_105477138_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_477_105477138_qa_1/task.toml b/tasks/0105_477_105477138_qa_1/task.toml index 27eef4ec326ab5b1a12a4696806defd9e18636b3..80b8fd7a3864b260f9f30e33e9f23ff2e88b8fa8 100644 --- a/tasks/0105_477_105477138_qa_1/task.toml +++ b/tasks/0105_477_105477138_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_477_105477138_qa_3/environment/bootstrap.sh b/tasks/0105_477_105477138_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_477_105477138_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_477_105477138_qa_3/environment/pull_bucket.py b/tasks/0105_477_105477138_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_477_105477138_qa_3/environment/pull_bucket.py +++ b/tasks/0105_477_105477138_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_477_105477138_qa_3/task.toml b/tasks/0105_477_105477138_qa_3/task.toml index 512537c9f9bb95c26471bb72e8a01a3499080bfb..48bc1747b2b0848cad6e63c64d9f49eeedece1a0 100644 --- a/tasks/0105_477_105477138_qa_3/task.toml +++ b/tasks/0105_477_105477138_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_478_105478002_qa_1/environment/bootstrap.sh b/tasks/0105_478_105478002_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_478_105478002_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_478_105478002_qa_1/environment/pull_bucket.py b/tasks/0105_478_105478002_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_478_105478002_qa_1/environment/pull_bucket.py +++ b/tasks/0105_478_105478002_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_478_105478002_qa_1/task.toml b/tasks/0105_478_105478002_qa_1/task.toml index f347d4a0bd7d5a7af281d280eae46b48cdb50e69..9545fdc6b8072995cf4a1715d33a04c677e200a1 100644 --- a/tasks/0105_478_105478002_qa_1/task.toml +++ b/tasks/0105_478_105478002_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_478_105478002_qa_5/environment/bootstrap.sh b/tasks/0105_478_105478002_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_478_105478002_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_478_105478002_qa_5/environment/pull_bucket.py b/tasks/0105_478_105478002_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_478_105478002_qa_5/environment/pull_bucket.py +++ b/tasks/0105_478_105478002_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_478_105478002_qa_5/task.toml b/tasks/0105_478_105478002_qa_5/task.toml index fae15fdf70eb1972bcf5bf851dee2c8aa1784d8f..a22d1bf9e2f85972c8458937a9456a80079446c2 100644 --- a/tasks/0105_478_105478002_qa_5/task.toml +++ b/tasks/0105_478_105478002_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_488_105488572_qa_2/environment/bootstrap.sh b/tasks/0105_488_105488572_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_488_105488572_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_488_105488572_qa_2/environment/pull_bucket.py b/tasks/0105_488_105488572_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_488_105488572_qa_2/environment/pull_bucket.py +++ b/tasks/0105_488_105488572_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_488_105488572_qa_2/task.toml b/tasks/0105_488_105488572_qa_2/task.toml index 892592e3753681d49e92bd1aa70fc9cc82138d80..96754c2cedb874daf01f556b9521f186c53dcd1f 100644 --- a/tasks/0105_488_105488572_qa_2/task.toml +++ b/tasks/0105_488_105488572_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_488_105488572_qa_4/environment/bootstrap.sh b/tasks/0105_488_105488572_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_488_105488572_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_488_105488572_qa_4/environment/pull_bucket.py b/tasks/0105_488_105488572_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_488_105488572_qa_4/environment/pull_bucket.py +++ b/tasks/0105_488_105488572_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_488_105488572_qa_4/task.toml b/tasks/0105_488_105488572_qa_4/task.toml index f51f0b520edf7c4a7f79613e52fcddfaafff27cb..492a153c632ab3a619e191452ad101627d16edb5 100644 --- a/tasks/0105_488_105488572_qa_4/task.toml +++ b/tasks/0105_488_105488572_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_606_105606583_qa_2/environment/bootstrap.sh b/tasks/0105_606_105606583_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_606_105606583_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_606_105606583_qa_2/environment/pull_bucket.py b/tasks/0105_606_105606583_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_606_105606583_qa_2/environment/pull_bucket.py +++ b/tasks/0105_606_105606583_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_606_105606583_qa_2/task.toml b/tasks/0105_606_105606583_qa_2/task.toml index 7e699c880f7b299f885fb88fb216efcda24c0391..366aba97351b062c5866440f22c1d9db37ee5c3b 100644 --- a/tasks/0105_606_105606583_qa_2/task.toml +++ b/tasks/0105_606_105606583_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_684_105684857_qa_1/environment/bootstrap.sh b/tasks/0105_684_105684857_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_684_105684857_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_684_105684857_qa_1/environment/pull_bucket.py b/tasks/0105_684_105684857_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_684_105684857_qa_1/environment/pull_bucket.py +++ b/tasks/0105_684_105684857_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_684_105684857_qa_1/task.toml b/tasks/0105_684_105684857_qa_1/task.toml index f0cf8020cfaa728071b2947ed60c3d1743f3ce81..82e01b790b7e011f71e8bf12eb3469a6a495dd06 100644 --- a/tasks/0105_684_105684857_qa_1/task.toml +++ b/tasks/0105_684_105684857_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_684_105684857_qa_4/environment/bootstrap.sh b/tasks/0105_684_105684857_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_684_105684857_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_684_105684857_qa_4/environment/pull_bucket.py b/tasks/0105_684_105684857_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_684_105684857_qa_4/environment/pull_bucket.py +++ b/tasks/0105_684_105684857_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_684_105684857_qa_4/task.toml b/tasks/0105_684_105684857_qa_4/task.toml index a9e460c7b448200c9b9b5b8c66b4df81c0d11088..2892ed8a506b808b8c42898ebb3fc1f8c94dcaba 100644 --- a/tasks/0105_684_105684857_qa_4/task.toml +++ b/tasks/0105_684_105684857_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_684_105684857_qa_5/environment/bootstrap.sh b/tasks/0105_684_105684857_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_684_105684857_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_684_105684857_qa_5/environment/pull_bucket.py b/tasks/0105_684_105684857_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_684_105684857_qa_5/environment/pull_bucket.py +++ b/tasks/0105_684_105684857_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_684_105684857_qa_5/task.toml b/tasks/0105_684_105684857_qa_5/task.toml index dfcb8c240e47cac4c9b250724f641cd0b8008b76..698ab2bc58c6caf8e65d2fba479a605469da09aa 100644 --- a/tasks/0105_684_105684857_qa_5/task.toml +++ b/tasks/0105_684_105684857_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_902_105902440_qa_4/environment/bootstrap.sh b/tasks/0105_902_105902440_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_902_105902440_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_902_105902440_qa_4/environment/pull_bucket.py b/tasks/0105_902_105902440_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_902_105902440_qa_4/environment/pull_bucket.py +++ b/tasks/0105_902_105902440_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_902_105902440_qa_4/task.toml b/tasks/0105_902_105902440_qa_4/task.toml index 2443d7e8afc4f030f90e55454d8c84c753f1bd96..46e4a4c40dd8b8cd8d6f2d45d0759474f6ed2b7c 100644 --- a/tasks/0105_902_105902440_qa_4/task.toml +++ b/tasks/0105_902_105902440_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0105_972_105972682_qa_2/environment/bootstrap.sh b/tasks/0105_972_105972682_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0105_972_105972682_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0105_972_105972682_qa_2/environment/pull_bucket.py b/tasks/0105_972_105972682_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0105_972_105972682_qa_2/environment/pull_bucket.py +++ b/tasks/0105_972_105972682_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0105_972_105972682_qa_2/task.toml b/tasks/0105_972_105972682_qa_2/task.toml index 67c9e126a65b1185af2b9dcbc8120659c8019875..72088ac01a543a7f59c99fbfa8589f645ad58dae 100644 --- a/tasks/0105_972_105972682_qa_2/task.toml +++ b/tasks/0105_972_105972682_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_109_106109470_qa_2/environment/bootstrap.sh b/tasks/0106_109_106109470_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_109_106109470_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_109_106109470_qa_2/environment/pull_bucket.py b/tasks/0106_109_106109470_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_109_106109470_qa_2/environment/pull_bucket.py +++ b/tasks/0106_109_106109470_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_109_106109470_qa_2/task.toml b/tasks/0106_109_106109470_qa_2/task.toml index 35f31277182f35afb5245f365e715dda20d0ae48..1f3e4ed3fae36cb609d6fb25fc340d6b59ad4b77 100644 --- a/tasks/0106_109_106109470_qa_2/task.toml +++ b/tasks/0106_109_106109470_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_112_106112212_qa_5/environment/bootstrap.sh b/tasks/0106_112_106112212_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_112_106112212_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_112_106112212_qa_5/environment/pull_bucket.py b/tasks/0106_112_106112212_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_112_106112212_qa_5/environment/pull_bucket.py +++ b/tasks/0106_112_106112212_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_112_106112212_qa_5/task.toml b/tasks/0106_112_106112212_qa_5/task.toml index 7cb417b30e5692ebf4c6a229bc48c65b385be52d..7821f9a4b73bef727032237570cca1397c1fcbea 100644 --- a/tasks/0106_112_106112212_qa_5/task.toml +++ b/tasks/0106_112_106112212_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_208_106208028_qa_1/environment/bootstrap.sh b/tasks/0106_208_106208028_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_208_106208028_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_208_106208028_qa_1/environment/pull_bucket.py b/tasks/0106_208_106208028_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_208_106208028_qa_1/environment/pull_bucket.py +++ b/tasks/0106_208_106208028_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_208_106208028_qa_1/task.toml b/tasks/0106_208_106208028_qa_1/task.toml index 9daccbad67385ef60d6eff4dbe44ee4d2d92431f..7be45e267feec13c581c39afacd0e89e98827cd0 100644 --- a/tasks/0106_208_106208028_qa_1/task.toml +++ b/tasks/0106_208_106208028_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_229_106229633_qa_1/environment/bootstrap.sh b/tasks/0106_229_106229633_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_229_106229633_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_229_106229633_qa_1/environment/pull_bucket.py b/tasks/0106_229_106229633_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_229_106229633_qa_1/environment/pull_bucket.py +++ b/tasks/0106_229_106229633_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_229_106229633_qa_1/task.toml b/tasks/0106_229_106229633_qa_1/task.toml index d48191370c6b3dff5545d29570695416dcc4573a..6bf22d2410cf6a24d549300b409eeb3d0a763f30 100644 --- a/tasks/0106_229_106229633_qa_1/task.toml +++ b/tasks/0106_229_106229633_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_229_106229633_qa_4/environment/bootstrap.sh b/tasks/0106_229_106229633_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_229_106229633_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_229_106229633_qa_4/environment/pull_bucket.py b/tasks/0106_229_106229633_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_229_106229633_qa_4/environment/pull_bucket.py +++ b/tasks/0106_229_106229633_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_229_106229633_qa_4/task.toml b/tasks/0106_229_106229633_qa_4/task.toml index 3722e323e3b2e74a2dc70c340c265161b577b3cb..09b82f738820892cf6dead7fde6791b0107b1fd0 100644 --- a/tasks/0106_229_106229633_qa_4/task.toml +++ b/tasks/0106_229_106229633_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_348_106348843_qa_5/environment/bootstrap.sh b/tasks/0106_348_106348843_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_348_106348843_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_348_106348843_qa_5/environment/pull_bucket.py b/tasks/0106_348_106348843_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_348_106348843_qa_5/environment/pull_bucket.py +++ b/tasks/0106_348_106348843_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_348_106348843_qa_5/task.toml b/tasks/0106_348_106348843_qa_5/task.toml index 2f7f120762f10defd06fa3ae730f797e26cddbb2..809766ac30b8a64a4671e663fc0706ee9b3ad291 100644 --- a/tasks/0106_348_106348843_qa_5/task.toml +++ b/tasks/0106_348_106348843_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_400_106400337_qa_4/environment/bootstrap.sh b/tasks/0106_400_106400337_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_400_106400337_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_400_106400337_qa_4/environment/pull_bucket.py b/tasks/0106_400_106400337_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_400_106400337_qa_4/environment/pull_bucket.py +++ b/tasks/0106_400_106400337_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_400_106400337_qa_4/task.toml b/tasks/0106_400_106400337_qa_4/task.toml index 128b0a3eaa0aa7da1d1339d31dc2f515490b7d62..254ef70bc8cc1f3aba3b3ccaa567cbc63195f506 100644 --- a/tasks/0106_400_106400337_qa_4/task.toml +++ b/tasks/0106_400_106400337_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_409_106409576_qa_3/environment/bootstrap.sh b/tasks/0106_409_106409576_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_409_106409576_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_409_106409576_qa_3/environment/pull_bucket.py b/tasks/0106_409_106409576_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_409_106409576_qa_3/environment/pull_bucket.py +++ b/tasks/0106_409_106409576_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_409_106409576_qa_3/task.toml b/tasks/0106_409_106409576_qa_3/task.toml index 17836b74adb6890a1d64c2c050e0cc8d379b6775..864616ee34345fbd0c3a41f762323a9747c78254 100644 --- a/tasks/0106_409_106409576_qa_3/task.toml +++ b/tasks/0106_409_106409576_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_414_106414508_qa_1/environment/bootstrap.sh b/tasks/0106_414_106414508_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_414_106414508_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_414_106414508_qa_1/environment/pull_bucket.py b/tasks/0106_414_106414508_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_414_106414508_qa_1/environment/pull_bucket.py +++ b/tasks/0106_414_106414508_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_414_106414508_qa_1/task.toml b/tasks/0106_414_106414508_qa_1/task.toml index de33d706754dff833201735126f821c32870a470..54418b597df488db30e2c83da92a772e9d5991d1 100644 --- a/tasks/0106_414_106414508_qa_1/task.toml +++ b/tasks/0106_414_106414508_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_414_106414508_qa_5/environment/bootstrap.sh b/tasks/0106_414_106414508_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_414_106414508_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_414_106414508_qa_5/environment/pull_bucket.py b/tasks/0106_414_106414508_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_414_106414508_qa_5/environment/pull_bucket.py +++ b/tasks/0106_414_106414508_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_414_106414508_qa_5/task.toml b/tasks/0106_414_106414508_qa_5/task.toml index e6f453c53c5adb6c352f983e02c3c5850696465a..00a3106d8242d2b084ff4ced29803ced6524bf11 100644 --- a/tasks/0106_414_106414508_qa_5/task.toml +++ b/tasks/0106_414_106414508_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_416_106416910_qa_1/environment/bootstrap.sh b/tasks/0106_416_106416910_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_416_106416910_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_416_106416910_qa_1/environment/pull_bucket.py b/tasks/0106_416_106416910_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_416_106416910_qa_1/environment/pull_bucket.py +++ b/tasks/0106_416_106416910_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_416_106416910_qa_1/task.toml b/tasks/0106_416_106416910_qa_1/task.toml index 82a59d172bba48d182f4abbca7e39fdada7a90f5..4aa38ebddec3e422bd9b6f2b3f8d53e0a9478e0c 100644 --- a/tasks/0106_416_106416910_qa_1/task.toml +++ b/tasks/0106_416_106416910_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_417_106417043_qa_2/environment/bootstrap.sh b/tasks/0106_417_106417043_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_417_106417043_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_417_106417043_qa_2/environment/pull_bucket.py b/tasks/0106_417_106417043_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_417_106417043_qa_2/environment/pull_bucket.py +++ b/tasks/0106_417_106417043_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_417_106417043_qa_2/task.toml b/tasks/0106_417_106417043_qa_2/task.toml index 03279b3afcb9d0f5d99762765bd621dd76bbf41d..4808673d054549067932677673e1b93a80f78d6e 100644 --- a/tasks/0106_417_106417043_qa_2/task.toml +++ b/tasks/0106_417_106417043_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_477_106477503_qa_1/environment/bootstrap.sh b/tasks/0106_477_106477503_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_477_106477503_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_477_106477503_qa_1/environment/pull_bucket.py b/tasks/0106_477_106477503_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_477_106477503_qa_1/environment/pull_bucket.py +++ b/tasks/0106_477_106477503_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_477_106477503_qa_1/task.toml b/tasks/0106_477_106477503_qa_1/task.toml index a6b11429d9f50fad3ad59807d827ef58da73068b..ccca736ca14821092d4e259c6bd7b7bc6f0d1016 100644 --- a/tasks/0106_477_106477503_qa_1/task.toml +++ b/tasks/0106_477_106477503_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_477_106477503_qa_2/environment/bootstrap.sh b/tasks/0106_477_106477503_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_477_106477503_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_477_106477503_qa_2/environment/pull_bucket.py b/tasks/0106_477_106477503_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_477_106477503_qa_2/environment/pull_bucket.py +++ b/tasks/0106_477_106477503_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_477_106477503_qa_2/task.toml b/tasks/0106_477_106477503_qa_2/task.toml index 91ef32acd6e960cefab2a3ff7d5da0dbb8ec6474..66e5abd59977ada35185fea611baf9d2fc02837b 100644 --- a/tasks/0106_477_106477503_qa_2/task.toml +++ b/tasks/0106_477_106477503_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_477_106477503_qa_3/environment/bootstrap.sh b/tasks/0106_477_106477503_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_477_106477503_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_477_106477503_qa_3/environment/pull_bucket.py b/tasks/0106_477_106477503_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_477_106477503_qa_3/environment/pull_bucket.py +++ b/tasks/0106_477_106477503_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_477_106477503_qa_3/task.toml b/tasks/0106_477_106477503_qa_3/task.toml index c04cc4f511a1fbd5e47deb176bfe7bf71db144cc..87018d7f0ed99d73295e341bcf22a76acf2293dd 100644 --- a/tasks/0106_477_106477503_qa_3/task.toml +++ b/tasks/0106_477_106477503_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_477_106477503_qa_4/environment/bootstrap.sh b/tasks/0106_477_106477503_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_477_106477503_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_477_106477503_qa_4/environment/pull_bucket.py b/tasks/0106_477_106477503_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_477_106477503_qa_4/environment/pull_bucket.py +++ b/tasks/0106_477_106477503_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_477_106477503_qa_4/task.toml b/tasks/0106_477_106477503_qa_4/task.toml index 9ef6b6001f735381a2198f97ab50917df154ddfd..68a84285d3b4a3db8cb2434c3955f150b5917a71 100644 --- a/tasks/0106_477_106477503_qa_4/task.toml +++ b/tasks/0106_477_106477503_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_481_106481442_qa_3/environment/bootstrap.sh b/tasks/0106_481_106481442_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_481_106481442_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_481_106481442_qa_3/environment/pull_bucket.py b/tasks/0106_481_106481442_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_481_106481442_qa_3/environment/pull_bucket.py +++ b/tasks/0106_481_106481442_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_481_106481442_qa_3/task.toml b/tasks/0106_481_106481442_qa_3/task.toml index b36d1db5107a2e0c49976fcc77c3fecdb339a153..3e2b9f745c79a3a0939df085507016feab2657c3 100644 --- a/tasks/0106_481_106481442_qa_3/task.toml +++ b/tasks/0106_481_106481442_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_490_106490644_qa_3/environment/bootstrap.sh b/tasks/0106_490_106490644_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_490_106490644_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_490_106490644_qa_3/environment/pull_bucket.py b/tasks/0106_490_106490644_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_490_106490644_qa_3/environment/pull_bucket.py +++ b/tasks/0106_490_106490644_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_490_106490644_qa_3/task.toml b/tasks/0106_490_106490644_qa_3/task.toml index c2d15eb246f26176c6c77ff0720ad8f3e10f1189..9f1d09f2896a2e5218f55765599f26536d9c6654 100644 --- a/tasks/0106_490_106490644_qa_3/task.toml +++ b/tasks/0106_490_106490644_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_499_106499132_qa_1/environment/bootstrap.sh b/tasks/0106_499_106499132_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_499_106499132_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_499_106499132_qa_1/environment/pull_bucket.py b/tasks/0106_499_106499132_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_499_106499132_qa_1/environment/pull_bucket.py +++ b/tasks/0106_499_106499132_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_499_106499132_qa_1/task.toml b/tasks/0106_499_106499132_qa_1/task.toml index e0bf7c4b7f6fbd27adbdf31bcfe0d3d3844d56c4..e7da61bf7df56e2cbe918a28af74b7e397828e91 100644 --- a/tasks/0106_499_106499132_qa_1/task.toml +++ b/tasks/0106_499_106499132_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_528_106528652_qa_1/environment/bootstrap.sh b/tasks/0106_528_106528652_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_528_106528652_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_528_106528652_qa_1/environment/pull_bucket.py b/tasks/0106_528_106528652_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_528_106528652_qa_1/environment/pull_bucket.py +++ b/tasks/0106_528_106528652_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_528_106528652_qa_1/task.toml b/tasks/0106_528_106528652_qa_1/task.toml index 622e67bb9700368c47ccbf3db9d9e37c5bf2940f..bc1f4bc37a6aead7c6d6aa2bb91f89fb3d8359dc 100644 --- a/tasks/0106_528_106528652_qa_1/task.toml +++ b/tasks/0106_528_106528652_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_531_106531731_qa_5/environment/bootstrap.sh b/tasks/0106_531_106531731_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_531_106531731_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_531_106531731_qa_5/environment/pull_bucket.py b/tasks/0106_531_106531731_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_531_106531731_qa_5/environment/pull_bucket.py +++ b/tasks/0106_531_106531731_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_531_106531731_qa_5/task.toml b/tasks/0106_531_106531731_qa_5/task.toml index a0d9f5fe26a7ddaa3abcdc456acfe2b9099df0ec..98652206b8f94a31c62ee914e8930522c7dc7862 100644 --- a/tasks/0106_531_106531731_qa_5/task.toml +++ b/tasks/0106_531_106531731_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_598_106598107_qa_5/environment/bootstrap.sh b/tasks/0106_598_106598107_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_598_106598107_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_598_106598107_qa_5/environment/pull_bucket.py b/tasks/0106_598_106598107_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_598_106598107_qa_5/environment/pull_bucket.py +++ b/tasks/0106_598_106598107_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_598_106598107_qa_5/task.toml b/tasks/0106_598_106598107_qa_5/task.toml index 700f4379ff195339cb43491e8458798a1e5c32e2..c24c389e76940e4512908e92142ba8a2ee25229b 100644 --- a/tasks/0106_598_106598107_qa_5/task.toml +++ b/tasks/0106_598_106598107_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_674_106674377_qa_1/environment/bootstrap.sh b/tasks/0106_674_106674377_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_674_106674377_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_674_106674377_qa_1/environment/pull_bucket.py b/tasks/0106_674_106674377_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_674_106674377_qa_1/environment/pull_bucket.py +++ b/tasks/0106_674_106674377_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_674_106674377_qa_1/task.toml b/tasks/0106_674_106674377_qa_1/task.toml index f11a874ee171f0da7d436b0f477558a0781dbf40..9237a99f362940bf83ec02917779edbb301ad26b 100644 --- a/tasks/0106_674_106674377_qa_1/task.toml +++ b/tasks/0106_674_106674377_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_674_106674377_qa_2/environment/bootstrap.sh b/tasks/0106_674_106674377_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_674_106674377_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_674_106674377_qa_2/environment/pull_bucket.py b/tasks/0106_674_106674377_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_674_106674377_qa_2/environment/pull_bucket.py +++ b/tasks/0106_674_106674377_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_674_106674377_qa_2/task.toml b/tasks/0106_674_106674377_qa_2/task.toml index bcf63856db86a42d2c7190e94a7615962cdbd8bf..f6e31912dd30bf1aec5102e0534182fe4effcff4 100644 --- a/tasks/0106_674_106674377_qa_2/task.toml +++ b/tasks/0106_674_106674377_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_834_106834319_qa_1/environment/bootstrap.sh b/tasks/0106_834_106834319_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_834_106834319_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_834_106834319_qa_1/environment/pull_bucket.py b/tasks/0106_834_106834319_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_834_106834319_qa_1/environment/pull_bucket.py +++ b/tasks/0106_834_106834319_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_834_106834319_qa_1/task.toml b/tasks/0106_834_106834319_qa_1/task.toml index 8d5150d2b4669e1cd3c8ddd576f0b1a1d11a543d..f4c08138185a58d6c9b93eaa7790a141923a9973 100644 --- a/tasks/0106_834_106834319_qa_1/task.toml +++ b/tasks/0106_834_106834319_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_834_106834319_qa_3/environment/bootstrap.sh b/tasks/0106_834_106834319_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_834_106834319_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_834_106834319_qa_3/environment/pull_bucket.py b/tasks/0106_834_106834319_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_834_106834319_qa_3/environment/pull_bucket.py +++ b/tasks/0106_834_106834319_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_834_106834319_qa_3/task.toml b/tasks/0106_834_106834319_qa_3/task.toml index 217a17b4c01a932245329019e3363996cec0b37a..8150f38f50c532653579929b63d9346e06d34c77 100644 --- a/tasks/0106_834_106834319_qa_3/task.toml +++ b/tasks/0106_834_106834319_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_910_106910324_qa_1/environment/bootstrap.sh b/tasks/0106_910_106910324_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_910_106910324_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_910_106910324_qa_1/environment/pull_bucket.py b/tasks/0106_910_106910324_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_910_106910324_qa_1/environment/pull_bucket.py +++ b/tasks/0106_910_106910324_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_910_106910324_qa_1/task.toml b/tasks/0106_910_106910324_qa_1/task.toml index f404073596685d645f4cef4fdeb1c52bd4ccf007..8baa2db85321582f78e2903228a9560d8827a565 100644 --- a/tasks/0106_910_106910324_qa_1/task.toml +++ b/tasks/0106_910_106910324_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_910_106910324_qa_3/environment/bootstrap.sh b/tasks/0106_910_106910324_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_910_106910324_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_910_106910324_qa_3/environment/pull_bucket.py b/tasks/0106_910_106910324_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_910_106910324_qa_3/environment/pull_bucket.py +++ b/tasks/0106_910_106910324_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_910_106910324_qa_3/task.toml b/tasks/0106_910_106910324_qa_3/task.toml index 7a88163c08a90555e185a92baed7a11f4d65234e..e7768def0357033a2de7c1fcf2a05422f5f4fc16 100644 --- a/tasks/0106_910_106910324_qa_3/task.toml +++ b/tasks/0106_910_106910324_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_911_106911187_qa_4/environment/bootstrap.sh b/tasks/0106_911_106911187_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_911_106911187_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_911_106911187_qa_4/environment/pull_bucket.py b/tasks/0106_911_106911187_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_911_106911187_qa_4/environment/pull_bucket.py +++ b/tasks/0106_911_106911187_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_911_106911187_qa_4/task.toml b/tasks/0106_911_106911187_qa_4/task.toml index d3fef23b7fe8af5783e419bc204f79bfb5ff82b5..c289bc5da345a1020b8670eb0c7f865c2678c293 100644 --- a/tasks/0106_911_106911187_qa_4/task.toml +++ b/tasks/0106_911_106911187_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_911_106911187_qa_5/environment/bootstrap.sh b/tasks/0106_911_106911187_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_911_106911187_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_911_106911187_qa_5/environment/pull_bucket.py b/tasks/0106_911_106911187_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_911_106911187_qa_5/environment/pull_bucket.py +++ b/tasks/0106_911_106911187_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_911_106911187_qa_5/task.toml b/tasks/0106_911_106911187_qa_5/task.toml index 1c718c93385b5c63a692be8e31d4877247a51e0f..bf057911c5607bddeb1cc7e0eab27e965bf2e237 100644 --- a/tasks/0106_911_106911187_qa_5/task.toml +++ b/tasks/0106_911_106911187_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_933_106933480_qa_2/environment/bootstrap.sh b/tasks/0106_933_106933480_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_933_106933480_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_933_106933480_qa_2/environment/pull_bucket.py b/tasks/0106_933_106933480_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_933_106933480_qa_2/environment/pull_bucket.py +++ b/tasks/0106_933_106933480_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_933_106933480_qa_2/task.toml b/tasks/0106_933_106933480_qa_2/task.toml index bafb7d8c1a5131b4e9ed46ed5c764ce096137617..3f7ab558089b7cb4f8e25a4427c85af4dd0b094c 100644 --- a/tasks/0106_933_106933480_qa_2/task.toml +++ b/tasks/0106_933_106933480_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0106_972_106972391_qa_1/environment/bootstrap.sh b/tasks/0106_972_106972391_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0106_972_106972391_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0106_972_106972391_qa_1/environment/pull_bucket.py b/tasks/0106_972_106972391_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0106_972_106972391_qa_1/environment/pull_bucket.py +++ b/tasks/0106_972_106972391_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0106_972_106972391_qa_1/task.toml b/tasks/0106_972_106972391_qa_1/task.toml index 323495d7a66651980a7f8b6959a3b72e001b3306..561a3a15c2486a6163ba622a7db36dfc55ca7ea8 100644 --- a/tasks/0106_972_106972391_qa_1/task.toml +++ b/tasks/0106_972_106972391_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_060_107060186_qa_5/environment/bootstrap.sh b/tasks/0107_060_107060186_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_060_107060186_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_060_107060186_qa_5/environment/pull_bucket.py b/tasks/0107_060_107060186_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_060_107060186_qa_5/environment/pull_bucket.py +++ b/tasks/0107_060_107060186_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_060_107060186_qa_5/task.toml b/tasks/0107_060_107060186_qa_5/task.toml index 3aba8c957a7e3a0daa4bd7e3e7c11d595997bcc8..54264bec5acb92c877b2cf204e5120234652182e 100644 --- a/tasks/0107_060_107060186_qa_5/task.toml +++ b/tasks/0107_060_107060186_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_073_107073195_qa_2/environment/bootstrap.sh b/tasks/0107_073_107073195_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_073_107073195_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_073_107073195_qa_2/environment/pull_bucket.py b/tasks/0107_073_107073195_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_073_107073195_qa_2/environment/pull_bucket.py +++ b/tasks/0107_073_107073195_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_073_107073195_qa_2/task.toml b/tasks/0107_073_107073195_qa_2/task.toml index 112afa9dd78ae9576cbb1f01414b142e04a59d69..65ae6c6fb05a12adcdd8e2b5c1ea605204392f86 100644 --- a/tasks/0107_073_107073195_qa_2/task.toml +++ b/tasks/0107_073_107073195_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_107_107107118_qa_5/environment/bootstrap.sh b/tasks/0107_107_107107118_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_107_107107118_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_107_107107118_qa_5/environment/pull_bucket.py b/tasks/0107_107_107107118_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_107_107107118_qa_5/environment/pull_bucket.py +++ b/tasks/0107_107_107107118_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_107_107107118_qa_5/task.toml b/tasks/0107_107_107107118_qa_5/task.toml index 1d4a2dc9b4ac6b1afc0a779f78c5a2074ac05808..9f3f2882ad5f282f785f9187885998db79ff3c92 100644 --- a/tasks/0107_107_107107118_qa_5/task.toml +++ b/tasks/0107_107_107107118_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_118_107118417_qa_3/environment/bootstrap.sh b/tasks/0107_118_107118417_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_118_107118417_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_118_107118417_qa_3/environment/pull_bucket.py b/tasks/0107_118_107118417_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_118_107118417_qa_3/environment/pull_bucket.py +++ b/tasks/0107_118_107118417_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_118_107118417_qa_3/task.toml b/tasks/0107_118_107118417_qa_3/task.toml index 97d14e2d15e2680a259843dfb9514c11bb8a1a83..e947cc9ceed427c794b9b158756cf6ebd8dbc85a 100644 --- a/tasks/0107_118_107118417_qa_3/task.toml +++ b/tasks/0107_118_107118417_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_127_107127694_qa_4/environment/bootstrap.sh b/tasks/0107_127_107127694_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_127_107127694_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_127_107127694_qa_4/environment/pull_bucket.py b/tasks/0107_127_107127694_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_127_107127694_qa_4/environment/pull_bucket.py +++ b/tasks/0107_127_107127694_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_127_107127694_qa_4/task.toml b/tasks/0107_127_107127694_qa_4/task.toml index 712eec9e72e2fc61efaaba0c84876db72e029204..2ab5a73ab5c7d5c4e64afd2deb2c15f76e5e23dc 100644 --- a/tasks/0107_127_107127694_qa_4/task.toml +++ b/tasks/0107_127_107127694_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_163_107163382_qa_5/environment/bootstrap.sh b/tasks/0107_163_107163382_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_163_107163382_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_163_107163382_qa_5/environment/pull_bucket.py b/tasks/0107_163_107163382_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_163_107163382_qa_5/environment/pull_bucket.py +++ b/tasks/0107_163_107163382_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_163_107163382_qa_5/task.toml b/tasks/0107_163_107163382_qa_5/task.toml index abda8ddc3f6bb2735763ecc79adec2033d558a17..b8a8d4648a28a81026e68351e302fdbb7792604e 100644 --- a/tasks/0107_163_107163382_qa_5/task.toml +++ b/tasks/0107_163_107163382_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_177_107177097_qa_4/environment/bootstrap.sh b/tasks/0107_177_107177097_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_177_107177097_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_177_107177097_qa_4/environment/pull_bucket.py b/tasks/0107_177_107177097_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_177_107177097_qa_4/environment/pull_bucket.py +++ b/tasks/0107_177_107177097_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_177_107177097_qa_4/task.toml b/tasks/0107_177_107177097_qa_4/task.toml index fa18c9a7011b470a8c0056404990e39dc7131605..fce6d76480f49f90d30a2b355f739d21c0df1083 100644 --- a/tasks/0107_177_107177097_qa_4/task.toml +++ b/tasks/0107_177_107177097_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_190_107190827_qa_2/environment/bootstrap.sh b/tasks/0107_190_107190827_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_190_107190827_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_190_107190827_qa_2/environment/pull_bucket.py b/tasks/0107_190_107190827_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_190_107190827_qa_2/environment/pull_bucket.py +++ b/tasks/0107_190_107190827_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_190_107190827_qa_2/task.toml b/tasks/0107_190_107190827_qa_2/task.toml index 3cb98573b91009373cbb029cb857ae4bcc36ed2c..c19044808054e42ccd0732cd9c5226700ee8bbdf 100644 --- a/tasks/0107_190_107190827_qa_2/task.toml +++ b/tasks/0107_190_107190827_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_271_107271639_qa_3/environment/bootstrap.sh b/tasks/0107_271_107271639_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_271_107271639_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_271_107271639_qa_3/environment/pull_bucket.py b/tasks/0107_271_107271639_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_271_107271639_qa_3/environment/pull_bucket.py +++ b/tasks/0107_271_107271639_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_271_107271639_qa_3/task.toml b/tasks/0107_271_107271639_qa_3/task.toml index 465837cabb747aa6a0df3ada18b0e1bc26e201a6..4ad47f3b3798d9f5fd9d648ad2676393a21f7c4f 100644 --- a/tasks/0107_271_107271639_qa_3/task.toml +++ b/tasks/0107_271_107271639_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_327_107327801_qa_1/environment/bootstrap.sh b/tasks/0107_327_107327801_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_327_107327801_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_327_107327801_qa_1/environment/pull_bucket.py b/tasks/0107_327_107327801_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_327_107327801_qa_1/environment/pull_bucket.py +++ b/tasks/0107_327_107327801_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_327_107327801_qa_1/task.toml b/tasks/0107_327_107327801_qa_1/task.toml index 4130b019dbd49409c3428b830a159411f7388b20..724053cc616784b09437a4755df7e9e9c1518d40 100644 --- a/tasks/0107_327_107327801_qa_1/task.toml +++ b/tasks/0107_327_107327801_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_327_107327801_qa_2/environment/bootstrap.sh b/tasks/0107_327_107327801_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_327_107327801_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_327_107327801_qa_2/environment/pull_bucket.py b/tasks/0107_327_107327801_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_327_107327801_qa_2/environment/pull_bucket.py +++ b/tasks/0107_327_107327801_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_327_107327801_qa_2/task.toml b/tasks/0107_327_107327801_qa_2/task.toml index c1eaf660a9f499b6a51768845a4da6f455203763..3f81b8066a4a0bc63c83c2e8e5e33c9888a0c9dc 100644 --- a/tasks/0107_327_107327801_qa_2/task.toml +++ b/tasks/0107_327_107327801_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_327_107327801_qa_4/environment/bootstrap.sh b/tasks/0107_327_107327801_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_327_107327801_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_327_107327801_qa_4/environment/pull_bucket.py b/tasks/0107_327_107327801_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_327_107327801_qa_4/environment/pull_bucket.py +++ b/tasks/0107_327_107327801_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_327_107327801_qa_4/task.toml b/tasks/0107_327_107327801_qa_4/task.toml index 1c2bc1996c9c80c0dfb7b1c8d54e8c9a64714a2a..3118312dbb5ad46c341f04be8ce71c1e90e50675 100644 --- a/tasks/0107_327_107327801_qa_4/task.toml +++ b/tasks/0107_327_107327801_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_391_107391967_qa_2/environment/bootstrap.sh b/tasks/0107_391_107391967_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_391_107391967_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_391_107391967_qa_2/environment/pull_bucket.py b/tasks/0107_391_107391967_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_391_107391967_qa_2/environment/pull_bucket.py +++ b/tasks/0107_391_107391967_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_391_107391967_qa_2/task.toml b/tasks/0107_391_107391967_qa_2/task.toml index 0b1ad98ff4641fbeb841eb7b82cd3cc5880b92c7..3cb9e37bf8ce14dda26dac91c5d79819ed37211b 100644 --- a/tasks/0107_391_107391967_qa_2/task.toml +++ b/tasks/0107_391_107391967_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_411_107411800_qa_1/environment/bootstrap.sh b/tasks/0107_411_107411800_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_411_107411800_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_411_107411800_qa_1/environment/pull_bucket.py b/tasks/0107_411_107411800_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_411_107411800_qa_1/environment/pull_bucket.py +++ b/tasks/0107_411_107411800_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_411_107411800_qa_1/task.toml b/tasks/0107_411_107411800_qa_1/task.toml index 43ec2095e1328406286c1a2ed3cee4a9d7fb3a9e..181e4d30146cf71ddc40deddcce084420d16c7b0 100644 --- a/tasks/0107_411_107411800_qa_1/task.toml +++ b/tasks/0107_411_107411800_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_417_107417136_qa_1/environment/bootstrap.sh b/tasks/0107_417_107417136_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_417_107417136_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_417_107417136_qa_1/environment/pull_bucket.py b/tasks/0107_417_107417136_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_417_107417136_qa_1/environment/pull_bucket.py +++ b/tasks/0107_417_107417136_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_417_107417136_qa_1/task.toml b/tasks/0107_417_107417136_qa_1/task.toml index 47811af244038fc52b15c53830996d3a2136f51e..2b40b95155deb7316f5ce022f9a11e54e8268cdc 100644 --- a/tasks/0107_417_107417136_qa_1/task.toml +++ b/tasks/0107_417_107417136_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_417_107417136_qa_2/environment/bootstrap.sh b/tasks/0107_417_107417136_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_417_107417136_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_417_107417136_qa_2/environment/pull_bucket.py b/tasks/0107_417_107417136_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_417_107417136_qa_2/environment/pull_bucket.py +++ b/tasks/0107_417_107417136_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_417_107417136_qa_2/task.toml b/tasks/0107_417_107417136_qa_2/task.toml index 4c82fd10cad917fd39ae001df8d04769712266e1..9f22110e9a26fd2a4e573f53302e26af90b51e4d 100644 --- a/tasks/0107_417_107417136_qa_2/task.toml +++ b/tasks/0107_417_107417136_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_417_107417136_qa_4/environment/bootstrap.sh b/tasks/0107_417_107417136_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_417_107417136_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_417_107417136_qa_4/environment/pull_bucket.py b/tasks/0107_417_107417136_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_417_107417136_qa_4/environment/pull_bucket.py +++ b/tasks/0107_417_107417136_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_417_107417136_qa_4/task.toml b/tasks/0107_417_107417136_qa_4/task.toml index 4b4ef1b29137786426ab80a03774877952a84c69..94c1020b0fdfa1e11d472ce64f9d7ff4048412f7 100644 --- a/tasks/0107_417_107417136_qa_4/task.toml +++ b/tasks/0107_417_107417136_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_427_107427822_qa_3/environment/bootstrap.sh b/tasks/0107_427_107427822_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_427_107427822_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_427_107427822_qa_3/environment/pull_bucket.py b/tasks/0107_427_107427822_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_427_107427822_qa_3/environment/pull_bucket.py +++ b/tasks/0107_427_107427822_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_427_107427822_qa_3/task.toml b/tasks/0107_427_107427822_qa_3/task.toml index 53551eff371b85c93894dc56dd5f0d7347241371..85b76d07599c88af52fd5f92667723ed1d1ccb00 100644 --- a/tasks/0107_427_107427822_qa_3/task.toml +++ b/tasks/0107_427_107427822_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_427_107427822_qa_5/environment/bootstrap.sh b/tasks/0107_427_107427822_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_427_107427822_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_427_107427822_qa_5/environment/pull_bucket.py b/tasks/0107_427_107427822_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_427_107427822_qa_5/environment/pull_bucket.py +++ b/tasks/0107_427_107427822_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_427_107427822_qa_5/task.toml b/tasks/0107_427_107427822_qa_5/task.toml index 331de9853bc8d44c38f085b2683dd5c4f6823dab..3fe57eec975f3c4cc00819c93cf0f78b21b4a865 100644 --- a/tasks/0107_427_107427822_qa_5/task.toml +++ b/tasks/0107_427_107427822_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_451_107451857_qa_4/environment/bootstrap.sh b/tasks/0107_451_107451857_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_451_107451857_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_451_107451857_qa_4/environment/pull_bucket.py b/tasks/0107_451_107451857_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_451_107451857_qa_4/environment/pull_bucket.py +++ b/tasks/0107_451_107451857_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_451_107451857_qa_4/task.toml b/tasks/0107_451_107451857_qa_4/task.toml index 17683e93b05c13a42f8095834b6e3a1f7a80749e..928546382eb63522b1d5938de41c76c489fd7319 100644 --- a/tasks/0107_451_107451857_qa_4/task.toml +++ b/tasks/0107_451_107451857_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_477_107477079_qa_2/environment/bootstrap.sh b/tasks/0107_477_107477079_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_477_107477079_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_477_107477079_qa_2/environment/pull_bucket.py b/tasks/0107_477_107477079_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_477_107477079_qa_2/environment/pull_bucket.py +++ b/tasks/0107_477_107477079_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_477_107477079_qa_2/task.toml b/tasks/0107_477_107477079_qa_2/task.toml index e811b0e42145c384b1f1e28aa45d84b30661a5c8..34248de184f587523365cb5bf98b0c2862e2b0ff 100644 --- a/tasks/0107_477_107477079_qa_2/task.toml +++ b/tasks/0107_477_107477079_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_477_107477079_qa_3/environment/bootstrap.sh b/tasks/0107_477_107477079_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_477_107477079_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_477_107477079_qa_3/environment/pull_bucket.py b/tasks/0107_477_107477079_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_477_107477079_qa_3/environment/pull_bucket.py +++ b/tasks/0107_477_107477079_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_477_107477079_qa_3/task.toml b/tasks/0107_477_107477079_qa_3/task.toml index 30c996edbc012493de93438dff255dcd1f666898..4ddd6817367dbb5fb1a43e15b305e0802bd0ff9f 100644 --- a/tasks/0107_477_107477079_qa_3/task.toml +++ b/tasks/0107_477_107477079_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_477_107477079_qa_5/environment/bootstrap.sh b/tasks/0107_477_107477079_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_477_107477079_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_477_107477079_qa_5/environment/pull_bucket.py b/tasks/0107_477_107477079_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_477_107477079_qa_5/environment/pull_bucket.py +++ b/tasks/0107_477_107477079_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_477_107477079_qa_5/task.toml b/tasks/0107_477_107477079_qa_5/task.toml index ff1e9624997e9fdfcfbfb77ee53cdcbd08d64a27..58e1a2c556bd97baa417cdb5e4093c4680b89ce2 100644 --- a/tasks/0107_477_107477079_qa_5/task.toml +++ b/tasks/0107_477_107477079_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_517_107517636_qa_3/environment/bootstrap.sh b/tasks/0107_517_107517636_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_517_107517636_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_517_107517636_qa_3/environment/pull_bucket.py b/tasks/0107_517_107517636_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_517_107517636_qa_3/environment/pull_bucket.py +++ b/tasks/0107_517_107517636_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_517_107517636_qa_3/task.toml b/tasks/0107_517_107517636_qa_3/task.toml index c7c2b6bad668c63384a05dc03b661892e083a08e..54d5541f2a6bada72675d7bfe6d798c2c9c3ba44 100644 --- a/tasks/0107_517_107517636_qa_3/task.toml +++ b/tasks/0107_517_107517636_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_521_107521812_qa_2/environment/bootstrap.sh b/tasks/0107_521_107521812_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_521_107521812_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_521_107521812_qa_2/environment/pull_bucket.py b/tasks/0107_521_107521812_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_521_107521812_qa_2/environment/pull_bucket.py +++ b/tasks/0107_521_107521812_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_521_107521812_qa_2/task.toml b/tasks/0107_521_107521812_qa_2/task.toml index 6c870138a31728db7f6024f58aef00f0ded07bf4..127bede445b798ffb15aeb887014b82f152de819 100644 --- a/tasks/0107_521_107521812_qa_2/task.toml +++ b/tasks/0107_521_107521812_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_639_107639257_qa_1/environment/bootstrap.sh b/tasks/0107_639_107639257_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_639_107639257_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_639_107639257_qa_1/environment/pull_bucket.py b/tasks/0107_639_107639257_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_639_107639257_qa_1/environment/pull_bucket.py +++ b/tasks/0107_639_107639257_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_639_107639257_qa_1/task.toml b/tasks/0107_639_107639257_qa_1/task.toml index 72ececeb001efb7e80409d951d20ff81a90633a4..10c8b77546e43569c088b4fe52a72582fd5dbc2c 100644 --- a/tasks/0107_639_107639257_qa_1/task.toml +++ b/tasks/0107_639_107639257_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_639_107639257_qa_4/environment/bootstrap.sh b/tasks/0107_639_107639257_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_639_107639257_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_639_107639257_qa_4/environment/pull_bucket.py b/tasks/0107_639_107639257_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_639_107639257_qa_4/environment/pull_bucket.py +++ b/tasks/0107_639_107639257_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_639_107639257_qa_4/task.toml b/tasks/0107_639_107639257_qa_4/task.toml index 185662b2128d61168ba1a0dda0560d783f0b571f..cf7b37d17905863f7677ed33c64cb4abda5540a3 100644 --- a/tasks/0107_639_107639257_qa_4/task.toml +++ b/tasks/0107_639_107639257_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_679_107679548_qa_5/environment/bootstrap.sh b/tasks/0107_679_107679548_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_679_107679548_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_679_107679548_qa_5/environment/pull_bucket.py b/tasks/0107_679_107679548_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_679_107679548_qa_5/environment/pull_bucket.py +++ b/tasks/0107_679_107679548_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_679_107679548_qa_5/task.toml b/tasks/0107_679_107679548_qa_5/task.toml index 78f154cfeb066af00f4a255465f4c22a3799661b..f6988398ea933698be1c34e4adc3d114d1816a65 100644 --- a/tasks/0107_679_107679548_qa_5/task.toml +++ b/tasks/0107_679_107679548_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_704_107704788_qa_3/environment/bootstrap.sh b/tasks/0107_704_107704788_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_704_107704788_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_704_107704788_qa_3/environment/pull_bucket.py b/tasks/0107_704_107704788_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_704_107704788_qa_3/environment/pull_bucket.py +++ b/tasks/0107_704_107704788_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_704_107704788_qa_3/task.toml b/tasks/0107_704_107704788_qa_3/task.toml index f7bcdfa6d03d97a1fe727fe56dea97ee9509e580..8414c6001d54fcdb0f6bd63f6e2583120c16ee2f 100644 --- a/tasks/0107_704_107704788_qa_3/task.toml +++ b/tasks/0107_704_107704788_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_756_107756714_qa_1/environment/bootstrap.sh b/tasks/0107_756_107756714_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_756_107756714_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_756_107756714_qa_1/environment/pull_bucket.py b/tasks/0107_756_107756714_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_756_107756714_qa_1/environment/pull_bucket.py +++ b/tasks/0107_756_107756714_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_756_107756714_qa_1/task.toml b/tasks/0107_756_107756714_qa_1/task.toml index cee5070c87b295cca2f1f4ec393797cb6159c7b1..f0f48437ad15e39d08cc95172db4ae55d51211c9 100644 --- a/tasks/0107_756_107756714_qa_1/task.toml +++ b/tasks/0107_756_107756714_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_762_107762409_qa_5/environment/bootstrap.sh b/tasks/0107_762_107762409_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_762_107762409_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_762_107762409_qa_5/environment/pull_bucket.py b/tasks/0107_762_107762409_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_762_107762409_qa_5/environment/pull_bucket.py +++ b/tasks/0107_762_107762409_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_762_107762409_qa_5/task.toml b/tasks/0107_762_107762409_qa_5/task.toml index 709377ecb026f401c75a9f47f3329cef26751dce..f430cf70b3405506f27ce254ec820e15c8249031 100644 --- a/tasks/0107_762_107762409_qa_5/task.toml +++ b/tasks/0107_762_107762409_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_772_107772825_qa_1/environment/bootstrap.sh b/tasks/0107_772_107772825_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_772_107772825_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_772_107772825_qa_1/environment/pull_bucket.py b/tasks/0107_772_107772825_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_772_107772825_qa_1/environment/pull_bucket.py +++ b/tasks/0107_772_107772825_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_772_107772825_qa_1/task.toml b/tasks/0107_772_107772825_qa_1/task.toml index b0eef33e3d65bf8d5675912ecbae3e5b1d325d77..77cb5f37de455bbd37ac1ef5f554969b3bb7e386 100644 --- a/tasks/0107_772_107772825_qa_1/task.toml +++ b/tasks/0107_772_107772825_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_772_107772825_qa_3/environment/bootstrap.sh b/tasks/0107_772_107772825_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_772_107772825_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_772_107772825_qa_3/environment/pull_bucket.py b/tasks/0107_772_107772825_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_772_107772825_qa_3/environment/pull_bucket.py +++ b/tasks/0107_772_107772825_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_772_107772825_qa_3/task.toml b/tasks/0107_772_107772825_qa_3/task.toml index 74f26487518d432f225c470f1004f26211ae7794..4bb692b20397e561ec8182179b4213b9d1a51e75 100644 --- a/tasks/0107_772_107772825_qa_3/task.toml +++ b/tasks/0107_772_107772825_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_830_107830483_qa_1/environment/bootstrap.sh b/tasks/0107_830_107830483_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_830_107830483_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_830_107830483_qa_1/environment/pull_bucket.py b/tasks/0107_830_107830483_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_830_107830483_qa_1/environment/pull_bucket.py +++ b/tasks/0107_830_107830483_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_830_107830483_qa_1/task.toml b/tasks/0107_830_107830483_qa_1/task.toml index 596ac2300e420c98a12544336de46269e964d70f..f45a759cadfd97574c6ab87a0853700c4de168db 100644 --- a/tasks/0107_830_107830483_qa_1/task.toml +++ b/tasks/0107_830_107830483_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_868_107868150_qa_1/environment/bootstrap.sh b/tasks/0107_868_107868150_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_868_107868150_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_868_107868150_qa_1/environment/pull_bucket.py b/tasks/0107_868_107868150_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_868_107868150_qa_1/environment/pull_bucket.py +++ b/tasks/0107_868_107868150_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_868_107868150_qa_1/task.toml b/tasks/0107_868_107868150_qa_1/task.toml index 7c155a9ce36e7282009ec164060f93ae15c51f86..97dd8032920494281a36cfee0be4e0ebd64a24ae 100644 --- a/tasks/0107_868_107868150_qa_1/task.toml +++ b/tasks/0107_868_107868150_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_882_107882051_qa_4/environment/bootstrap.sh b/tasks/0107_882_107882051_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_882_107882051_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_882_107882051_qa_4/environment/pull_bucket.py b/tasks/0107_882_107882051_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_882_107882051_qa_4/environment/pull_bucket.py +++ b/tasks/0107_882_107882051_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_882_107882051_qa_4/task.toml b/tasks/0107_882_107882051_qa_4/task.toml index c47f74dc69cadfe44aa0ac5e3f2e4554c2dbda3d..729a1a3a6af3699187b4fbbb20075958a247fed5 100644 --- a/tasks/0107_882_107882051_qa_4/task.toml +++ b/tasks/0107_882_107882051_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_946_107946533_qa_1/environment/bootstrap.sh b/tasks/0107_946_107946533_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_946_107946533_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_946_107946533_qa_1/environment/pull_bucket.py b/tasks/0107_946_107946533_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_946_107946533_qa_1/environment/pull_bucket.py +++ b/tasks/0107_946_107946533_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_946_107946533_qa_1/task.toml b/tasks/0107_946_107946533_qa_1/task.toml index b73cb77400407eabac9b09cb7ef5b0bc64669f9b..d75f426646cc4b97fb9582153f582fa7272d9fe4 100644 --- a/tasks/0107_946_107946533_qa_1/task.toml +++ b/tasks/0107_946_107946533_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0107_974_107974246_qa_3/environment/bootstrap.sh b/tasks/0107_974_107974246_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0107_974_107974246_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0107_974_107974246_qa_3/environment/pull_bucket.py b/tasks/0107_974_107974246_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0107_974_107974246_qa_3/environment/pull_bucket.py +++ b/tasks/0107_974_107974246_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0107_974_107974246_qa_3/task.toml b/tasks/0107_974_107974246_qa_3/task.toml index 3524a249fee30082f820edd5515883ecaa91725f..33b96de4664a47660f6f7945559e11f872ddb81e 100644 --- a/tasks/0107_974_107974246_qa_3/task.toml +++ b/tasks/0107_974_107974246_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_138_108138714_qa_1/environment/bootstrap.sh b/tasks/0108_138_108138714_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_138_108138714_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_138_108138714_qa_1/environment/pull_bucket.py b/tasks/0108_138_108138714_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_138_108138714_qa_1/environment/pull_bucket.py +++ b/tasks/0108_138_108138714_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_138_108138714_qa_1/task.toml b/tasks/0108_138_108138714_qa_1/task.toml index 3818755d7ad8e68a5e1b0b3e3798d4add6da040d..dec464a47abe6091e795f7743f4eaf977de2bf96 100644 --- a/tasks/0108_138_108138714_qa_1/task.toml +++ b/tasks/0108_138_108138714_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_184_108184818_qa_2/environment/bootstrap.sh b/tasks/0108_184_108184818_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_184_108184818_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_184_108184818_qa_2/environment/pull_bucket.py b/tasks/0108_184_108184818_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_184_108184818_qa_2/environment/pull_bucket.py +++ b/tasks/0108_184_108184818_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_184_108184818_qa_2/task.toml b/tasks/0108_184_108184818_qa_2/task.toml index 281c03b5e5be3ad73289c226ba0ba03c2d914ebd..27015a3cfbf595724ba11c31cd5f2ad85adcf66a 100644 --- a/tasks/0108_184_108184818_qa_2/task.toml +++ b/tasks/0108_184_108184818_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_184_108184818_qa_3/environment/bootstrap.sh b/tasks/0108_184_108184818_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_184_108184818_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_184_108184818_qa_3/environment/pull_bucket.py b/tasks/0108_184_108184818_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_184_108184818_qa_3/environment/pull_bucket.py +++ b/tasks/0108_184_108184818_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_184_108184818_qa_3/task.toml b/tasks/0108_184_108184818_qa_3/task.toml index 7da5bc7489f8b70538da022a3c6105f9bb329894..66fbc25c7a7dab1955e9ff161adbb73887ea14b0 100644 --- a/tasks/0108_184_108184818_qa_3/task.toml +++ b/tasks/0108_184_108184818_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_197_108197253_qa_1/environment/bootstrap.sh b/tasks/0108_197_108197253_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_197_108197253_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_197_108197253_qa_1/environment/pull_bucket.py b/tasks/0108_197_108197253_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_197_108197253_qa_1/environment/pull_bucket.py +++ b/tasks/0108_197_108197253_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_197_108197253_qa_1/task.toml b/tasks/0108_197_108197253_qa_1/task.toml index 54c6b279efc906eb9fd8370f392964f19926c74a..0faafc94244c12cb702cfed35d4dc6466529b58a 100644 --- a/tasks/0108_197_108197253_qa_1/task.toml +++ b/tasks/0108_197_108197253_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_197_108197991_qa_5/environment/bootstrap.sh b/tasks/0108_197_108197991_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_197_108197991_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_197_108197991_qa_5/environment/pull_bucket.py b/tasks/0108_197_108197991_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_197_108197991_qa_5/environment/pull_bucket.py +++ b/tasks/0108_197_108197991_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_197_108197991_qa_5/task.toml b/tasks/0108_197_108197991_qa_5/task.toml index 4c49d4140fd081fba9037459cf6b830e649cf7cd..2e131ad50cf7539097dfd7810b1dd34888e49b09 100644 --- a/tasks/0108_197_108197991_qa_5/task.toml +++ b/tasks/0108_197_108197991_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_199_108199780_qa_2/environment/bootstrap.sh b/tasks/0108_199_108199780_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_199_108199780_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_199_108199780_qa_2/environment/pull_bucket.py b/tasks/0108_199_108199780_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_199_108199780_qa_2/environment/pull_bucket.py +++ b/tasks/0108_199_108199780_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_199_108199780_qa_2/task.toml b/tasks/0108_199_108199780_qa_2/task.toml index be633774695729c7913b390d0b829cfb9e3c0347..5c31b7463631af3d66389b4734ce300cc486ad04 100644 --- a/tasks/0108_199_108199780_qa_2/task.toml +++ b/tasks/0108_199_108199780_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_225_108225204_qa_1/environment/bootstrap.sh b/tasks/0108_225_108225204_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_225_108225204_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_225_108225204_qa_1/environment/pull_bucket.py b/tasks/0108_225_108225204_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_225_108225204_qa_1/environment/pull_bucket.py +++ b/tasks/0108_225_108225204_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_225_108225204_qa_1/task.toml b/tasks/0108_225_108225204_qa_1/task.toml index f6b362d4dd9a9df62d210b95631e60904f0b2e3c..682ca52b80bc007b5d840bad2f407e6af125753d 100644 --- a/tasks/0108_225_108225204_qa_1/task.toml +++ b/tasks/0108_225_108225204_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_225_108225204_qa_2/environment/bootstrap.sh b/tasks/0108_225_108225204_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_225_108225204_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_225_108225204_qa_2/environment/pull_bucket.py b/tasks/0108_225_108225204_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_225_108225204_qa_2/environment/pull_bucket.py +++ b/tasks/0108_225_108225204_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_225_108225204_qa_2/task.toml b/tasks/0108_225_108225204_qa_2/task.toml index d1232f73ce628314da8bc31f86c62cbe19930306..898583d692b66b1d79c38b1d3f254a4335dcc5c6 100644 --- a/tasks/0108_225_108225204_qa_2/task.toml +++ b/tasks/0108_225_108225204_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_236_108236679_qa_1/environment/bootstrap.sh b/tasks/0108_236_108236679_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_236_108236679_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_236_108236679_qa_1/environment/pull_bucket.py b/tasks/0108_236_108236679_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_236_108236679_qa_1/environment/pull_bucket.py +++ b/tasks/0108_236_108236679_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_236_108236679_qa_1/task.toml b/tasks/0108_236_108236679_qa_1/task.toml index 328f6d7cdab4f7ff0783fc3f3d0a34ab607effd6..71fd3af2408f95b35fa1b683bd7c12349139f858 100644 --- a/tasks/0108_236_108236679_qa_1/task.toml +++ b/tasks/0108_236_108236679_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_236_108236679_qa_4/environment/bootstrap.sh b/tasks/0108_236_108236679_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_236_108236679_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_236_108236679_qa_4/environment/pull_bucket.py b/tasks/0108_236_108236679_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_236_108236679_qa_4/environment/pull_bucket.py +++ b/tasks/0108_236_108236679_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_236_108236679_qa_4/task.toml b/tasks/0108_236_108236679_qa_4/task.toml index f7e9141ac8e4cd14ea8f1f2ab6ba07c16fa6bacf..1105881d952c6a6d15eb68dca444173909db382a 100644 --- a/tasks/0108_236_108236679_qa_4/task.toml +++ b/tasks/0108_236_108236679_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_236_108236679_qa_5/environment/bootstrap.sh b/tasks/0108_236_108236679_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_236_108236679_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_236_108236679_qa_5/environment/pull_bucket.py b/tasks/0108_236_108236679_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_236_108236679_qa_5/environment/pull_bucket.py +++ b/tasks/0108_236_108236679_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_236_108236679_qa_5/task.toml b/tasks/0108_236_108236679_qa_5/task.toml index 5e00492b764a7f75cc2d381a6e621f649d15f006..c9f2cb55acef29d923d4aec4c6ce7cfe9f520b0a 100644 --- a/tasks/0108_236_108236679_qa_5/task.toml +++ b/tasks/0108_236_108236679_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_284_108284561_qa_2/environment/bootstrap.sh b/tasks/0108_284_108284561_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_284_108284561_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_284_108284561_qa_2/environment/pull_bucket.py b/tasks/0108_284_108284561_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_284_108284561_qa_2/environment/pull_bucket.py +++ b/tasks/0108_284_108284561_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_284_108284561_qa_2/task.toml b/tasks/0108_284_108284561_qa_2/task.toml index a675be79e4b2e1f2d3b6c4de2525ba309f952d00..032be19172c2d733e8b4cfe8da3516744d963696 100644 --- a/tasks/0108_284_108284561_qa_2/task.toml +++ b/tasks/0108_284_108284561_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_359_108359685_qa_2/environment/bootstrap.sh b/tasks/0108_359_108359685_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_359_108359685_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_359_108359685_qa_2/environment/pull_bucket.py b/tasks/0108_359_108359685_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_359_108359685_qa_2/environment/pull_bucket.py +++ b/tasks/0108_359_108359685_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_359_108359685_qa_2/task.toml b/tasks/0108_359_108359685_qa_2/task.toml index 41d5c5e37ab578585dad89dad2d3fa3cd720c516..dbc896c3ae83531e0e0caccdd8f57aea7085a785 100644 --- a/tasks/0108_359_108359685_qa_2/task.toml +++ b/tasks/0108_359_108359685_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_363_108363990_qa_1/environment/bootstrap.sh b/tasks/0108_363_108363990_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_363_108363990_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_363_108363990_qa_1/environment/pull_bucket.py b/tasks/0108_363_108363990_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_363_108363990_qa_1/environment/pull_bucket.py +++ b/tasks/0108_363_108363990_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_363_108363990_qa_1/task.toml b/tasks/0108_363_108363990_qa_1/task.toml index a2ea861bb0038001330fc48ddfd746e50a939a08..baf34f666e2e272f089fb22459bac14bae6fd6ef 100644 --- a/tasks/0108_363_108363990_qa_1/task.toml +++ b/tasks/0108_363_108363990_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_363_108363990_qa_2/environment/bootstrap.sh b/tasks/0108_363_108363990_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_363_108363990_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_363_108363990_qa_2/environment/pull_bucket.py b/tasks/0108_363_108363990_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_363_108363990_qa_2/environment/pull_bucket.py +++ b/tasks/0108_363_108363990_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_363_108363990_qa_2/task.toml b/tasks/0108_363_108363990_qa_2/task.toml index b12ff610124b4388459b9af52371e3afed7e6c98..95386bc48b677a88046558d4c2f7792e61001b5b 100644 --- a/tasks/0108_363_108363990_qa_2/task.toml +++ b/tasks/0108_363_108363990_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_363_108363990_qa_3/environment/bootstrap.sh b/tasks/0108_363_108363990_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_363_108363990_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_363_108363990_qa_3/environment/pull_bucket.py b/tasks/0108_363_108363990_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_363_108363990_qa_3/environment/pull_bucket.py +++ b/tasks/0108_363_108363990_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_363_108363990_qa_3/task.toml b/tasks/0108_363_108363990_qa_3/task.toml index fc62ac50b7d0a706f692b46c757af531a0646315..674e2d01b6e4598c18b19be6f16cb0abd80414a7 100644 --- a/tasks/0108_363_108363990_qa_3/task.toml +++ b/tasks/0108_363_108363990_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_379_108379534_qa_2/environment/bootstrap.sh b/tasks/0108_379_108379534_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_379_108379534_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_379_108379534_qa_2/environment/pull_bucket.py b/tasks/0108_379_108379534_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_379_108379534_qa_2/environment/pull_bucket.py +++ b/tasks/0108_379_108379534_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_379_108379534_qa_2/task.toml b/tasks/0108_379_108379534_qa_2/task.toml index 8ca6936cefdcd19fdccb76caeabd26222069e0e6..e81f724adeca2c69473294d103a88280bf925bde 100644 --- a/tasks/0108_379_108379534_qa_2/task.toml +++ b/tasks/0108_379_108379534_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_391_108391946_qa_5/environment/bootstrap.sh b/tasks/0108_391_108391946_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_391_108391946_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_391_108391946_qa_5/environment/pull_bucket.py b/tasks/0108_391_108391946_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_391_108391946_qa_5/environment/pull_bucket.py +++ b/tasks/0108_391_108391946_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_391_108391946_qa_5/task.toml b/tasks/0108_391_108391946_qa_5/task.toml index 4e77a0a6c859e4613768a8a381dbb747ab191f33..2b6b45c709b2ab5db75b40598cf0366185984b98 100644 --- a/tasks/0108_391_108391946_qa_5/task.toml +++ b/tasks/0108_391_108391946_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_423_108423455_qa_3/environment/bootstrap.sh b/tasks/0108_423_108423455_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_423_108423455_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_423_108423455_qa_3/environment/pull_bucket.py b/tasks/0108_423_108423455_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_423_108423455_qa_3/environment/pull_bucket.py +++ b/tasks/0108_423_108423455_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_423_108423455_qa_3/task.toml b/tasks/0108_423_108423455_qa_3/task.toml index 69e6de9050e3d986201a6270f4f8d755237a33f0..ca362f46affd68eb9366642ac01ac8052118130b 100644 --- a/tasks/0108_423_108423455_qa_3/task.toml +++ b/tasks/0108_423_108423455_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_423_108423455_qa_4/environment/bootstrap.sh b/tasks/0108_423_108423455_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_423_108423455_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_423_108423455_qa_4/environment/pull_bucket.py b/tasks/0108_423_108423455_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_423_108423455_qa_4/environment/pull_bucket.py +++ b/tasks/0108_423_108423455_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_423_108423455_qa_4/task.toml b/tasks/0108_423_108423455_qa_4/task.toml index a25dc1e0aaec564d3b5b8236ecdb0405281bf6b9..f40498e84c08751c49708df00eae5d9889ed74c0 100644 --- a/tasks/0108_423_108423455_qa_4/task.toml +++ b/tasks/0108_423_108423455_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_423_108423455_qa_5/environment/bootstrap.sh b/tasks/0108_423_108423455_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_423_108423455_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_423_108423455_qa_5/environment/pull_bucket.py b/tasks/0108_423_108423455_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_423_108423455_qa_5/environment/pull_bucket.py +++ b/tasks/0108_423_108423455_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_423_108423455_qa_5/task.toml b/tasks/0108_423_108423455_qa_5/task.toml index 947cd55555a4603869c630dd8430d6f14fd5b766..a36e9fdf8a9c29aac2e78a95926eca4e5d262692 100644 --- a/tasks/0108_423_108423455_qa_5/task.toml +++ b/tasks/0108_423_108423455_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_588_108588873_qa_1/environment/bootstrap.sh b/tasks/0108_588_108588873_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_588_108588873_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_588_108588873_qa_1/environment/pull_bucket.py b/tasks/0108_588_108588873_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_588_108588873_qa_1/environment/pull_bucket.py +++ b/tasks/0108_588_108588873_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_588_108588873_qa_1/task.toml b/tasks/0108_588_108588873_qa_1/task.toml index 3f36c140145a4f1c90452e9a4f9a3d272ed40eac..2a5e2b9aafcb4c3b7d76aa8cdb78aa8704968d09 100644 --- a/tasks/0108_588_108588873_qa_1/task.toml +++ b/tasks/0108_588_108588873_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_588_108588873_qa_2/environment/bootstrap.sh b/tasks/0108_588_108588873_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_588_108588873_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_588_108588873_qa_2/environment/pull_bucket.py b/tasks/0108_588_108588873_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_588_108588873_qa_2/environment/pull_bucket.py +++ b/tasks/0108_588_108588873_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_588_108588873_qa_2/task.toml b/tasks/0108_588_108588873_qa_2/task.toml index 6cee260e652a467cbb546bbae26659c36dc99e7e..1e801eb27f486885ff6137ea45eea5e8d81c4209 100644 --- a/tasks/0108_588_108588873_qa_2/task.toml +++ b/tasks/0108_588_108588873_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_620_108620410_qa_3/environment/bootstrap.sh b/tasks/0108_620_108620410_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_620_108620410_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_620_108620410_qa_3/environment/pull_bucket.py b/tasks/0108_620_108620410_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_620_108620410_qa_3/environment/pull_bucket.py +++ b/tasks/0108_620_108620410_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_620_108620410_qa_3/task.toml b/tasks/0108_620_108620410_qa_3/task.toml index 12f406c253e9a58e9986434f975eb342d131dc83..129fadb4503ab75a0d89bdf3d4f2bad3dae1ed11 100644 --- a/tasks/0108_620_108620410_qa_3/task.toml +++ b/tasks/0108_620_108620410_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_641_108641458_qa_2/environment/bootstrap.sh b/tasks/0108_641_108641458_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_641_108641458_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_641_108641458_qa_2/environment/pull_bucket.py b/tasks/0108_641_108641458_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_641_108641458_qa_2/environment/pull_bucket.py +++ b/tasks/0108_641_108641458_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_641_108641458_qa_2/task.toml b/tasks/0108_641_108641458_qa_2/task.toml index 8d61c6906baa8d47ef19927240cd0ecc10b9d85e..fb15036f3dfc6de71c152c45fc747ee95475b05d 100644 --- a/tasks/0108_641_108641458_qa_2/task.toml +++ b/tasks/0108_641_108641458_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_641_108641458_qa_3/environment/bootstrap.sh b/tasks/0108_641_108641458_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_641_108641458_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_641_108641458_qa_3/environment/pull_bucket.py b/tasks/0108_641_108641458_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_641_108641458_qa_3/environment/pull_bucket.py +++ b/tasks/0108_641_108641458_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_641_108641458_qa_3/task.toml b/tasks/0108_641_108641458_qa_3/task.toml index 51d4853680ae1ab4b77c25103d0aa89814bba9f0..f1b2fbb2464afcd8b1e3e3d12a545b1c0b81d46f 100644 --- a/tasks/0108_641_108641458_qa_3/task.toml +++ b/tasks/0108_641_108641458_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_681_108681309_qa_1/environment/bootstrap.sh b/tasks/0108_681_108681309_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_681_108681309_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_681_108681309_qa_1/environment/pull_bucket.py b/tasks/0108_681_108681309_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_681_108681309_qa_1/environment/pull_bucket.py +++ b/tasks/0108_681_108681309_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_681_108681309_qa_1/task.toml b/tasks/0108_681_108681309_qa_1/task.toml index 92d44dd71a8e394a9ab56393039529b9b53bf1a9..975668e0a135047b04f57b4439de42a53be70b53 100644 --- a/tasks/0108_681_108681309_qa_1/task.toml +++ b/tasks/0108_681_108681309_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_681_108681309_qa_4/environment/bootstrap.sh b/tasks/0108_681_108681309_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_681_108681309_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_681_108681309_qa_4/environment/pull_bucket.py b/tasks/0108_681_108681309_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_681_108681309_qa_4/environment/pull_bucket.py +++ b/tasks/0108_681_108681309_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_681_108681309_qa_4/task.toml b/tasks/0108_681_108681309_qa_4/task.toml index 7e984bd8bb625a3fa9ab6145d7980dcb1702f3fe..f4e90d2c58e59e6bc8fa745c5ee1650ae9cb2059 100644 --- a/tasks/0108_681_108681309_qa_4/task.toml +++ b/tasks/0108_681_108681309_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_778_108778094_qa_5/environment/bootstrap.sh b/tasks/0108_778_108778094_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_778_108778094_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_778_108778094_qa_5/environment/pull_bucket.py b/tasks/0108_778_108778094_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_778_108778094_qa_5/environment/pull_bucket.py +++ b/tasks/0108_778_108778094_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_778_108778094_qa_5/task.toml b/tasks/0108_778_108778094_qa_5/task.toml index 2fcb351c775ef3c1d2fe37ab5578a5bb742a526d..bbe0da96a0e55ff4365c3424c0e4e4d1405c50dc 100644 --- a/tasks/0108_778_108778094_qa_5/task.toml +++ b/tasks/0108_778_108778094_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_781_108781422_qa_2/environment/bootstrap.sh b/tasks/0108_781_108781422_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_781_108781422_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_781_108781422_qa_2/environment/pull_bucket.py b/tasks/0108_781_108781422_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_781_108781422_qa_2/environment/pull_bucket.py +++ b/tasks/0108_781_108781422_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_781_108781422_qa_2/task.toml b/tasks/0108_781_108781422_qa_2/task.toml index c8ee62f2b68c0c2fb5d2b56e33942d6212e06155..7f9574a26e532b9602c83fe18c2e4aec75277a81 100644 --- a/tasks/0108_781_108781422_qa_2/task.toml +++ b/tasks/0108_781_108781422_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_808_108808607_qa_2/environment/bootstrap.sh b/tasks/0108_808_108808607_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_808_108808607_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_808_108808607_qa_2/environment/pull_bucket.py b/tasks/0108_808_108808607_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_808_108808607_qa_2/environment/pull_bucket.py +++ b/tasks/0108_808_108808607_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_808_108808607_qa_2/task.toml b/tasks/0108_808_108808607_qa_2/task.toml index 1bb77ea7684b415c21e467fd67163466dc2200e0..14c5e0229cd2f1f54a1b2deb91a088152de09987 100644 --- a/tasks/0108_808_108808607_qa_2/task.toml +++ b/tasks/0108_808_108808607_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_825_108825699_qa_1/environment/bootstrap.sh b/tasks/0108_825_108825699_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_825_108825699_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_825_108825699_qa_1/environment/pull_bucket.py b/tasks/0108_825_108825699_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_825_108825699_qa_1/environment/pull_bucket.py +++ b/tasks/0108_825_108825699_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_825_108825699_qa_1/task.toml b/tasks/0108_825_108825699_qa_1/task.toml index a65309cf8448f0de5a031823aca2cee1f27e942a..665801a73f97bf396c0bd2bfafdceccf510ca7c2 100644 --- a/tasks/0108_825_108825699_qa_1/task.toml +++ b/tasks/0108_825_108825699_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_825_108825699_qa_3/environment/bootstrap.sh b/tasks/0108_825_108825699_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_825_108825699_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_825_108825699_qa_3/environment/pull_bucket.py b/tasks/0108_825_108825699_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_825_108825699_qa_3/environment/pull_bucket.py +++ b/tasks/0108_825_108825699_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_825_108825699_qa_3/task.toml b/tasks/0108_825_108825699_qa_3/task.toml index 5eddebdb449f4b94732011c867fa0dda7f47e399..e6d17120327bd6d99b2084001075f2d710c3693e 100644 --- a/tasks/0108_825_108825699_qa_3/task.toml +++ b/tasks/0108_825_108825699_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_835_108835715_qa_4/environment/bootstrap.sh b/tasks/0108_835_108835715_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_835_108835715_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_835_108835715_qa_4/environment/pull_bucket.py b/tasks/0108_835_108835715_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_835_108835715_qa_4/environment/pull_bucket.py +++ b/tasks/0108_835_108835715_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_835_108835715_qa_4/task.toml b/tasks/0108_835_108835715_qa_4/task.toml index 2ce81821a5e3cf8df3a032c3760c8a8e734ed878..0c1e0a1c19e1afeffe1b465b66ff0b22eb783f78 100644 --- a/tasks/0108_835_108835715_qa_4/task.toml +++ b/tasks/0108_835_108835715_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_835_108835715_qa_5/environment/bootstrap.sh b/tasks/0108_835_108835715_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_835_108835715_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_835_108835715_qa_5/environment/pull_bucket.py b/tasks/0108_835_108835715_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_835_108835715_qa_5/environment/pull_bucket.py +++ b/tasks/0108_835_108835715_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_835_108835715_qa_5/task.toml b/tasks/0108_835_108835715_qa_5/task.toml index 8b4b23c07b11d8d949d4d59f309e06f9afe19592..a871b9c4b156fc0e5f5081dc72f21f475b1c7f6b 100644 --- a/tasks/0108_835_108835715_qa_5/task.toml +++ b/tasks/0108_835_108835715_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_842_108842160_qa_4/environment/bootstrap.sh b/tasks/0108_842_108842160_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_842_108842160_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_842_108842160_qa_4/environment/pull_bucket.py b/tasks/0108_842_108842160_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_842_108842160_qa_4/environment/pull_bucket.py +++ b/tasks/0108_842_108842160_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_842_108842160_qa_4/task.toml b/tasks/0108_842_108842160_qa_4/task.toml index ab559da3f3d4e030824eb68f50b45397c3a75d03..943f4444eef542df128884030b35a5db47d90d90 100644 --- a/tasks/0108_842_108842160_qa_4/task.toml +++ b/tasks/0108_842_108842160_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_883_108883493_qa_1/environment/bootstrap.sh b/tasks/0108_883_108883493_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_883_108883493_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_883_108883493_qa_1/environment/pull_bucket.py b/tasks/0108_883_108883493_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_883_108883493_qa_1/environment/pull_bucket.py +++ b/tasks/0108_883_108883493_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_883_108883493_qa_1/task.toml b/tasks/0108_883_108883493_qa_1/task.toml index 37eff8bf4fc211139ee45d1c08c74e5b36fd819f..6b19c13ffef3eb5fc9f6b61619b193352bf41da7 100644 --- a/tasks/0108_883_108883493_qa_1/task.toml +++ b/tasks/0108_883_108883493_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_883_108883493_qa_4/environment/bootstrap.sh b/tasks/0108_883_108883493_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_883_108883493_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_883_108883493_qa_4/environment/pull_bucket.py b/tasks/0108_883_108883493_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_883_108883493_qa_4/environment/pull_bucket.py +++ b/tasks/0108_883_108883493_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_883_108883493_qa_4/task.toml b/tasks/0108_883_108883493_qa_4/task.toml index 487224656a6da7c7b3df338f30acb147db392f9c..fd7a39240752ba65b549d84b79d2b9b5add28158 100644 --- a/tasks/0108_883_108883493_qa_4/task.toml +++ b/tasks/0108_883_108883493_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_986_108986276_qa_1/environment/bootstrap.sh b/tasks/0108_986_108986276_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_986_108986276_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_986_108986276_qa_1/environment/pull_bucket.py b/tasks/0108_986_108986276_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_986_108986276_qa_1/environment/pull_bucket.py +++ b/tasks/0108_986_108986276_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_986_108986276_qa_1/task.toml b/tasks/0108_986_108986276_qa_1/task.toml index 4fa55e051f7642d93485c7333b6221f8124b042e..ee710601271d8cc505a971fd3cf43863609a2867 100644 --- a/tasks/0108_986_108986276_qa_1/task.toml +++ b/tasks/0108_986_108986276_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0108_986_108986276_qa_3/environment/bootstrap.sh b/tasks/0108_986_108986276_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0108_986_108986276_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0108_986_108986276_qa_3/environment/pull_bucket.py b/tasks/0108_986_108986276_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0108_986_108986276_qa_3/environment/pull_bucket.py +++ b/tasks/0108_986_108986276_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0108_986_108986276_qa_3/task.toml b/tasks/0108_986_108986276_qa_3/task.toml index c9b49074559ec688d76f66f41d81664e43ed6c94..ccf0871306e5426992022fcdb8530c6c7d61ac69 100644 --- a/tasks/0108_986_108986276_qa_3/task.toml +++ b/tasks/0108_986_108986276_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_027_109027351_qa_1/environment/bootstrap.sh b/tasks/0109_027_109027351_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_027_109027351_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_027_109027351_qa_1/environment/pull_bucket.py b/tasks/0109_027_109027351_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_027_109027351_qa_1/environment/pull_bucket.py +++ b/tasks/0109_027_109027351_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_027_109027351_qa_1/task.toml b/tasks/0109_027_109027351_qa_1/task.toml index da4ba09b36ff2bced4011cd556043b8aa4b4961c..616329ae582cb3d830f05888e5def65f12a96983 100644 --- a/tasks/0109_027_109027351_qa_1/task.toml +++ b/tasks/0109_027_109027351_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_079_109079153_qa_1/environment/bootstrap.sh b/tasks/0109_079_109079153_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_079_109079153_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_079_109079153_qa_1/environment/pull_bucket.py b/tasks/0109_079_109079153_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_079_109079153_qa_1/environment/pull_bucket.py +++ b/tasks/0109_079_109079153_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_079_109079153_qa_1/task.toml b/tasks/0109_079_109079153_qa_1/task.toml index cf5283a4db6be9a8caca86def8a4599a39fd09de..621b2667dd0ede6adc150a41a7fd7a37107eea02 100644 --- a/tasks/0109_079_109079153_qa_1/task.toml +++ b/tasks/0109_079_109079153_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_091_109091369_qa_5/environment/bootstrap.sh b/tasks/0109_091_109091369_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_091_109091369_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_091_109091369_qa_5/environment/pull_bucket.py b/tasks/0109_091_109091369_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_091_109091369_qa_5/environment/pull_bucket.py +++ b/tasks/0109_091_109091369_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_091_109091369_qa_5/task.toml b/tasks/0109_091_109091369_qa_5/task.toml index 80eeb8c4b103a9645422a63bf7ce5aeee4c8dc00..9546db9f73aa4ddb744f867756b760744446e491 100644 --- a/tasks/0109_091_109091369_qa_5/task.toml +++ b/tasks/0109_091_109091369_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_165_109165906_qa_3/environment/bootstrap.sh b/tasks/0109_165_109165906_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_165_109165906_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_165_109165906_qa_3/environment/pull_bucket.py b/tasks/0109_165_109165906_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_165_109165906_qa_3/environment/pull_bucket.py +++ b/tasks/0109_165_109165906_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_165_109165906_qa_3/task.toml b/tasks/0109_165_109165906_qa_3/task.toml index 03362716562d1b5ad78dba37306dcb7bc488028e..12a7867c9b82dd451a759a2f5066f3e2a6568835 100644 --- a/tasks/0109_165_109165906_qa_3/task.toml +++ b/tasks/0109_165_109165906_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_211_109211049_qa_1/environment/bootstrap.sh b/tasks/0109_211_109211049_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_211_109211049_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_211_109211049_qa_1/environment/pull_bucket.py b/tasks/0109_211_109211049_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_211_109211049_qa_1/environment/pull_bucket.py +++ b/tasks/0109_211_109211049_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_211_109211049_qa_1/task.toml b/tasks/0109_211_109211049_qa_1/task.toml index eb40a1712afc56f3d6bdacaf6a3cfd070c28e59b..a46df9075f80cd4bd872d39a035039a0fc31ecb3 100644 --- a/tasks/0109_211_109211049_qa_1/task.toml +++ b/tasks/0109_211_109211049_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_211_109211049_qa_5/environment/bootstrap.sh b/tasks/0109_211_109211049_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_211_109211049_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_211_109211049_qa_5/environment/pull_bucket.py b/tasks/0109_211_109211049_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_211_109211049_qa_5/environment/pull_bucket.py +++ b/tasks/0109_211_109211049_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_211_109211049_qa_5/task.toml b/tasks/0109_211_109211049_qa_5/task.toml index 46b29e08aeda97e7ded9acf3a628de8cacdd6a89..5add3374d8b06410d8b8b20ad30e12be37f5fe68 100644 --- a/tasks/0109_211_109211049_qa_5/task.toml +++ b/tasks/0109_211_109211049_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_269_109269793_qa_1/environment/bootstrap.sh b/tasks/0109_269_109269793_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_269_109269793_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_269_109269793_qa_1/environment/pull_bucket.py b/tasks/0109_269_109269793_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_269_109269793_qa_1/environment/pull_bucket.py +++ b/tasks/0109_269_109269793_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_269_109269793_qa_1/task.toml b/tasks/0109_269_109269793_qa_1/task.toml index 94d2d3f829b8bf8ce8b985f3b0943247055a106d..efad465e2e5ecbc900369ed8eaf7b3a9dc9d6372 100644 --- a/tasks/0109_269_109269793_qa_1/task.toml +++ b/tasks/0109_269_109269793_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_269_109269793_qa_5/environment/bootstrap.sh b/tasks/0109_269_109269793_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_269_109269793_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_269_109269793_qa_5/environment/pull_bucket.py b/tasks/0109_269_109269793_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_269_109269793_qa_5/environment/pull_bucket.py +++ b/tasks/0109_269_109269793_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_269_109269793_qa_5/task.toml b/tasks/0109_269_109269793_qa_5/task.toml index 9523792b5a9f7c9a0c5d23083e31280e9d1da226..2ef40590cf5a2f46ffd47f6a0ce97d33e2a3f4ae 100644 --- a/tasks/0109_269_109269793_qa_5/task.toml +++ b/tasks/0109_269_109269793_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_303_109303873_qa_1/environment/bootstrap.sh b/tasks/0109_303_109303873_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_303_109303873_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_303_109303873_qa_1/environment/pull_bucket.py b/tasks/0109_303_109303873_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_303_109303873_qa_1/environment/pull_bucket.py +++ b/tasks/0109_303_109303873_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_303_109303873_qa_1/task.toml b/tasks/0109_303_109303873_qa_1/task.toml index eff2f0f9fbe4fc1d360c6b8a202663344e55bcab..751ebae9ec3fc6bf36b5b3358db3c3047d62dd84 100644 --- a/tasks/0109_303_109303873_qa_1/task.toml +++ b/tasks/0109_303_109303873_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_303_109303873_qa_2/environment/bootstrap.sh b/tasks/0109_303_109303873_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_303_109303873_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_303_109303873_qa_2/environment/pull_bucket.py b/tasks/0109_303_109303873_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_303_109303873_qa_2/environment/pull_bucket.py +++ b/tasks/0109_303_109303873_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_303_109303873_qa_2/task.toml b/tasks/0109_303_109303873_qa_2/task.toml index 117bbecf94ab67234b19a429a9c63a74b2b08811..b6d2be22c1481736a9fd67a2d28730baef7de9b8 100644 --- a/tasks/0109_303_109303873_qa_2/task.toml +++ b/tasks/0109_303_109303873_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_303_109303873_qa_3/environment/bootstrap.sh b/tasks/0109_303_109303873_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_303_109303873_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_303_109303873_qa_3/environment/pull_bucket.py b/tasks/0109_303_109303873_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_303_109303873_qa_3/environment/pull_bucket.py +++ b/tasks/0109_303_109303873_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_303_109303873_qa_3/task.toml b/tasks/0109_303_109303873_qa_3/task.toml index bd92b5bf32cef5aa3a9b7be3e1c75ac613383268..69887fcfbd2b6cfd30017e01ffc9713046bf55ee 100644 --- a/tasks/0109_303_109303873_qa_3/task.toml +++ b/tasks/0109_303_109303873_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_303_109303873_qa_5/environment/bootstrap.sh b/tasks/0109_303_109303873_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_303_109303873_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_303_109303873_qa_5/environment/pull_bucket.py b/tasks/0109_303_109303873_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_303_109303873_qa_5/environment/pull_bucket.py +++ b/tasks/0109_303_109303873_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_303_109303873_qa_5/task.toml b/tasks/0109_303_109303873_qa_5/task.toml index 0422777ab0e82bde8d9a0890003a79f2b21bc275..5f774cd5921fbec793d68c7759d027d0483a7e81 100644 --- a/tasks/0109_303_109303873_qa_5/task.toml +++ b/tasks/0109_303_109303873_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_375_109375313_qa_4/environment/bootstrap.sh b/tasks/0109_375_109375313_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_375_109375313_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_375_109375313_qa_4/environment/pull_bucket.py b/tasks/0109_375_109375313_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_375_109375313_qa_4/environment/pull_bucket.py +++ b/tasks/0109_375_109375313_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_375_109375313_qa_4/task.toml b/tasks/0109_375_109375313_qa_4/task.toml index 781dd0a63010c424de876e08baf1d6cde9eae149..1b5cd98255805c68442072a944f6b111e5789fbd 100644 --- a/tasks/0109_375_109375313_qa_4/task.toml +++ b/tasks/0109_375_109375313_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_422_109422676_qa_3/environment/bootstrap.sh b/tasks/0109_422_109422676_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_422_109422676_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_422_109422676_qa_3/environment/pull_bucket.py b/tasks/0109_422_109422676_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_422_109422676_qa_3/environment/pull_bucket.py +++ b/tasks/0109_422_109422676_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_422_109422676_qa_3/task.toml b/tasks/0109_422_109422676_qa_3/task.toml index 346553a6906474eef04cf46fb322c7a37742f4cb..79390e50e1504a08f67a96f49f6a5e229b084db2 100644 --- a/tasks/0109_422_109422676_qa_3/task.toml +++ b/tasks/0109_422_109422676_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_422_109422676_qa_4/environment/bootstrap.sh b/tasks/0109_422_109422676_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_422_109422676_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_422_109422676_qa_4/environment/pull_bucket.py b/tasks/0109_422_109422676_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_422_109422676_qa_4/environment/pull_bucket.py +++ b/tasks/0109_422_109422676_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_422_109422676_qa_4/task.toml b/tasks/0109_422_109422676_qa_4/task.toml index c7a85b088a29fa2da235cab73f6fb54951fbbf5d..ef0a508631d9c1745c6aa6fa652d229a9d50b860 100644 --- a/tasks/0109_422_109422676_qa_4/task.toml +++ b/tasks/0109_422_109422676_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_442_109442355_qa_4/environment/bootstrap.sh b/tasks/0109_442_109442355_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_442_109442355_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_442_109442355_qa_4/environment/pull_bucket.py b/tasks/0109_442_109442355_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_442_109442355_qa_4/environment/pull_bucket.py +++ b/tasks/0109_442_109442355_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_442_109442355_qa_4/task.toml b/tasks/0109_442_109442355_qa_4/task.toml index a30ac0df739b35fd4ea53fdea332a53043ae31cc..d0625ead26708a6f1848509c022d60ce382eeafc 100644 --- a/tasks/0109_442_109442355_qa_4/task.toml +++ b/tasks/0109_442_109442355_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_469_109469247_qa_1/environment/bootstrap.sh b/tasks/0109_469_109469247_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_469_109469247_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_469_109469247_qa_1/environment/pull_bucket.py b/tasks/0109_469_109469247_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_469_109469247_qa_1/environment/pull_bucket.py +++ b/tasks/0109_469_109469247_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_469_109469247_qa_1/task.toml b/tasks/0109_469_109469247_qa_1/task.toml index 78f7a262d4f6974c27d39fbe508cf34f7fcdd39d..9a2bf453db6cd6b2bd9fa0fcbf7c70fff9291820 100644 --- a/tasks/0109_469_109469247_qa_1/task.toml +++ b/tasks/0109_469_109469247_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_469_109469247_qa_3/environment/bootstrap.sh b/tasks/0109_469_109469247_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_469_109469247_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_469_109469247_qa_3/environment/pull_bucket.py b/tasks/0109_469_109469247_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_469_109469247_qa_3/environment/pull_bucket.py +++ b/tasks/0109_469_109469247_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_469_109469247_qa_3/task.toml b/tasks/0109_469_109469247_qa_3/task.toml index 7592253ce005a9f4fd5bbf28eaabc09c6327c399..27e0dde1fc78324a154fc47501bdfb41b35f584e 100644 --- a/tasks/0109_469_109469247_qa_3/task.toml +++ b/tasks/0109_469_109469247_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_525_109525152_qa_1/environment/bootstrap.sh b/tasks/0109_525_109525152_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_525_109525152_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_525_109525152_qa_1/environment/pull_bucket.py b/tasks/0109_525_109525152_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_525_109525152_qa_1/environment/pull_bucket.py +++ b/tasks/0109_525_109525152_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_525_109525152_qa_1/task.toml b/tasks/0109_525_109525152_qa_1/task.toml index 48b421a6d959a2386b422cf9d701a65834ff6845..0e1b85198d1c30284576366328662430a3159295 100644 --- a/tasks/0109_525_109525152_qa_1/task.toml +++ b/tasks/0109_525_109525152_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_666_109666127_qa_1/environment/bootstrap.sh b/tasks/0109_666_109666127_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_666_109666127_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_666_109666127_qa_1/environment/pull_bucket.py b/tasks/0109_666_109666127_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_666_109666127_qa_1/environment/pull_bucket.py +++ b/tasks/0109_666_109666127_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_666_109666127_qa_1/task.toml b/tasks/0109_666_109666127_qa_1/task.toml index ee7aaa4de8740785b2bc6619a1f4d662a1c76045..04b1e3f8168f9858b886982aa1f1a681d23cb119 100644 --- a/tasks/0109_666_109666127_qa_1/task.toml +++ b/tasks/0109_666_109666127_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_683_109683499_qa_2/environment/bootstrap.sh b/tasks/0109_683_109683499_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_683_109683499_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_683_109683499_qa_2/environment/pull_bucket.py b/tasks/0109_683_109683499_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_683_109683499_qa_2/environment/pull_bucket.py +++ b/tasks/0109_683_109683499_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_683_109683499_qa_2/task.toml b/tasks/0109_683_109683499_qa_2/task.toml index d5200cc232fa629ecbecb740f257b722ff8174a7..cc34e65a6fa5ffa7cb3b43dccb32f23286bb7f14 100644 --- a/tasks/0109_683_109683499_qa_2/task.toml +++ b/tasks/0109_683_109683499_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_683_109683499_qa_4/environment/bootstrap.sh b/tasks/0109_683_109683499_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_683_109683499_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_683_109683499_qa_4/environment/pull_bucket.py b/tasks/0109_683_109683499_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_683_109683499_qa_4/environment/pull_bucket.py +++ b/tasks/0109_683_109683499_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_683_109683499_qa_4/task.toml b/tasks/0109_683_109683499_qa_4/task.toml index aba4fc6f49e1b9deea7393e0875758cf3c90b7b0..2a188ced7ff4d28e3f360f97eead997c097bd205 100644 --- a/tasks/0109_683_109683499_qa_4/task.toml +++ b/tasks/0109_683_109683499_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_856_109856610_qa_3/environment/bootstrap.sh b/tasks/0109_856_109856610_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_856_109856610_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_856_109856610_qa_3/environment/pull_bucket.py b/tasks/0109_856_109856610_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_856_109856610_qa_3/environment/pull_bucket.py +++ b/tasks/0109_856_109856610_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_856_109856610_qa_3/task.toml b/tasks/0109_856_109856610_qa_3/task.toml index b846716cb4aa73f067078f73b8d814a7086900be..12146d50d500e1c9f799efd1c99fd77c7a48a0e1 100644 --- a/tasks/0109_856_109856610_qa_3/task.toml +++ b/tasks/0109_856_109856610_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_856_109856610_qa_4/environment/bootstrap.sh b/tasks/0109_856_109856610_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_856_109856610_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_856_109856610_qa_4/environment/pull_bucket.py b/tasks/0109_856_109856610_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_856_109856610_qa_4/environment/pull_bucket.py +++ b/tasks/0109_856_109856610_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_856_109856610_qa_4/task.toml b/tasks/0109_856_109856610_qa_4/task.toml index 6766809a2d3d772983a12c7c506f8082be870ec1..1dd8cd92fbf0b1dfced972a1bc87873ba7ab828f 100644 --- a/tasks/0109_856_109856610_qa_4/task.toml +++ b/tasks/0109_856_109856610_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_878_109878873_qa_3/environment/bootstrap.sh b/tasks/0109_878_109878873_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_878_109878873_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_878_109878873_qa_3/environment/pull_bucket.py b/tasks/0109_878_109878873_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_878_109878873_qa_3/environment/pull_bucket.py +++ b/tasks/0109_878_109878873_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_878_109878873_qa_3/task.toml b/tasks/0109_878_109878873_qa_3/task.toml index e337bd79838357558cf8f4c2f3e5bec9a0c42e0d..eaac7b11505b7d68612d103ca7fcb7b559860252 100644 --- a/tasks/0109_878_109878873_qa_3/task.toml +++ b/tasks/0109_878_109878873_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_914_109914712_qa_2/environment/bootstrap.sh b/tasks/0109_914_109914712_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_914_109914712_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_914_109914712_qa_2/environment/pull_bucket.py b/tasks/0109_914_109914712_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_914_109914712_qa_2/environment/pull_bucket.py +++ b/tasks/0109_914_109914712_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_914_109914712_qa_2/task.toml b/tasks/0109_914_109914712_qa_2/task.toml index b9bc9d626468d9bf435401d99194c33694b16d5a..5525cae6401e44b16ea4806e8f7d588e4a47fa70 100644 --- a/tasks/0109_914_109914712_qa_2/task.toml +++ b/tasks/0109_914_109914712_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_958_109958191_qa_1/environment/bootstrap.sh b/tasks/0109_958_109958191_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_958_109958191_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_958_109958191_qa_1/environment/pull_bucket.py b/tasks/0109_958_109958191_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_958_109958191_qa_1/environment/pull_bucket.py +++ b/tasks/0109_958_109958191_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_958_109958191_qa_1/task.toml b/tasks/0109_958_109958191_qa_1/task.toml index c0b69efdcf5e5b2d4075e6167b4744e774d0e61c..a4195e40286fd85025e786f6645fd5f09b8d1c03 100644 --- a/tasks/0109_958_109958191_qa_1/task.toml +++ b/tasks/0109_958_109958191_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0109_958_109958191_qa_4/environment/bootstrap.sh b/tasks/0109_958_109958191_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0109_958_109958191_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0109_958_109958191_qa_4/environment/pull_bucket.py b/tasks/0109_958_109958191_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0109_958_109958191_qa_4/environment/pull_bucket.py +++ b/tasks/0109_958_109958191_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0109_958_109958191_qa_4/task.toml b/tasks/0109_958_109958191_qa_4/task.toml index 24908749894bf90d1798d871075a85333ea081a5..74ec41c61ebfd55accf31275a798d0d27ef7c7a4 100644 --- a/tasks/0109_958_109958191_qa_4/task.toml +++ b/tasks/0109_958_109958191_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_144_110144253_qa_1/environment/bootstrap.sh b/tasks/0110_144_110144253_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_144_110144253_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_144_110144253_qa_1/environment/pull_bucket.py b/tasks/0110_144_110144253_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_144_110144253_qa_1/environment/pull_bucket.py +++ b/tasks/0110_144_110144253_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_144_110144253_qa_1/task.toml b/tasks/0110_144_110144253_qa_1/task.toml index 98c2e353bc2b55ea59e380304d8e43d73866fc4d..d2297ee209f6767a235deae51b2376b464b530eb 100644 --- a/tasks/0110_144_110144253_qa_1/task.toml +++ b/tasks/0110_144_110144253_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_147_110147085_qa_1/environment/bootstrap.sh b/tasks/0110_147_110147085_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_147_110147085_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_147_110147085_qa_1/environment/pull_bucket.py b/tasks/0110_147_110147085_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_147_110147085_qa_1/environment/pull_bucket.py +++ b/tasks/0110_147_110147085_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_147_110147085_qa_1/task.toml b/tasks/0110_147_110147085_qa_1/task.toml index 35a932c7cfd5a318ac662e37ae079fb2ab964ed6..d258415b6bb7e73b69652cd59ba44cd6c4131c06 100644 --- a/tasks/0110_147_110147085_qa_1/task.toml +++ b/tasks/0110_147_110147085_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_251_110251901_qa_1/environment/bootstrap.sh b/tasks/0110_251_110251901_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_251_110251901_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_251_110251901_qa_1/environment/pull_bucket.py b/tasks/0110_251_110251901_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_251_110251901_qa_1/environment/pull_bucket.py +++ b/tasks/0110_251_110251901_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_251_110251901_qa_1/task.toml b/tasks/0110_251_110251901_qa_1/task.toml index c7bbc5fd9f6c953097d8306065651b3248c48ae8..770ea47969f68fa3586787d9cc6f65fc9c21a878 100644 --- a/tasks/0110_251_110251901_qa_1/task.toml +++ b/tasks/0110_251_110251901_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_336_110336041_qa_2/environment/bootstrap.sh b/tasks/0110_336_110336041_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_336_110336041_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_336_110336041_qa_2/environment/pull_bucket.py b/tasks/0110_336_110336041_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_336_110336041_qa_2/environment/pull_bucket.py +++ b/tasks/0110_336_110336041_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_336_110336041_qa_2/task.toml b/tasks/0110_336_110336041_qa_2/task.toml index 35a8ea988b111a727f72e941b4a05b69a5284c71..f2d5f01a487fe14a10d894e41e604ed0088c25da 100644 --- a/tasks/0110_336_110336041_qa_2/task.toml +++ b/tasks/0110_336_110336041_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_344_110344400_qa_1/environment/bootstrap.sh b/tasks/0110_344_110344400_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_344_110344400_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_344_110344400_qa_1/environment/pull_bucket.py b/tasks/0110_344_110344400_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_344_110344400_qa_1/environment/pull_bucket.py +++ b/tasks/0110_344_110344400_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_344_110344400_qa_1/task.toml b/tasks/0110_344_110344400_qa_1/task.toml index 7d2998f08670edf993ee41dfa789b1a78f5b9185..179b231a8ae3f9979d179857058ca55f02d2b8ff 100644 --- a/tasks/0110_344_110344400_qa_1/task.toml +++ b/tasks/0110_344_110344400_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_384_110384053_qa_1/environment/bootstrap.sh b/tasks/0110_384_110384053_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_384_110384053_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_384_110384053_qa_1/environment/pull_bucket.py b/tasks/0110_384_110384053_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_384_110384053_qa_1/environment/pull_bucket.py +++ b/tasks/0110_384_110384053_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_384_110384053_qa_1/task.toml b/tasks/0110_384_110384053_qa_1/task.toml index 896c137900d1e71ba1dbe4104e4436f3c6092404..ad529abba34ddd4ce978851f92330f752233ffe9 100644 --- a/tasks/0110_384_110384053_qa_1/task.toml +++ b/tasks/0110_384_110384053_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_384_110384053_qa_4/environment/bootstrap.sh b/tasks/0110_384_110384053_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_384_110384053_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_384_110384053_qa_4/environment/pull_bucket.py b/tasks/0110_384_110384053_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_384_110384053_qa_4/environment/pull_bucket.py +++ b/tasks/0110_384_110384053_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_384_110384053_qa_4/task.toml b/tasks/0110_384_110384053_qa_4/task.toml index 478b1698f5a38fe2cea49ae4f0c04f658bd427ff..c75e1d881adf443587eefdf3ef33876a5205018d 100644 --- a/tasks/0110_384_110384053_qa_4/task.toml +++ b/tasks/0110_384_110384053_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_391_110391161_qa_2/environment/bootstrap.sh b/tasks/0110_391_110391161_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_391_110391161_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_391_110391161_qa_2/environment/pull_bucket.py b/tasks/0110_391_110391161_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_391_110391161_qa_2/environment/pull_bucket.py +++ b/tasks/0110_391_110391161_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_391_110391161_qa_2/task.toml b/tasks/0110_391_110391161_qa_2/task.toml index 1787feaa2c4c105b69976c7738c77dac49ec61d6..8ca9a5d79836911d62c07b3d759fbeac00e9d461 100644 --- a/tasks/0110_391_110391161_qa_2/task.toml +++ b/tasks/0110_391_110391161_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_400_110400034_qa_1/environment/bootstrap.sh b/tasks/0110_400_110400034_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_400_110400034_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_400_110400034_qa_1/environment/pull_bucket.py b/tasks/0110_400_110400034_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_400_110400034_qa_1/environment/pull_bucket.py +++ b/tasks/0110_400_110400034_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_400_110400034_qa_1/task.toml b/tasks/0110_400_110400034_qa_1/task.toml index 27d0c4ecc42a1a8df1a2cfc069770104714cf93d..ee6759533dc6396ce79d3ef2c7c4ff520fb432dc 100644 --- a/tasks/0110_400_110400034_qa_1/task.toml +++ b/tasks/0110_400_110400034_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_400_110400034_qa_5/environment/bootstrap.sh b/tasks/0110_400_110400034_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_400_110400034_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_400_110400034_qa_5/environment/pull_bucket.py b/tasks/0110_400_110400034_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_400_110400034_qa_5/environment/pull_bucket.py +++ b/tasks/0110_400_110400034_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_400_110400034_qa_5/task.toml b/tasks/0110_400_110400034_qa_5/task.toml index 0b360fa79be7705de7759b2be5eb1cf80f0fd3e3..c4f0a8ba064d5fb9edf4d5a5a7dca836ef61ca14 100644 --- a/tasks/0110_400_110400034_qa_5/task.toml +++ b/tasks/0110_400_110400034_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_432_110432344_qa_4/environment/bootstrap.sh b/tasks/0110_432_110432344_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_432_110432344_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_432_110432344_qa_4/environment/pull_bucket.py b/tasks/0110_432_110432344_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_432_110432344_qa_4/environment/pull_bucket.py +++ b/tasks/0110_432_110432344_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_432_110432344_qa_4/task.toml b/tasks/0110_432_110432344_qa_4/task.toml index 88c84d6eddbf22e117e4a78748b8ae63445e5d18..79b978f72e396ff3f7f5bde0d0a55232547239f6 100644 --- a/tasks/0110_432_110432344_qa_4/task.toml +++ b/tasks/0110_432_110432344_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_445_110445671_qa_4/environment/bootstrap.sh b/tasks/0110_445_110445671_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_445_110445671_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_445_110445671_qa_4/environment/pull_bucket.py b/tasks/0110_445_110445671_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_445_110445671_qa_4/environment/pull_bucket.py +++ b/tasks/0110_445_110445671_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_445_110445671_qa_4/task.toml b/tasks/0110_445_110445671_qa_4/task.toml index bae1f264436975711e672a01a3b9c39c7629dccd..948a75a00cc7219940bb1a0b6310f13b06fd0a9a 100644 --- a/tasks/0110_445_110445671_qa_4/task.toml +++ b/tasks/0110_445_110445671_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_445_110445671_qa_5/environment/bootstrap.sh b/tasks/0110_445_110445671_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_445_110445671_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_445_110445671_qa_5/environment/pull_bucket.py b/tasks/0110_445_110445671_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_445_110445671_qa_5/environment/pull_bucket.py +++ b/tasks/0110_445_110445671_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_445_110445671_qa_5/task.toml b/tasks/0110_445_110445671_qa_5/task.toml index 47b9e0d16589d13a93cb35bd46fdf65c76e6be06..34dcc19cfb5bb6675484746ff5aa9dee160c5936 100644 --- a/tasks/0110_445_110445671_qa_5/task.toml +++ b/tasks/0110_445_110445671_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_464_110464682_qa_1/environment/bootstrap.sh b/tasks/0110_464_110464682_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_464_110464682_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_464_110464682_qa_1/environment/pull_bucket.py b/tasks/0110_464_110464682_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_464_110464682_qa_1/environment/pull_bucket.py +++ b/tasks/0110_464_110464682_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_464_110464682_qa_1/task.toml b/tasks/0110_464_110464682_qa_1/task.toml index 76572406a6cf31f83ed59f1c278af3ebfb7f7787..9abb4dfbabd9e5d807a18ca1383f0c9d58c4401c 100644 --- a/tasks/0110_464_110464682_qa_1/task.toml +++ b/tasks/0110_464_110464682_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_464_110464682_qa_2/environment/bootstrap.sh b/tasks/0110_464_110464682_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_464_110464682_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_464_110464682_qa_2/environment/pull_bucket.py b/tasks/0110_464_110464682_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_464_110464682_qa_2/environment/pull_bucket.py +++ b/tasks/0110_464_110464682_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_464_110464682_qa_2/task.toml b/tasks/0110_464_110464682_qa_2/task.toml index 9a1313b52ace928a6cf8432f50615900f085916e..246bc1515825912d0bf75e4a7642e7289d9605ab 100644 --- a/tasks/0110_464_110464682_qa_2/task.toml +++ b/tasks/0110_464_110464682_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_500_110500611_qa_3/environment/bootstrap.sh b/tasks/0110_500_110500611_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_500_110500611_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_500_110500611_qa_3/environment/pull_bucket.py b/tasks/0110_500_110500611_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_500_110500611_qa_3/environment/pull_bucket.py +++ b/tasks/0110_500_110500611_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_500_110500611_qa_3/task.toml b/tasks/0110_500_110500611_qa_3/task.toml index 3702acec09cb322c0e6534c65bf333e2195431e1..7c6967b7b6cf58f819351f77421c4d45e1b7df7b 100644 --- a/tasks/0110_500_110500611_qa_3/task.toml +++ b/tasks/0110_500_110500611_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_531_110531781_qa_1/environment/bootstrap.sh b/tasks/0110_531_110531781_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_531_110531781_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_531_110531781_qa_1/environment/pull_bucket.py b/tasks/0110_531_110531781_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_531_110531781_qa_1/environment/pull_bucket.py +++ b/tasks/0110_531_110531781_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_531_110531781_qa_1/task.toml b/tasks/0110_531_110531781_qa_1/task.toml index c610b27f5515487ee7bd41fd2fe0e15ac2c7778a..4039b5c1b1abba82b0f3b94e1de7629adc4f9d7c 100644 --- a/tasks/0110_531_110531781_qa_1/task.toml +++ b/tasks/0110_531_110531781_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_563_110563506_qa_1/environment/bootstrap.sh b/tasks/0110_563_110563506_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_563_110563506_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_563_110563506_qa_1/environment/pull_bucket.py b/tasks/0110_563_110563506_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_563_110563506_qa_1/environment/pull_bucket.py +++ b/tasks/0110_563_110563506_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_563_110563506_qa_1/task.toml b/tasks/0110_563_110563506_qa_1/task.toml index 234b6396100f1665ec0635c6dbb6c30af20dc2c1..86bfedc05bfccbe25c679f226eb7d3012c66e093 100644 --- a/tasks/0110_563_110563506_qa_1/task.toml +++ b/tasks/0110_563_110563506_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_563_110563506_qa_5/environment/bootstrap.sh b/tasks/0110_563_110563506_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_563_110563506_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_563_110563506_qa_5/environment/pull_bucket.py b/tasks/0110_563_110563506_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_563_110563506_qa_5/environment/pull_bucket.py +++ b/tasks/0110_563_110563506_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_563_110563506_qa_5/task.toml b/tasks/0110_563_110563506_qa_5/task.toml index 01c028cdcaed817c532233be929c94378aad727c..b8f46aba9f5dacee8aa99fd23dfeb25dce1f71d1 100644 --- a/tasks/0110_563_110563506_qa_5/task.toml +++ b/tasks/0110_563_110563506_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_597_110597362_qa_1/environment/bootstrap.sh b/tasks/0110_597_110597362_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_597_110597362_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_597_110597362_qa_1/environment/pull_bucket.py b/tasks/0110_597_110597362_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_597_110597362_qa_1/environment/pull_bucket.py +++ b/tasks/0110_597_110597362_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_597_110597362_qa_1/task.toml b/tasks/0110_597_110597362_qa_1/task.toml index 1b3206b36eb3a0ea1b343a08b2f06cba73326edb..a3055e4e47791b1f0c4d03950ea0c919f94d571b 100644 --- a/tasks/0110_597_110597362_qa_1/task.toml +++ b/tasks/0110_597_110597362_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_612_110612327_qa_4/environment/bootstrap.sh b/tasks/0110_612_110612327_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_612_110612327_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_612_110612327_qa_4/environment/pull_bucket.py b/tasks/0110_612_110612327_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_612_110612327_qa_4/environment/pull_bucket.py +++ b/tasks/0110_612_110612327_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_612_110612327_qa_4/task.toml b/tasks/0110_612_110612327_qa_4/task.toml index 1dc922f6d65a55fd0c73aa3f9f9304831de4bc8a..f2067c532f444739bbaeee03193ade783060bd21 100644 --- a/tasks/0110_612_110612327_qa_4/task.toml +++ b/tasks/0110_612_110612327_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_615_110615404_qa_2/environment/bootstrap.sh b/tasks/0110_615_110615404_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_615_110615404_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_615_110615404_qa_2/environment/pull_bucket.py b/tasks/0110_615_110615404_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_615_110615404_qa_2/environment/pull_bucket.py +++ b/tasks/0110_615_110615404_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_615_110615404_qa_2/task.toml b/tasks/0110_615_110615404_qa_2/task.toml index 7d807c0ccf765a35397eebafc45cc06ae9f554d0..35a8dfefae039a8ea584088fb8875adda73a320f 100644 --- a/tasks/0110_615_110615404_qa_2/task.toml +++ b/tasks/0110_615_110615404_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_615_110615404_qa_3/environment/bootstrap.sh b/tasks/0110_615_110615404_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_615_110615404_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_615_110615404_qa_3/environment/pull_bucket.py b/tasks/0110_615_110615404_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_615_110615404_qa_3/environment/pull_bucket.py +++ b/tasks/0110_615_110615404_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_615_110615404_qa_3/task.toml b/tasks/0110_615_110615404_qa_3/task.toml index b864bbb7d690207f1c9194fc77d70913806b14ea..8715495457b31c8bcd5468127fecee49f3c150a0 100644 --- a/tasks/0110_615_110615404_qa_3/task.toml +++ b/tasks/0110_615_110615404_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_622_110622713_qa_2/environment/bootstrap.sh b/tasks/0110_622_110622713_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_622_110622713_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_622_110622713_qa_2/environment/pull_bucket.py b/tasks/0110_622_110622713_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_622_110622713_qa_2/environment/pull_bucket.py +++ b/tasks/0110_622_110622713_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_622_110622713_qa_2/task.toml b/tasks/0110_622_110622713_qa_2/task.toml index 8b4f5f965914255b2d3fe359117a29f5bb3a7e12..601fd1bdee912b097a82786a3a213552b8463bea 100644 --- a/tasks/0110_622_110622713_qa_2/task.toml +++ b/tasks/0110_622_110622713_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_622_110622713_qa_3/environment/bootstrap.sh b/tasks/0110_622_110622713_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_622_110622713_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_622_110622713_qa_3/environment/pull_bucket.py b/tasks/0110_622_110622713_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_622_110622713_qa_3/environment/pull_bucket.py +++ b/tasks/0110_622_110622713_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_622_110622713_qa_3/task.toml b/tasks/0110_622_110622713_qa_3/task.toml index 93b246d4fa179ebf4c7e94a133a5050df7dfb81a..0fa54cc6eef2823e5bcef6f6c9c161e1af38f726 100644 --- a/tasks/0110_622_110622713_qa_3/task.toml +++ b/tasks/0110_622_110622713_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_664_110664620_qa_2/environment/bootstrap.sh b/tasks/0110_664_110664620_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_664_110664620_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_664_110664620_qa_2/environment/pull_bucket.py b/tasks/0110_664_110664620_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_664_110664620_qa_2/environment/pull_bucket.py +++ b/tasks/0110_664_110664620_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_664_110664620_qa_2/task.toml b/tasks/0110_664_110664620_qa_2/task.toml index 08f6b475b43a824e008bf419b3561a949b1febb3..ef281291b07138b390f110f6c7b75260491d35f8 100644 --- a/tasks/0110_664_110664620_qa_2/task.toml +++ b/tasks/0110_664_110664620_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_683_110683455_qa_2/environment/bootstrap.sh b/tasks/0110_683_110683455_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_683_110683455_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_683_110683455_qa_2/environment/pull_bucket.py b/tasks/0110_683_110683455_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_683_110683455_qa_2/environment/pull_bucket.py +++ b/tasks/0110_683_110683455_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_683_110683455_qa_2/task.toml b/tasks/0110_683_110683455_qa_2/task.toml index 61074c94e0cea26332af52e3377dc6fc7e50b2be..6105c9f4a0f39e546fa4fd176e8e7afb8ee67092 100644 --- a/tasks/0110_683_110683455_qa_2/task.toml +++ b/tasks/0110_683_110683455_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_717_110717363_qa_1/environment/bootstrap.sh b/tasks/0110_717_110717363_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_717_110717363_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_717_110717363_qa_1/environment/pull_bucket.py b/tasks/0110_717_110717363_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_717_110717363_qa_1/environment/pull_bucket.py +++ b/tasks/0110_717_110717363_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_717_110717363_qa_1/task.toml b/tasks/0110_717_110717363_qa_1/task.toml index 6b5b4018e43adbbbd529515df7cb4d75f5b6de6f..4d71427969dccb693c684068b1a82942e4c3ba0c 100644 --- a/tasks/0110_717_110717363_qa_1/task.toml +++ b/tasks/0110_717_110717363_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_717_110717969_qa_1/environment/bootstrap.sh b/tasks/0110_717_110717969_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_717_110717969_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_717_110717969_qa_1/environment/pull_bucket.py b/tasks/0110_717_110717969_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_717_110717969_qa_1/environment/pull_bucket.py +++ b/tasks/0110_717_110717969_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_717_110717969_qa_1/task.toml b/tasks/0110_717_110717969_qa_1/task.toml index a912636d4d316696f3cf107f77300197e9921187..4bec75c3afe055c4eb46314167e73e37483c6136 100644 --- a/tasks/0110_717_110717969_qa_1/task.toml +++ b/tasks/0110_717_110717969_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_731_110731547_qa_1/environment/bootstrap.sh b/tasks/0110_731_110731547_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_731_110731547_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_731_110731547_qa_1/environment/pull_bucket.py b/tasks/0110_731_110731547_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_731_110731547_qa_1/environment/pull_bucket.py +++ b/tasks/0110_731_110731547_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_731_110731547_qa_1/task.toml b/tasks/0110_731_110731547_qa_1/task.toml index 69ee08c6201b65b3e5a2311d859569a487947b98..168152d3e092b2971008c55b712d0350a4bdb3ba 100644 --- a/tasks/0110_731_110731547_qa_1/task.toml +++ b/tasks/0110_731_110731547_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_774_110774218_qa_3/environment/bootstrap.sh b/tasks/0110_774_110774218_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_774_110774218_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_774_110774218_qa_3/environment/pull_bucket.py b/tasks/0110_774_110774218_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_774_110774218_qa_3/environment/pull_bucket.py +++ b/tasks/0110_774_110774218_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_774_110774218_qa_3/task.toml b/tasks/0110_774_110774218_qa_3/task.toml index d0e1f62260fbf1b1438812addef892692fb677a7..cfd778a47160555c1d3a7baf01208b66be77c6e7 100644 --- a/tasks/0110_774_110774218_qa_3/task.toml +++ b/tasks/0110_774_110774218_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_787_110787771_qa_4/environment/bootstrap.sh b/tasks/0110_787_110787771_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_787_110787771_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_787_110787771_qa_4/environment/pull_bucket.py b/tasks/0110_787_110787771_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_787_110787771_qa_4/environment/pull_bucket.py +++ b/tasks/0110_787_110787771_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_787_110787771_qa_4/task.toml b/tasks/0110_787_110787771_qa_4/task.toml index ceccc793ea8611fd98e8ad97d548d4c37cb0ccf9..9a8f86f1dfda17e52a2d23df1c318d4833539407 100644 --- a/tasks/0110_787_110787771_qa_4/task.toml +++ b/tasks/0110_787_110787771_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_861_110861682_qa_5/environment/bootstrap.sh b/tasks/0110_861_110861682_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_861_110861682_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_861_110861682_qa_5/environment/pull_bucket.py b/tasks/0110_861_110861682_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_861_110861682_qa_5/environment/pull_bucket.py +++ b/tasks/0110_861_110861682_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_861_110861682_qa_5/task.toml b/tasks/0110_861_110861682_qa_5/task.toml index d6d90e31986f7d09d136a37bdddfa309fa4077c3..4c150fc31937e80acb3b23a94d2a15e4b5d842b7 100644 --- a/tasks/0110_861_110861682_qa_5/task.toml +++ b/tasks/0110_861_110861682_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_889_110889035_qa_1/environment/bootstrap.sh b/tasks/0110_889_110889035_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_889_110889035_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_889_110889035_qa_1/environment/pull_bucket.py b/tasks/0110_889_110889035_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_889_110889035_qa_1/environment/pull_bucket.py +++ b/tasks/0110_889_110889035_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_889_110889035_qa_1/task.toml b/tasks/0110_889_110889035_qa_1/task.toml index 32715d8d4c11a4e260e5c65558201373ea153040..f34fed7741a12dbd2d7080966a8c857a72c4001c 100644 --- a/tasks/0110_889_110889035_qa_1/task.toml +++ b/tasks/0110_889_110889035_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_890_110890415_qa_2/environment/bootstrap.sh b/tasks/0110_890_110890415_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_890_110890415_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_890_110890415_qa_2/environment/pull_bucket.py b/tasks/0110_890_110890415_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_890_110890415_qa_2/environment/pull_bucket.py +++ b/tasks/0110_890_110890415_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_890_110890415_qa_2/task.toml b/tasks/0110_890_110890415_qa_2/task.toml index ae8e438a2ea05c7eca1b6ba3ea302f9eab1b9b69..dc50860f941c0e103f2be51ec2923dc8459d1a05 100644 --- a/tasks/0110_890_110890415_qa_2/task.toml +++ b/tasks/0110_890_110890415_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_890_110890415_qa_5/environment/bootstrap.sh b/tasks/0110_890_110890415_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_890_110890415_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_890_110890415_qa_5/environment/pull_bucket.py b/tasks/0110_890_110890415_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_890_110890415_qa_5/environment/pull_bucket.py +++ b/tasks/0110_890_110890415_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_890_110890415_qa_5/task.toml b/tasks/0110_890_110890415_qa_5/task.toml index a66b5bdc5b336013c29a9a5ff5183527d7a15ffa..766bc0fd369f5203d0a4c7fda8c5abf407d054b6 100644 --- a/tasks/0110_890_110890415_qa_5/task.toml +++ b/tasks/0110_890_110890415_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_937_110937668_qa_1/environment/bootstrap.sh b/tasks/0110_937_110937668_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_937_110937668_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_937_110937668_qa_1/environment/pull_bucket.py b/tasks/0110_937_110937668_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_937_110937668_qa_1/environment/pull_bucket.py +++ b/tasks/0110_937_110937668_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_937_110937668_qa_1/task.toml b/tasks/0110_937_110937668_qa_1/task.toml index 99d750144b415ef5b8c64e27373721550f4f2b96..3fb8eb466f96c86db52431addc651d1180d8802e 100644 --- a/tasks/0110_937_110937668_qa_1/task.toml +++ b/tasks/0110_937_110937668_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_937_110937668_qa_2/environment/bootstrap.sh b/tasks/0110_937_110937668_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_937_110937668_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_937_110937668_qa_2/environment/pull_bucket.py b/tasks/0110_937_110937668_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_937_110937668_qa_2/environment/pull_bucket.py +++ b/tasks/0110_937_110937668_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_937_110937668_qa_2/task.toml b/tasks/0110_937_110937668_qa_2/task.toml index 449f6ba219337664797bd1eebbdd471186226009..20d307d5e7c5f03bc01feb6b0fab9b6c6856d873 100644 --- a/tasks/0110_937_110937668_qa_2/task.toml +++ b/tasks/0110_937_110937668_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_947_110947489_qa_1/environment/bootstrap.sh b/tasks/0110_947_110947489_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_947_110947489_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_947_110947489_qa_1/environment/pull_bucket.py b/tasks/0110_947_110947489_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_947_110947489_qa_1/environment/pull_bucket.py +++ b/tasks/0110_947_110947489_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_947_110947489_qa_1/task.toml b/tasks/0110_947_110947489_qa_1/task.toml index c3107cf801a4e37f7babcc401546a02f75dfbca4..98c3a90990d64971358c69d5286b1a3a57054710 100644 --- a/tasks/0110_947_110947489_qa_1/task.toml +++ b/tasks/0110_947_110947489_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_947_110947489_qa_2/environment/bootstrap.sh b/tasks/0110_947_110947489_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_947_110947489_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_947_110947489_qa_2/environment/pull_bucket.py b/tasks/0110_947_110947489_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_947_110947489_qa_2/environment/pull_bucket.py +++ b/tasks/0110_947_110947489_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_947_110947489_qa_2/task.toml b/tasks/0110_947_110947489_qa_2/task.toml index 9562a4adf67d51ee21893c7731f02d115d12d6e4..b4f0bc959fb5bc78e1664b051865c8720f5f7076 100644 --- a/tasks/0110_947_110947489_qa_2/task.toml +++ b/tasks/0110_947_110947489_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_947_110947489_qa_5/environment/bootstrap.sh b/tasks/0110_947_110947489_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_947_110947489_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_947_110947489_qa_5/environment/pull_bucket.py b/tasks/0110_947_110947489_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_947_110947489_qa_5/environment/pull_bucket.py +++ b/tasks/0110_947_110947489_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_947_110947489_qa_5/task.toml b/tasks/0110_947_110947489_qa_5/task.toml index 9ea9dd81f1d36f59afd4944648ade88040d49192..88c77096b77d57dcbfc4c219d922d40348aaef11 100644 --- a/tasks/0110_947_110947489_qa_5/task.toml +++ b/tasks/0110_947_110947489_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0110_968_110968433_qa_2/environment/bootstrap.sh b/tasks/0110_968_110968433_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0110_968_110968433_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0110_968_110968433_qa_2/environment/pull_bucket.py b/tasks/0110_968_110968433_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0110_968_110968433_qa_2/environment/pull_bucket.py +++ b/tasks/0110_968_110968433_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0110_968_110968433_qa_2/task.toml b/tasks/0110_968_110968433_qa_2/task.toml index de5683d4e138afdea4fb7bd26b8cb3890cbfa890..3aab92dc8f2657d3ed9cc82ceb7ab186bb40f9df 100644 --- a/tasks/0110_968_110968433_qa_2/task.toml +++ b/tasks/0110_968_110968433_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_071_111071615_qa_4/environment/bootstrap.sh b/tasks/0111_071_111071615_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_071_111071615_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_071_111071615_qa_4/environment/pull_bucket.py b/tasks/0111_071_111071615_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_071_111071615_qa_4/environment/pull_bucket.py +++ b/tasks/0111_071_111071615_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_071_111071615_qa_4/task.toml b/tasks/0111_071_111071615_qa_4/task.toml index 0318625689a1ecc679d3241d819008c3ff28a69d..cc004b9afb5d65b442b92219db9f2f372ba9b20b 100644 --- a/tasks/0111_071_111071615_qa_4/task.toml +++ b/tasks/0111_071_111071615_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_071_111071615_qa_5/environment/bootstrap.sh b/tasks/0111_071_111071615_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_071_111071615_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_071_111071615_qa_5/environment/pull_bucket.py b/tasks/0111_071_111071615_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_071_111071615_qa_5/environment/pull_bucket.py +++ b/tasks/0111_071_111071615_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_071_111071615_qa_5/task.toml b/tasks/0111_071_111071615_qa_5/task.toml index ef0ffd7fe667c974f4fae8de1a863619894b2851..8b455e5c67dcaa228344cfa9847ca9daa8fd2639 100644 --- a/tasks/0111_071_111071615_qa_5/task.toml +++ b/tasks/0111_071_111071615_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_097_111097126_qa_4/environment/bootstrap.sh b/tasks/0111_097_111097126_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_097_111097126_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_097_111097126_qa_4/environment/pull_bucket.py b/tasks/0111_097_111097126_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_097_111097126_qa_4/environment/pull_bucket.py +++ b/tasks/0111_097_111097126_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_097_111097126_qa_4/task.toml b/tasks/0111_097_111097126_qa_4/task.toml index d3903fb0d8cad6ac347a9a7be4eb6c931691ab42..48f6c52af42988a2ec2b7a92eabaaedc3e1f1085 100644 --- a/tasks/0111_097_111097126_qa_4/task.toml +++ b/tasks/0111_097_111097126_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_139_111139616_qa_2/environment/bootstrap.sh b/tasks/0111_139_111139616_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_139_111139616_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_139_111139616_qa_2/environment/pull_bucket.py b/tasks/0111_139_111139616_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_139_111139616_qa_2/environment/pull_bucket.py +++ b/tasks/0111_139_111139616_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_139_111139616_qa_2/task.toml b/tasks/0111_139_111139616_qa_2/task.toml index ce7f108139224f7b82f46ea7ed033152250ab4e4..f6810be2f77efda7eb5b985b860591afac9fee29 100644 --- a/tasks/0111_139_111139616_qa_2/task.toml +++ b/tasks/0111_139_111139616_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_258_111258803_qa_4/environment/bootstrap.sh b/tasks/0111_258_111258803_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_258_111258803_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_258_111258803_qa_4/environment/pull_bucket.py b/tasks/0111_258_111258803_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_258_111258803_qa_4/environment/pull_bucket.py +++ b/tasks/0111_258_111258803_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_258_111258803_qa_4/task.toml b/tasks/0111_258_111258803_qa_4/task.toml index 79c48ceac4839c5108aaab4576251fbbb50fb4b2..d315aaa0fb1b408d345f8fc5ba605595938dccf0 100644 --- a/tasks/0111_258_111258803_qa_4/task.toml +++ b/tasks/0111_258_111258803_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_306_111306567_qa_5/environment/bootstrap.sh b/tasks/0111_306_111306567_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_306_111306567_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_306_111306567_qa_5/environment/pull_bucket.py b/tasks/0111_306_111306567_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_306_111306567_qa_5/environment/pull_bucket.py +++ b/tasks/0111_306_111306567_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_306_111306567_qa_5/task.toml b/tasks/0111_306_111306567_qa_5/task.toml index cca743f88d7bd5933fbc62a503ad3c36c29e2a46..4f8cea01a7c8ec91ea784bc90d9465c014c3daf8 100644 --- a/tasks/0111_306_111306567_qa_5/task.toml +++ b/tasks/0111_306_111306567_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_310_111310845_qa_2/environment/bootstrap.sh b/tasks/0111_310_111310845_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_310_111310845_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_310_111310845_qa_2/environment/pull_bucket.py b/tasks/0111_310_111310845_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_310_111310845_qa_2/environment/pull_bucket.py +++ b/tasks/0111_310_111310845_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_310_111310845_qa_2/task.toml b/tasks/0111_310_111310845_qa_2/task.toml index d54ed6320b14747ae082864df191561e979c9140..3dfe8d59ce7be21e159a6ed410f7dcb7ec781233 100644 --- a/tasks/0111_310_111310845_qa_2/task.toml +++ b/tasks/0111_310_111310845_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_327_111327287_qa_2/environment/bootstrap.sh b/tasks/0111_327_111327287_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_327_111327287_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_327_111327287_qa_2/environment/pull_bucket.py b/tasks/0111_327_111327287_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_327_111327287_qa_2/environment/pull_bucket.py +++ b/tasks/0111_327_111327287_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_327_111327287_qa_2/task.toml b/tasks/0111_327_111327287_qa_2/task.toml index b1a887abc28d54c368e7eefe9d8f42eb2d36a02f..ff359c991722223576edaa0717f40c18ed8112b8 100644 --- a/tasks/0111_327_111327287_qa_2/task.toml +++ b/tasks/0111_327_111327287_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_327_111327287_qa_4/environment/bootstrap.sh b/tasks/0111_327_111327287_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_327_111327287_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_327_111327287_qa_4/environment/pull_bucket.py b/tasks/0111_327_111327287_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_327_111327287_qa_4/environment/pull_bucket.py +++ b/tasks/0111_327_111327287_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_327_111327287_qa_4/task.toml b/tasks/0111_327_111327287_qa_4/task.toml index 37f884bdcb4e445198a7c509534e317e9e90215c..2a6fc9f7444743b4e4cae68afa46a9bb73d9ffe5 100644 --- a/tasks/0111_327_111327287_qa_4/task.toml +++ b/tasks/0111_327_111327287_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_399_111399369_qa_5/environment/bootstrap.sh b/tasks/0111_399_111399369_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_399_111399369_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_399_111399369_qa_5/environment/pull_bucket.py b/tasks/0111_399_111399369_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_399_111399369_qa_5/environment/pull_bucket.py +++ b/tasks/0111_399_111399369_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_399_111399369_qa_5/task.toml b/tasks/0111_399_111399369_qa_5/task.toml index c6351db6d8ef72ffa6c2299dd46c708efa018e05..22e3f2914e11289dd97ff9aad6b3120b957eaf2e 100644 --- a/tasks/0111_399_111399369_qa_5/task.toml +++ b/tasks/0111_399_111399369_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_529_111529367_qa_1/environment/bootstrap.sh b/tasks/0111_529_111529367_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_529_111529367_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_529_111529367_qa_1/environment/pull_bucket.py b/tasks/0111_529_111529367_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_529_111529367_qa_1/environment/pull_bucket.py +++ b/tasks/0111_529_111529367_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_529_111529367_qa_1/task.toml b/tasks/0111_529_111529367_qa_1/task.toml index a72b7da5a09795ccfdfa944fb4e9735843f5a122..22edc95e05849ecc85970dd41f02dd5bf98e9429 100644 --- a/tasks/0111_529_111529367_qa_1/task.toml +++ b/tasks/0111_529_111529367_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_550_111550604_qa_1/environment/bootstrap.sh b/tasks/0111_550_111550604_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_550_111550604_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_550_111550604_qa_1/environment/pull_bucket.py b/tasks/0111_550_111550604_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_550_111550604_qa_1/environment/pull_bucket.py +++ b/tasks/0111_550_111550604_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_550_111550604_qa_1/task.toml b/tasks/0111_550_111550604_qa_1/task.toml index 9ad354aa779247a7bda912b1eced348e2853b02f..70f06b3f51a0ca5a9706be39ed5eb5af58c66212 100644 --- a/tasks/0111_550_111550604_qa_1/task.toml +++ b/tasks/0111_550_111550604_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_571_111571326_qa_2/environment/bootstrap.sh b/tasks/0111_571_111571326_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_571_111571326_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_571_111571326_qa_2/environment/pull_bucket.py b/tasks/0111_571_111571326_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_571_111571326_qa_2/environment/pull_bucket.py +++ b/tasks/0111_571_111571326_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_571_111571326_qa_2/task.toml b/tasks/0111_571_111571326_qa_2/task.toml index c04adb9f4e00886c70ee665e1c03a243daaad9d4..3ddd35604dc031d123f0973fdf9e988bfd53c8d4 100644 --- a/tasks/0111_571_111571326_qa_2/task.toml +++ b/tasks/0111_571_111571326_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_618_111618106_qa_4/environment/bootstrap.sh b/tasks/0111_618_111618106_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_618_111618106_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_618_111618106_qa_4/environment/pull_bucket.py b/tasks/0111_618_111618106_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_618_111618106_qa_4/environment/pull_bucket.py +++ b/tasks/0111_618_111618106_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_618_111618106_qa_4/task.toml b/tasks/0111_618_111618106_qa_4/task.toml index 7021292506a8c2b72ea80bae69c99263a6120ac3..025e20e2b7b3174efa448ef97e9ba40e6f79e1ab 100644 --- a/tasks/0111_618_111618106_qa_4/task.toml +++ b/tasks/0111_618_111618106_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_668_111668245_qa_3/environment/bootstrap.sh b/tasks/0111_668_111668245_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_668_111668245_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_668_111668245_qa_3/environment/pull_bucket.py b/tasks/0111_668_111668245_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_668_111668245_qa_3/environment/pull_bucket.py +++ b/tasks/0111_668_111668245_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_668_111668245_qa_3/task.toml b/tasks/0111_668_111668245_qa_3/task.toml index 0502472a9578493a2aa550c3ef592f19883fa392..fb46f477a9050acad50bd9a797e1ec96d77d69d9 100644 --- a/tasks/0111_668_111668245_qa_3/task.toml +++ b/tasks/0111_668_111668245_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_721_111721771_qa_4/environment/bootstrap.sh b/tasks/0111_721_111721771_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_721_111721771_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_721_111721771_qa_4/environment/pull_bucket.py b/tasks/0111_721_111721771_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_721_111721771_qa_4/environment/pull_bucket.py +++ b/tasks/0111_721_111721771_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_721_111721771_qa_4/task.toml b/tasks/0111_721_111721771_qa_4/task.toml index cc3512b2646c810d8dccff3efa26f92a7cd8d86e..6b9b77bbb29b6815590ee9b3bda0178c658dc2f1 100644 --- a/tasks/0111_721_111721771_qa_4/task.toml +++ b/tasks/0111_721_111721771_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_721_111721771_qa_5/environment/bootstrap.sh b/tasks/0111_721_111721771_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_721_111721771_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_721_111721771_qa_5/environment/pull_bucket.py b/tasks/0111_721_111721771_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_721_111721771_qa_5/environment/pull_bucket.py +++ b/tasks/0111_721_111721771_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_721_111721771_qa_5/task.toml b/tasks/0111_721_111721771_qa_5/task.toml index 4ff52e6b425ff0b6a961720abfbc8f8c68ede287..a28f2d6cef01dff010e16e6df3525eec91fc97cd 100644 --- a/tasks/0111_721_111721771_qa_5/task.toml +++ b/tasks/0111_721_111721771_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_875_111875662_qa_1/environment/bootstrap.sh b/tasks/0111_875_111875662_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_875_111875662_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_875_111875662_qa_1/environment/pull_bucket.py b/tasks/0111_875_111875662_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_875_111875662_qa_1/environment/pull_bucket.py +++ b/tasks/0111_875_111875662_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_875_111875662_qa_1/task.toml b/tasks/0111_875_111875662_qa_1/task.toml index 65da2d7ba3764f5fc3fb8a96dc5dc28bb17287d9..1cf090c3cb0ab55540b8f61985cfb74c1b89599d 100644 --- a/tasks/0111_875_111875662_qa_1/task.toml +++ b/tasks/0111_875_111875662_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_875_111875662_qa_4/environment/bootstrap.sh b/tasks/0111_875_111875662_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_875_111875662_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_875_111875662_qa_4/environment/pull_bucket.py b/tasks/0111_875_111875662_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_875_111875662_qa_4/environment/pull_bucket.py +++ b/tasks/0111_875_111875662_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_875_111875662_qa_4/task.toml b/tasks/0111_875_111875662_qa_4/task.toml index 2d0c86c8ffa4c18e406700308706335dc6098415..b7931e00a7b4cf800461c47caf672552cc196c29 100644 --- a/tasks/0111_875_111875662_qa_4/task.toml +++ b/tasks/0111_875_111875662_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_875_111875662_qa_5/environment/bootstrap.sh b/tasks/0111_875_111875662_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_875_111875662_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_875_111875662_qa_5/environment/pull_bucket.py b/tasks/0111_875_111875662_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_875_111875662_qa_5/environment/pull_bucket.py +++ b/tasks/0111_875_111875662_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_875_111875662_qa_5/task.toml b/tasks/0111_875_111875662_qa_5/task.toml index e8903682f48ec6cb827540160e73283353f3e44d..ecde2f94cbaaaf50430db33800b51915eb65064d 100644 --- a/tasks/0111_875_111875662_qa_5/task.toml +++ b/tasks/0111_875_111875662_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_889_111889874_qa_2/environment/bootstrap.sh b/tasks/0111_889_111889874_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_889_111889874_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_889_111889874_qa_2/environment/pull_bucket.py b/tasks/0111_889_111889874_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_889_111889874_qa_2/environment/pull_bucket.py +++ b/tasks/0111_889_111889874_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_889_111889874_qa_2/task.toml b/tasks/0111_889_111889874_qa_2/task.toml index e59038ffdcc2c8e95c38ceed8fc5bd3a0565519b..4602f9f19663955e57d4a0a6526dbf4afc17d7b2 100644 --- a/tasks/0111_889_111889874_qa_2/task.toml +++ b/tasks/0111_889_111889874_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_889_111889874_qa_3/environment/bootstrap.sh b/tasks/0111_889_111889874_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_889_111889874_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_889_111889874_qa_3/environment/pull_bucket.py b/tasks/0111_889_111889874_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_889_111889874_qa_3/environment/pull_bucket.py +++ b/tasks/0111_889_111889874_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_889_111889874_qa_3/task.toml b/tasks/0111_889_111889874_qa_3/task.toml index cdfc9e070236e878f10ce5e4298e81bfac1e6ac6..cd165ef3ae82e5f07768e9866e861d429a985e79 100644 --- a/tasks/0111_889_111889874_qa_3/task.toml +++ b/tasks/0111_889_111889874_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_899_111899875_qa_2/environment/bootstrap.sh b/tasks/0111_899_111899875_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_899_111899875_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_899_111899875_qa_2/environment/pull_bucket.py b/tasks/0111_899_111899875_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_899_111899875_qa_2/environment/pull_bucket.py +++ b/tasks/0111_899_111899875_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_899_111899875_qa_2/task.toml b/tasks/0111_899_111899875_qa_2/task.toml index 1ba725d1aca80ab7549000a2ea7e1b66634f7edf..0a32b6d86bca440944946f111e2d472684f38495 100644 --- a/tasks/0111_899_111899875_qa_2/task.toml +++ b/tasks/0111_899_111899875_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0111_899_111899875_qa_5/environment/bootstrap.sh b/tasks/0111_899_111899875_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0111_899_111899875_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0111_899_111899875_qa_5/environment/pull_bucket.py b/tasks/0111_899_111899875_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0111_899_111899875_qa_5/environment/pull_bucket.py +++ b/tasks/0111_899_111899875_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0111_899_111899875_qa_5/task.toml b/tasks/0111_899_111899875_qa_5/task.toml index 80939013df24f697aee3cc20f2f6ab649741e271..31bf121a0bb7e17055ad8cab60a3d5100670e29f 100644 --- a/tasks/0111_899_111899875_qa_5/task.toml +++ b/tasks/0111_899_111899875_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_045_112045716_qa_4/environment/bootstrap.sh b/tasks/0112_045_112045716_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_045_112045716_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_045_112045716_qa_4/environment/pull_bucket.py b/tasks/0112_045_112045716_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_045_112045716_qa_4/environment/pull_bucket.py +++ b/tasks/0112_045_112045716_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_045_112045716_qa_4/task.toml b/tasks/0112_045_112045716_qa_4/task.toml index b817dddec6d8b0d4d94d8a9a6e9d9919c7f0ea6b..408fd956897fbab54bb457d929219b7e677c9920 100644 --- a/tasks/0112_045_112045716_qa_4/task.toml +++ b/tasks/0112_045_112045716_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_118_112118657_qa_3/environment/bootstrap.sh b/tasks/0112_118_112118657_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_118_112118657_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_118_112118657_qa_3/environment/pull_bucket.py b/tasks/0112_118_112118657_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_118_112118657_qa_3/environment/pull_bucket.py +++ b/tasks/0112_118_112118657_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_118_112118657_qa_3/task.toml b/tasks/0112_118_112118657_qa_3/task.toml index 698af60253b29aa9b78a2cc3b8664c6b583c84b6..b56b8e43fdd172e81a84a1788b500ba7a9a1a971 100644 --- a/tasks/0112_118_112118657_qa_3/task.toml +++ b/tasks/0112_118_112118657_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_165_112165295_qa_3/environment/bootstrap.sh b/tasks/0112_165_112165295_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_165_112165295_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_165_112165295_qa_3/environment/pull_bucket.py b/tasks/0112_165_112165295_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_165_112165295_qa_3/environment/pull_bucket.py +++ b/tasks/0112_165_112165295_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_165_112165295_qa_3/task.toml b/tasks/0112_165_112165295_qa_3/task.toml index 402a7ca96935c9cc041dcca84120c0edecd21c82..f3f4eee8b31508cd2d459fd230120c45facc5815 100644 --- a/tasks/0112_165_112165295_qa_3/task.toml +++ b/tasks/0112_165_112165295_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_172_112172227_qa_3/environment/bootstrap.sh b/tasks/0112_172_112172227_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_172_112172227_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_172_112172227_qa_3/environment/pull_bucket.py b/tasks/0112_172_112172227_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_172_112172227_qa_3/environment/pull_bucket.py +++ b/tasks/0112_172_112172227_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_172_112172227_qa_3/task.toml b/tasks/0112_172_112172227_qa_3/task.toml index 715e713bc3e870750b5ff67e622a883c7b437ce4..94f2d931b92604ed5e73e604050bf984a330d08a 100644 --- a/tasks/0112_172_112172227_qa_3/task.toml +++ b/tasks/0112_172_112172227_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_393_112393758_qa_1/environment/bootstrap.sh b/tasks/0112_393_112393758_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_393_112393758_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_393_112393758_qa_1/environment/pull_bucket.py b/tasks/0112_393_112393758_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_393_112393758_qa_1/environment/pull_bucket.py +++ b/tasks/0112_393_112393758_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_393_112393758_qa_1/task.toml b/tasks/0112_393_112393758_qa_1/task.toml index 5cb3efa7a68db7feb7d9e1dfa990638708089a1c..745344ef253e4e4268ef7a8719599e581d65f4a4 100644 --- a/tasks/0112_393_112393758_qa_1/task.toml +++ b/tasks/0112_393_112393758_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_406_112406995_qa_1/environment/bootstrap.sh b/tasks/0112_406_112406995_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_406_112406995_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_406_112406995_qa_1/environment/pull_bucket.py b/tasks/0112_406_112406995_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_406_112406995_qa_1/environment/pull_bucket.py +++ b/tasks/0112_406_112406995_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_406_112406995_qa_1/task.toml b/tasks/0112_406_112406995_qa_1/task.toml index 4aab97ef2844e183c9fc7fe3c6d2a7492406b885..8410038c6cd362352ff988a588f38e60a0d19b85 100644 --- a/tasks/0112_406_112406995_qa_1/task.toml +++ b/tasks/0112_406_112406995_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_433_112433487_qa_2/environment/bootstrap.sh b/tasks/0112_433_112433487_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_433_112433487_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_433_112433487_qa_2/environment/pull_bucket.py b/tasks/0112_433_112433487_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_433_112433487_qa_2/environment/pull_bucket.py +++ b/tasks/0112_433_112433487_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_433_112433487_qa_2/task.toml b/tasks/0112_433_112433487_qa_2/task.toml index 74674581b452a916daf7463e903dd7853c384b22..9f22810b7d3cb23919d4fed6b1d6a8b17aff3a1b 100644 --- a/tasks/0112_433_112433487_qa_2/task.toml +++ b/tasks/0112_433_112433487_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_434_112434990_qa_5/environment/bootstrap.sh b/tasks/0112_434_112434990_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_434_112434990_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_434_112434990_qa_5/environment/pull_bucket.py b/tasks/0112_434_112434990_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_434_112434990_qa_5/environment/pull_bucket.py +++ b/tasks/0112_434_112434990_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_434_112434990_qa_5/task.toml b/tasks/0112_434_112434990_qa_5/task.toml index 38f7577b06b0e2155c3d4a3083fb8af67c3e56a9..ceb4c2c6231c1e1895c2794f31b44a3d45102fa2 100644 --- a/tasks/0112_434_112434990_qa_5/task.toml +++ b/tasks/0112_434_112434990_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_515_112515781_qa_1/environment/bootstrap.sh b/tasks/0112_515_112515781_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_515_112515781_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_515_112515781_qa_1/environment/pull_bucket.py b/tasks/0112_515_112515781_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_515_112515781_qa_1/environment/pull_bucket.py +++ b/tasks/0112_515_112515781_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_515_112515781_qa_1/task.toml b/tasks/0112_515_112515781_qa_1/task.toml index a78ec7f485990189fb1172170718d775a395f2a6..3424177db5b4820d1271787b40fe97e183d8285e 100644 --- a/tasks/0112_515_112515781_qa_1/task.toml +++ b/tasks/0112_515_112515781_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_515_112515781_qa_2/environment/bootstrap.sh b/tasks/0112_515_112515781_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_515_112515781_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_515_112515781_qa_2/environment/pull_bucket.py b/tasks/0112_515_112515781_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_515_112515781_qa_2/environment/pull_bucket.py +++ b/tasks/0112_515_112515781_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_515_112515781_qa_2/task.toml b/tasks/0112_515_112515781_qa_2/task.toml index 3903049188646f4a23d3fe0bed3f7bfc8f4d68cb..0258847685a87739da8cbf1cd4f9c46239778c59 100644 --- a/tasks/0112_515_112515781_qa_2/task.toml +++ b/tasks/0112_515_112515781_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_515_112515781_qa_3/environment/bootstrap.sh b/tasks/0112_515_112515781_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_515_112515781_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_515_112515781_qa_3/environment/pull_bucket.py b/tasks/0112_515_112515781_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_515_112515781_qa_3/environment/pull_bucket.py +++ b/tasks/0112_515_112515781_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_515_112515781_qa_3/task.toml b/tasks/0112_515_112515781_qa_3/task.toml index f19021bf1bb2de9845e936483f376964dde27353..a28c6a240190e16de11b24de31f623821d5c10f3 100644 --- a/tasks/0112_515_112515781_qa_3/task.toml +++ b/tasks/0112_515_112515781_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_515_112515781_qa_4/environment/bootstrap.sh b/tasks/0112_515_112515781_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_515_112515781_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_515_112515781_qa_4/environment/pull_bucket.py b/tasks/0112_515_112515781_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_515_112515781_qa_4/environment/pull_bucket.py +++ b/tasks/0112_515_112515781_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_515_112515781_qa_4/task.toml b/tasks/0112_515_112515781_qa_4/task.toml index 8ae4cf9bac7aa7028fafe8240c22820eb542605a..9efc1d4d46b84444ef9f72479ed508ce23e098ea 100644 --- a/tasks/0112_515_112515781_qa_4/task.toml +++ b/tasks/0112_515_112515781_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_533_112533086_qa_5/environment/bootstrap.sh b/tasks/0112_533_112533086_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_533_112533086_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_533_112533086_qa_5/environment/pull_bucket.py b/tasks/0112_533_112533086_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_533_112533086_qa_5/environment/pull_bucket.py +++ b/tasks/0112_533_112533086_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_533_112533086_qa_5/task.toml b/tasks/0112_533_112533086_qa_5/task.toml index c04e03ee2841751a8f8651370aefdeef36dd4e5b..3ed6b8482410cb12236d873a836a35e354c07903 100644 --- a/tasks/0112_533_112533086_qa_5/task.toml +++ b/tasks/0112_533_112533086_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_536_112536664_qa_4/environment/bootstrap.sh b/tasks/0112_536_112536664_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_536_112536664_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_536_112536664_qa_4/environment/pull_bucket.py b/tasks/0112_536_112536664_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_536_112536664_qa_4/environment/pull_bucket.py +++ b/tasks/0112_536_112536664_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_536_112536664_qa_4/task.toml b/tasks/0112_536_112536664_qa_4/task.toml index ceaca3d77c0160116afdea64689615fc420c08b8..dce3c52f0ee31e0c817e5e54e4f869080d13cadb 100644 --- a/tasks/0112_536_112536664_qa_4/task.toml +++ b/tasks/0112_536_112536664_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_536_112536664_qa_5/environment/bootstrap.sh b/tasks/0112_536_112536664_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_536_112536664_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_536_112536664_qa_5/environment/pull_bucket.py b/tasks/0112_536_112536664_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_536_112536664_qa_5/environment/pull_bucket.py +++ b/tasks/0112_536_112536664_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_536_112536664_qa_5/task.toml b/tasks/0112_536_112536664_qa_5/task.toml index 18faad33963f53ef72ef365433b23ca966637a22..e4a009c680639867b31f54633e3ffe6b61fd283a 100644 --- a/tasks/0112_536_112536664_qa_5/task.toml +++ b/tasks/0112_536_112536664_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_571_112571521_qa_3/environment/bootstrap.sh b/tasks/0112_571_112571521_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_571_112571521_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_571_112571521_qa_3/environment/pull_bucket.py b/tasks/0112_571_112571521_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_571_112571521_qa_3/environment/pull_bucket.py +++ b/tasks/0112_571_112571521_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_571_112571521_qa_3/task.toml b/tasks/0112_571_112571521_qa_3/task.toml index bee5f7e1ed4109673467771f6cb598b7b194c9a1..640e70e86199c368fb0da34f0b193bf5ae0ec01d 100644 --- a/tasks/0112_571_112571521_qa_3/task.toml +++ b/tasks/0112_571_112571521_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_571_112571521_qa_4/environment/bootstrap.sh b/tasks/0112_571_112571521_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_571_112571521_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_571_112571521_qa_4/environment/pull_bucket.py b/tasks/0112_571_112571521_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_571_112571521_qa_4/environment/pull_bucket.py +++ b/tasks/0112_571_112571521_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_571_112571521_qa_4/task.toml b/tasks/0112_571_112571521_qa_4/task.toml index f38e2cdded2d06848e5e95647ddfe35598aaf535..c045dbebfd284459c7e256bce06910823c49e1c0 100644 --- a/tasks/0112_571_112571521_qa_4/task.toml +++ b/tasks/0112_571_112571521_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_574_112574806_qa_5/environment/bootstrap.sh b/tasks/0112_574_112574806_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_574_112574806_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_574_112574806_qa_5/environment/pull_bucket.py b/tasks/0112_574_112574806_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_574_112574806_qa_5/environment/pull_bucket.py +++ b/tasks/0112_574_112574806_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_574_112574806_qa_5/task.toml b/tasks/0112_574_112574806_qa_5/task.toml index 20f4cb0c6b6e7a707ec5e7db75684c3579a8bd49..395d8dac59dfe5afcd369f633eea1085054f4b78 100644 --- a/tasks/0112_574_112574806_qa_5/task.toml +++ b/tasks/0112_574_112574806_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_599_112599544_qa_2/environment/bootstrap.sh b/tasks/0112_599_112599544_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_599_112599544_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_599_112599544_qa_2/environment/pull_bucket.py b/tasks/0112_599_112599544_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_599_112599544_qa_2/environment/pull_bucket.py +++ b/tasks/0112_599_112599544_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_599_112599544_qa_2/task.toml b/tasks/0112_599_112599544_qa_2/task.toml index 712ad8b851bdb13d0c7793a4016e64f17aba3579..08c1ca1ea5c5b262f27693e91dbece1a92ef1d69 100644 --- a/tasks/0112_599_112599544_qa_2/task.toml +++ b/tasks/0112_599_112599544_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_660_112660335_qa_2/environment/bootstrap.sh b/tasks/0112_660_112660335_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_660_112660335_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_660_112660335_qa_2/environment/pull_bucket.py b/tasks/0112_660_112660335_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_660_112660335_qa_2/environment/pull_bucket.py +++ b/tasks/0112_660_112660335_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_660_112660335_qa_2/task.toml b/tasks/0112_660_112660335_qa_2/task.toml index 1f48bc8d616083d0117ca5564f6117c3e7d738c2..320b456486ed337e49c3fded17ce1389bd29ef28 100644 --- a/tasks/0112_660_112660335_qa_2/task.toml +++ b/tasks/0112_660_112660335_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_662_112662280_qa_2/environment/bootstrap.sh b/tasks/0112_662_112662280_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_662_112662280_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_662_112662280_qa_2/environment/pull_bucket.py b/tasks/0112_662_112662280_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_662_112662280_qa_2/environment/pull_bucket.py +++ b/tasks/0112_662_112662280_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_662_112662280_qa_2/task.toml b/tasks/0112_662_112662280_qa_2/task.toml index dd65b51b825855a08c1c76b9d44c8aecf27f2815..593fe661ce5e8bcf23020d6e92ca0a11b5a4f119 100644 --- a/tasks/0112_662_112662280_qa_2/task.toml +++ b/tasks/0112_662_112662280_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_685_112685295_qa_2/environment/bootstrap.sh b/tasks/0112_685_112685295_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_685_112685295_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_685_112685295_qa_2/environment/pull_bucket.py b/tasks/0112_685_112685295_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_685_112685295_qa_2/environment/pull_bucket.py +++ b/tasks/0112_685_112685295_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_685_112685295_qa_2/task.toml b/tasks/0112_685_112685295_qa_2/task.toml index 09d6fea654651a03a5a31e025420182e26423c3a..f710f653d84702d584bc37b6a9290fcbd8568d47 100644 --- a/tasks/0112_685_112685295_qa_2/task.toml +++ b/tasks/0112_685_112685295_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_685_112685295_qa_4/environment/bootstrap.sh b/tasks/0112_685_112685295_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_685_112685295_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_685_112685295_qa_4/environment/pull_bucket.py b/tasks/0112_685_112685295_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_685_112685295_qa_4/environment/pull_bucket.py +++ b/tasks/0112_685_112685295_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_685_112685295_qa_4/task.toml b/tasks/0112_685_112685295_qa_4/task.toml index 21a4197ee6d6243eaf6ff37f1b8c277fc006aef2..16acf8e40accda21a9c1b36262f425f7452259fa 100644 --- a/tasks/0112_685_112685295_qa_4/task.toml +++ b/tasks/0112_685_112685295_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_690_112690397_qa_5/environment/bootstrap.sh b/tasks/0112_690_112690397_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_690_112690397_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_690_112690397_qa_5/environment/pull_bucket.py b/tasks/0112_690_112690397_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_690_112690397_qa_5/environment/pull_bucket.py +++ b/tasks/0112_690_112690397_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_690_112690397_qa_5/task.toml b/tasks/0112_690_112690397_qa_5/task.toml index f1bd3c3abc114feb0bbbb88cd3b05d14afccde43..886902afb5b5dd72eac91a1b5d1aa60bf982156d 100644 --- a/tasks/0112_690_112690397_qa_5/task.toml +++ b/tasks/0112_690_112690397_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_804_112804674_qa_2/environment/bootstrap.sh b/tasks/0112_804_112804674_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_804_112804674_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_804_112804674_qa_2/environment/pull_bucket.py b/tasks/0112_804_112804674_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_804_112804674_qa_2/environment/pull_bucket.py +++ b/tasks/0112_804_112804674_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_804_112804674_qa_2/task.toml b/tasks/0112_804_112804674_qa_2/task.toml index 1f3dbf9b8776310b9431a6390f4f2008080c39bb..8590f3d8ae3c4ef66679b57d8f6f6bddef59758c 100644 --- a/tasks/0112_804_112804674_qa_2/task.toml +++ b/tasks/0112_804_112804674_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_804_112804674_qa_3/environment/bootstrap.sh b/tasks/0112_804_112804674_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_804_112804674_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_804_112804674_qa_3/environment/pull_bucket.py b/tasks/0112_804_112804674_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_804_112804674_qa_3/environment/pull_bucket.py +++ b/tasks/0112_804_112804674_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_804_112804674_qa_3/task.toml b/tasks/0112_804_112804674_qa_3/task.toml index 3818a913d36cd7de0f44f9e858e7598eaa56bc2b..ccf25d1b41ac1d5ad052db8a879a4ab90bc8417c 100644 --- a/tasks/0112_804_112804674_qa_3/task.toml +++ b/tasks/0112_804_112804674_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_804_112804674_qa_4/environment/bootstrap.sh b/tasks/0112_804_112804674_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_804_112804674_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_804_112804674_qa_4/environment/pull_bucket.py b/tasks/0112_804_112804674_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_804_112804674_qa_4/environment/pull_bucket.py +++ b/tasks/0112_804_112804674_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_804_112804674_qa_4/task.toml b/tasks/0112_804_112804674_qa_4/task.toml index e3069c40c979efb3e56311bd896b73132cab8ecb..69e3f44f018af31378bc965cba344e6ad82e2065 100644 --- a/tasks/0112_804_112804674_qa_4/task.toml +++ b/tasks/0112_804_112804674_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_804_112804674_qa_5/environment/bootstrap.sh b/tasks/0112_804_112804674_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_804_112804674_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_804_112804674_qa_5/environment/pull_bucket.py b/tasks/0112_804_112804674_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_804_112804674_qa_5/environment/pull_bucket.py +++ b/tasks/0112_804_112804674_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_804_112804674_qa_5/task.toml b/tasks/0112_804_112804674_qa_5/task.toml index 6a76b33441de9390d8c99b6d3bc023a2693d8bfe..ac54d1eda9d5cc7d004d1ad58998819acbfe9a1a 100644 --- a/tasks/0112_804_112804674_qa_5/task.toml +++ b/tasks/0112_804_112804674_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_848_112848989_qa_1/environment/bootstrap.sh b/tasks/0112_848_112848989_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_848_112848989_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_848_112848989_qa_1/environment/pull_bucket.py b/tasks/0112_848_112848989_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_848_112848989_qa_1/environment/pull_bucket.py +++ b/tasks/0112_848_112848989_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_848_112848989_qa_1/task.toml b/tasks/0112_848_112848989_qa_1/task.toml index a59640344f1e8ce1283f9988798cb9afb689cce1..d21bfe5f1c3835b1909c61799c4d32755656846e 100644 --- a/tasks/0112_848_112848989_qa_1/task.toml +++ b/tasks/0112_848_112848989_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_848_112848989_qa_3/environment/bootstrap.sh b/tasks/0112_848_112848989_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_848_112848989_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_848_112848989_qa_3/environment/pull_bucket.py b/tasks/0112_848_112848989_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_848_112848989_qa_3/environment/pull_bucket.py +++ b/tasks/0112_848_112848989_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_848_112848989_qa_3/task.toml b/tasks/0112_848_112848989_qa_3/task.toml index e60c9dbe9c8b62bdf2604e6783ab4a38a11e5d39..486eb18c542b2c901db7422e1e11c281c0ba619d 100644 --- a/tasks/0112_848_112848989_qa_3/task.toml +++ b/tasks/0112_848_112848989_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_848_112848989_qa_4/environment/bootstrap.sh b/tasks/0112_848_112848989_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_848_112848989_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_848_112848989_qa_4/environment/pull_bucket.py b/tasks/0112_848_112848989_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_848_112848989_qa_4/environment/pull_bucket.py +++ b/tasks/0112_848_112848989_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_848_112848989_qa_4/task.toml b/tasks/0112_848_112848989_qa_4/task.toml index 25208a1352cf4626c4d29a89568b5dd55993fe86..79db3cafa12c410d0247db172340c670622048c8 100644 --- a/tasks/0112_848_112848989_qa_4/task.toml +++ b/tasks/0112_848_112848989_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_857_112857611_qa_4/environment/bootstrap.sh b/tasks/0112_857_112857611_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_857_112857611_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_857_112857611_qa_4/environment/pull_bucket.py b/tasks/0112_857_112857611_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_857_112857611_qa_4/environment/pull_bucket.py +++ b/tasks/0112_857_112857611_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_857_112857611_qa_4/task.toml b/tasks/0112_857_112857611_qa_4/task.toml index 87787f2a387134032d5aa194649158385277b8cd..c8f754db3ce45418eba5039b9ac2754444e018ca 100644 --- a/tasks/0112_857_112857611_qa_4/task.toml +++ b/tasks/0112_857_112857611_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0112_857_112857611_qa_5/environment/bootstrap.sh b/tasks/0112_857_112857611_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0112_857_112857611_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0112_857_112857611_qa_5/environment/pull_bucket.py b/tasks/0112_857_112857611_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0112_857_112857611_qa_5/environment/pull_bucket.py +++ b/tasks/0112_857_112857611_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0112_857_112857611_qa_5/task.toml b/tasks/0112_857_112857611_qa_5/task.toml index 9f54ad1cea9a2d13d71cef6e57eb6243a3ebb5d7..d5420ca828e751ca2ed71c7005579f0747c0ed7c 100644 --- a/tasks/0112_857_112857611_qa_5/task.toml +++ b/tasks/0112_857_112857611_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_007_113007141_qa_2/environment/bootstrap.sh b/tasks/0113_007_113007141_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_007_113007141_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_007_113007141_qa_2/environment/pull_bucket.py b/tasks/0113_007_113007141_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_007_113007141_qa_2/environment/pull_bucket.py +++ b/tasks/0113_007_113007141_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_007_113007141_qa_2/task.toml b/tasks/0113_007_113007141_qa_2/task.toml index 53a99a742bd1ba3e2525d42b26e49509f9c31e98..4e1d38b02d4e8fbbd65047727561815f778827c2 100644 --- a/tasks/0113_007_113007141_qa_2/task.toml +++ b/tasks/0113_007_113007141_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_048_113048196_qa_2/environment/bootstrap.sh b/tasks/0113_048_113048196_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_048_113048196_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_048_113048196_qa_2/environment/pull_bucket.py b/tasks/0113_048_113048196_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_048_113048196_qa_2/environment/pull_bucket.py +++ b/tasks/0113_048_113048196_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_048_113048196_qa_2/task.toml b/tasks/0113_048_113048196_qa_2/task.toml index 00501509d143ce607b7060c43d7aab34e3802762..cd7b5787269e18b602405738fe96cac0e476d000 100644 --- a/tasks/0113_048_113048196_qa_2/task.toml +++ b/tasks/0113_048_113048196_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_048_113048196_qa_5/environment/bootstrap.sh b/tasks/0113_048_113048196_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_048_113048196_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_048_113048196_qa_5/environment/pull_bucket.py b/tasks/0113_048_113048196_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_048_113048196_qa_5/environment/pull_bucket.py +++ b/tasks/0113_048_113048196_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_048_113048196_qa_5/task.toml b/tasks/0113_048_113048196_qa_5/task.toml index 5c1966419bd76f67716145e3543e96497b92230c..ba86ae9b9f98b4efc42f4d0fdafbdc7101461c59 100644 --- a/tasks/0113_048_113048196_qa_5/task.toml +++ b/tasks/0113_048_113048196_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_060_113060572_qa_1/environment/bootstrap.sh b/tasks/0113_060_113060572_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_060_113060572_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_060_113060572_qa_1/environment/pull_bucket.py b/tasks/0113_060_113060572_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_060_113060572_qa_1/environment/pull_bucket.py +++ b/tasks/0113_060_113060572_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_060_113060572_qa_1/task.toml b/tasks/0113_060_113060572_qa_1/task.toml index 01c98188df2371f88a8fb1374aeb5307e0715827..cd2680c84e774de6ddb7aacab4a48738e8389f6b 100644 --- a/tasks/0113_060_113060572_qa_1/task.toml +++ b/tasks/0113_060_113060572_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_068_113068557_qa_1/environment/bootstrap.sh b/tasks/0113_068_113068557_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_068_113068557_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_068_113068557_qa_1/environment/pull_bucket.py b/tasks/0113_068_113068557_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_068_113068557_qa_1/environment/pull_bucket.py +++ b/tasks/0113_068_113068557_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_068_113068557_qa_1/task.toml b/tasks/0113_068_113068557_qa_1/task.toml index e82fefe34330026d5c9aa28967a5f086d2852573..7d200720b0555c263fd6a9f4136baac901d4911e 100644 --- a/tasks/0113_068_113068557_qa_1/task.toml +++ b/tasks/0113_068_113068557_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_071_113071809_qa_1/environment/bootstrap.sh b/tasks/0113_071_113071809_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_071_113071809_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_071_113071809_qa_1/environment/pull_bucket.py b/tasks/0113_071_113071809_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_071_113071809_qa_1/environment/pull_bucket.py +++ b/tasks/0113_071_113071809_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_071_113071809_qa_1/task.toml b/tasks/0113_071_113071809_qa_1/task.toml index 2f01cc78a2082f4f6798a8c6c32034023b9e8165..24613e8d9e1ef24fdb8b5889cce34138864eda0c 100644 --- a/tasks/0113_071_113071809_qa_1/task.toml +++ b/tasks/0113_071_113071809_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_075_113075841_qa_1/environment/bootstrap.sh b/tasks/0113_075_113075841_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_075_113075841_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_075_113075841_qa_1/environment/pull_bucket.py b/tasks/0113_075_113075841_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_075_113075841_qa_1/environment/pull_bucket.py +++ b/tasks/0113_075_113075841_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_075_113075841_qa_1/task.toml b/tasks/0113_075_113075841_qa_1/task.toml index 621de1cc8457617dc6f7d507937dc9bcd498942c..c81dac1d4800abda0941c65d8c8df78b8879a0e4 100644 --- a/tasks/0113_075_113075841_qa_1/task.toml +++ b/tasks/0113_075_113075841_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_075_113075841_qa_2/environment/bootstrap.sh b/tasks/0113_075_113075841_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_075_113075841_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_075_113075841_qa_2/environment/pull_bucket.py b/tasks/0113_075_113075841_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_075_113075841_qa_2/environment/pull_bucket.py +++ b/tasks/0113_075_113075841_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_075_113075841_qa_2/task.toml b/tasks/0113_075_113075841_qa_2/task.toml index 47ef7f385566b097dfe989fa03e9ab9a6e22ce86..d96d144c633504da147801d4bb35c14b44b3a78b 100644 --- a/tasks/0113_075_113075841_qa_2/task.toml +++ b/tasks/0113_075_113075841_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_075_113075841_qa_3/environment/bootstrap.sh b/tasks/0113_075_113075841_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_075_113075841_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_075_113075841_qa_3/environment/pull_bucket.py b/tasks/0113_075_113075841_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_075_113075841_qa_3/environment/pull_bucket.py +++ b/tasks/0113_075_113075841_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_075_113075841_qa_3/task.toml b/tasks/0113_075_113075841_qa_3/task.toml index 3f4aabe7e8dab1eca470ad346145414c41935488..e1257741aa5228c0daf830959060af9daa0c5f19 100644 --- a/tasks/0113_075_113075841_qa_3/task.toml +++ b/tasks/0113_075_113075841_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_114_113114053_qa_3/environment/bootstrap.sh b/tasks/0113_114_113114053_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_114_113114053_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_114_113114053_qa_3/environment/pull_bucket.py b/tasks/0113_114_113114053_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_114_113114053_qa_3/environment/pull_bucket.py +++ b/tasks/0113_114_113114053_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_114_113114053_qa_3/task.toml b/tasks/0113_114_113114053_qa_3/task.toml index 02ad7387b25bcacf4d1fc7ca79649f7426bd19c1..454fb738bf45c37cb90f4f1bbd3d5774bc6cf73e 100644 --- a/tasks/0113_114_113114053_qa_3/task.toml +++ b/tasks/0113_114_113114053_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_124_113124981_qa_5/environment/bootstrap.sh b/tasks/0113_124_113124981_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_124_113124981_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_124_113124981_qa_5/environment/pull_bucket.py b/tasks/0113_124_113124981_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_124_113124981_qa_5/environment/pull_bucket.py +++ b/tasks/0113_124_113124981_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_124_113124981_qa_5/task.toml b/tasks/0113_124_113124981_qa_5/task.toml index 7852433fcd43512f06b04b5d4683d3c99bf428bb..a66eb2e7afbb144aa6e814eed44730e78323611f 100644 --- a/tasks/0113_124_113124981_qa_5/task.toml +++ b/tasks/0113_124_113124981_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_129_113129958_qa_2/environment/bootstrap.sh b/tasks/0113_129_113129958_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_129_113129958_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_129_113129958_qa_2/environment/pull_bucket.py b/tasks/0113_129_113129958_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_129_113129958_qa_2/environment/pull_bucket.py +++ b/tasks/0113_129_113129958_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_129_113129958_qa_2/task.toml b/tasks/0113_129_113129958_qa_2/task.toml index 2a4a409ff99f9977a550b737c5394533837e11b1..f257ac99db5df5bbbd7bbd50bdec611c3aa8f63f 100644 --- a/tasks/0113_129_113129958_qa_2/task.toml +++ b/tasks/0113_129_113129958_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_130_113130564_qa_1/environment/bootstrap.sh b/tasks/0113_130_113130564_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_130_113130564_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_130_113130564_qa_1/environment/pull_bucket.py b/tasks/0113_130_113130564_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_130_113130564_qa_1/environment/pull_bucket.py +++ b/tasks/0113_130_113130564_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_130_113130564_qa_1/task.toml b/tasks/0113_130_113130564_qa_1/task.toml index 49c965dcf7d93665e41582863c805b0ecfddbd34..f1ec7804f87fe43e49db2e98b344135a2b9755d8 100644 --- a/tasks/0113_130_113130564_qa_1/task.toml +++ b/tasks/0113_130_113130564_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_130_113130564_qa_2/environment/bootstrap.sh b/tasks/0113_130_113130564_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_130_113130564_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_130_113130564_qa_2/environment/pull_bucket.py b/tasks/0113_130_113130564_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_130_113130564_qa_2/environment/pull_bucket.py +++ b/tasks/0113_130_113130564_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_130_113130564_qa_2/task.toml b/tasks/0113_130_113130564_qa_2/task.toml index b59766bf38389f603e71ecc304c6e0ea19ec46db..72cefbc2c5c95ff52bc882f0f2e5789b40d1cb0f 100644 --- a/tasks/0113_130_113130564_qa_2/task.toml +++ b/tasks/0113_130_113130564_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_130_113130564_qa_4/environment/bootstrap.sh b/tasks/0113_130_113130564_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_130_113130564_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_130_113130564_qa_4/environment/pull_bucket.py b/tasks/0113_130_113130564_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_130_113130564_qa_4/environment/pull_bucket.py +++ b/tasks/0113_130_113130564_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_130_113130564_qa_4/task.toml b/tasks/0113_130_113130564_qa_4/task.toml index 63fcb64470ef84d5f567fe1fb1fc85349710516b..6a5331bee5b12172b8d228fd012b1e1a77be658d 100644 --- a/tasks/0113_130_113130564_qa_4/task.toml +++ b/tasks/0113_130_113130564_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_167_113167723_qa_2/environment/bootstrap.sh b/tasks/0113_167_113167723_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_167_113167723_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_167_113167723_qa_2/environment/pull_bucket.py b/tasks/0113_167_113167723_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_167_113167723_qa_2/environment/pull_bucket.py +++ b/tasks/0113_167_113167723_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_167_113167723_qa_2/task.toml b/tasks/0113_167_113167723_qa_2/task.toml index 3eabbdec269dbe54a78d789a859da6760ba8ed8c..9d9bede9d40b3b6de78c7114d3fcbf9c13232f02 100644 --- a/tasks/0113_167_113167723_qa_2/task.toml +++ b/tasks/0113_167_113167723_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_167_113167723_qa_4/environment/bootstrap.sh b/tasks/0113_167_113167723_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_167_113167723_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_167_113167723_qa_4/environment/pull_bucket.py b/tasks/0113_167_113167723_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_167_113167723_qa_4/environment/pull_bucket.py +++ b/tasks/0113_167_113167723_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_167_113167723_qa_4/task.toml b/tasks/0113_167_113167723_qa_4/task.toml index 121a7e98112d0254970f0dd50793c5e278d617c6..15a0beebe034b6999b2bb984a5a360fd7b917f01 100644 --- a/tasks/0113_167_113167723_qa_4/task.toml +++ b/tasks/0113_167_113167723_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_185_113185711_qa_1/environment/bootstrap.sh b/tasks/0113_185_113185711_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_185_113185711_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_185_113185711_qa_1/environment/pull_bucket.py b/tasks/0113_185_113185711_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_185_113185711_qa_1/environment/pull_bucket.py +++ b/tasks/0113_185_113185711_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_185_113185711_qa_1/task.toml b/tasks/0113_185_113185711_qa_1/task.toml index d8fa6c112c06fe973be52f6acac30ed03aefaedd..b6609b43f95e7afcba83750e668cd74e4718853e 100644 --- a/tasks/0113_185_113185711_qa_1/task.toml +++ b/tasks/0113_185_113185711_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_185_113185711_qa_3/environment/bootstrap.sh b/tasks/0113_185_113185711_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_185_113185711_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_185_113185711_qa_3/environment/pull_bucket.py b/tasks/0113_185_113185711_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_185_113185711_qa_3/environment/pull_bucket.py +++ b/tasks/0113_185_113185711_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_185_113185711_qa_3/task.toml b/tasks/0113_185_113185711_qa_3/task.toml index cefcac05627a58b8c6d8426d2fe59d827d58e0cb..e15f3fb55d19ceeb064bd7c9057564b5ff5ab44a 100644 --- a/tasks/0113_185_113185711_qa_3/task.toml +++ b/tasks/0113_185_113185711_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_222_113222481_qa_1/environment/bootstrap.sh b/tasks/0113_222_113222481_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_222_113222481_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_222_113222481_qa_1/environment/pull_bucket.py b/tasks/0113_222_113222481_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_222_113222481_qa_1/environment/pull_bucket.py +++ b/tasks/0113_222_113222481_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_222_113222481_qa_1/task.toml b/tasks/0113_222_113222481_qa_1/task.toml index 9f7d66126d21e2bd4fde1db5a6e0e99bc680ce92..2eb71c9c5befb6c6ac13677bcade9beaf0903b17 100644 --- a/tasks/0113_222_113222481_qa_1/task.toml +++ b/tasks/0113_222_113222481_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_222_113222481_qa_3/environment/bootstrap.sh b/tasks/0113_222_113222481_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_222_113222481_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_222_113222481_qa_3/environment/pull_bucket.py b/tasks/0113_222_113222481_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_222_113222481_qa_3/environment/pull_bucket.py +++ b/tasks/0113_222_113222481_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_222_113222481_qa_3/task.toml b/tasks/0113_222_113222481_qa_3/task.toml index 57e063a4f269781a05350b89419a3e06f8d397d5..2225bfc8de02e95cbe53d0f4aaae8acc8bbb1c42 100644 --- a/tasks/0113_222_113222481_qa_3/task.toml +++ b/tasks/0113_222_113222481_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_246_113246154_qa_3/environment/bootstrap.sh b/tasks/0113_246_113246154_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_246_113246154_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_246_113246154_qa_3/environment/pull_bucket.py b/tasks/0113_246_113246154_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_246_113246154_qa_3/environment/pull_bucket.py +++ b/tasks/0113_246_113246154_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_246_113246154_qa_3/task.toml b/tasks/0113_246_113246154_qa_3/task.toml index 487208b9979bc20ce96b0e1b4da1cab49abd0e1f..56c68218de3be6f999749a35e67d0b4786bc937a 100644 --- a/tasks/0113_246_113246154_qa_3/task.toml +++ b/tasks/0113_246_113246154_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_299_113299761_qa_1/environment/bootstrap.sh b/tasks/0113_299_113299761_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_299_113299761_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_299_113299761_qa_1/environment/pull_bucket.py b/tasks/0113_299_113299761_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_299_113299761_qa_1/environment/pull_bucket.py +++ b/tasks/0113_299_113299761_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_299_113299761_qa_1/task.toml b/tasks/0113_299_113299761_qa_1/task.toml index 48362735f90b2f6223b907fb4c4dbad125a27b44..db3502f5fb2f57990b12e9f7d313bc6e4588fb07 100644 --- a/tasks/0113_299_113299761_qa_1/task.toml +++ b/tasks/0113_299_113299761_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_346_113346497_qa_3/environment/bootstrap.sh b/tasks/0113_346_113346497_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_346_113346497_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_346_113346497_qa_3/environment/pull_bucket.py b/tasks/0113_346_113346497_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_346_113346497_qa_3/environment/pull_bucket.py +++ b/tasks/0113_346_113346497_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_346_113346497_qa_3/task.toml b/tasks/0113_346_113346497_qa_3/task.toml index 81d79673b6744e7be1eb8fbf5284c5d3f74af44a..9f1b8c53ecdde20af033b67491f8685edf5e90af 100644 --- a/tasks/0113_346_113346497_qa_3/task.toml +++ b/tasks/0113_346_113346497_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_428_113428593_qa_1/environment/bootstrap.sh b/tasks/0113_428_113428593_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_428_113428593_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_428_113428593_qa_1/environment/pull_bucket.py b/tasks/0113_428_113428593_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_428_113428593_qa_1/environment/pull_bucket.py +++ b/tasks/0113_428_113428593_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_428_113428593_qa_1/task.toml b/tasks/0113_428_113428593_qa_1/task.toml index 16459ecac5a2339a35d75792b4be5ae0f8086b84..a4fcb9609cd629ff5e49652fa2c62cbabfdc12e4 100644 --- a/tasks/0113_428_113428593_qa_1/task.toml +++ b/tasks/0113_428_113428593_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_431_113431641_qa_1/environment/bootstrap.sh b/tasks/0113_431_113431641_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_431_113431641_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_431_113431641_qa_1/environment/pull_bucket.py b/tasks/0113_431_113431641_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_431_113431641_qa_1/environment/pull_bucket.py +++ b/tasks/0113_431_113431641_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_431_113431641_qa_1/task.toml b/tasks/0113_431_113431641_qa_1/task.toml index a6b62a5e93e7033a35335b320f36f7e591616ac1..bed89c421d6d897aaae533b3e8e190ec7a33ba9d 100644 --- a/tasks/0113_431_113431641_qa_1/task.toml +++ b/tasks/0113_431_113431641_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_504_113504478_qa_1/environment/bootstrap.sh b/tasks/0113_504_113504478_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_504_113504478_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_504_113504478_qa_1/environment/pull_bucket.py b/tasks/0113_504_113504478_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_504_113504478_qa_1/environment/pull_bucket.py +++ b/tasks/0113_504_113504478_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_504_113504478_qa_1/task.toml b/tasks/0113_504_113504478_qa_1/task.toml index f879f829192ffea24318b0274e70bb706f66d6c1..e9d4d021a94665296d03128386f30fb44ba4735c 100644 --- a/tasks/0113_504_113504478_qa_1/task.toml +++ b/tasks/0113_504_113504478_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_504_113504478_qa_3/environment/bootstrap.sh b/tasks/0113_504_113504478_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_504_113504478_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_504_113504478_qa_3/environment/pull_bucket.py b/tasks/0113_504_113504478_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_504_113504478_qa_3/environment/pull_bucket.py +++ b/tasks/0113_504_113504478_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_504_113504478_qa_3/task.toml b/tasks/0113_504_113504478_qa_3/task.toml index ad93cb58b3331f85253075bbe702c510740be889..f15e8d014214f832f4cdf5ed478360130090146a 100644 --- a/tasks/0113_504_113504478_qa_3/task.toml +++ b/tasks/0113_504_113504478_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_504_113504478_qa_5/environment/bootstrap.sh b/tasks/0113_504_113504478_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_504_113504478_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_504_113504478_qa_5/environment/pull_bucket.py b/tasks/0113_504_113504478_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_504_113504478_qa_5/environment/pull_bucket.py +++ b/tasks/0113_504_113504478_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_504_113504478_qa_5/task.toml b/tasks/0113_504_113504478_qa_5/task.toml index 96ac139ccb35539fedec49541ce45097e24a8b84..7423949ee5d197cd7f1ec8a074f2b4c12d4a214b 100644 --- a/tasks/0113_504_113504478_qa_5/task.toml +++ b/tasks/0113_504_113504478_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_554_113554614_qa_1/environment/bootstrap.sh b/tasks/0113_554_113554614_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_554_113554614_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_554_113554614_qa_1/environment/pull_bucket.py b/tasks/0113_554_113554614_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_554_113554614_qa_1/environment/pull_bucket.py +++ b/tasks/0113_554_113554614_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_554_113554614_qa_1/task.toml b/tasks/0113_554_113554614_qa_1/task.toml index b7ef0090019a5a1bd9474b5e932c640ba0966624..81296be3fcd5be886190a78b0e7e061267554b9e 100644 --- a/tasks/0113_554_113554614_qa_1/task.toml +++ b/tasks/0113_554_113554614_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_633_113633083_qa_3/environment/bootstrap.sh b/tasks/0113_633_113633083_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_633_113633083_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_633_113633083_qa_3/environment/pull_bucket.py b/tasks/0113_633_113633083_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_633_113633083_qa_3/environment/pull_bucket.py +++ b/tasks/0113_633_113633083_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_633_113633083_qa_3/task.toml b/tasks/0113_633_113633083_qa_3/task.toml index 0b08d98a12bab89686b9ad083e9852310824b8ce..d7e54d2251601c5cc828239ccb45c7e823e97949 100644 --- a/tasks/0113_633_113633083_qa_3/task.toml +++ b/tasks/0113_633_113633083_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_633_113633083_qa_5/environment/bootstrap.sh b/tasks/0113_633_113633083_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_633_113633083_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_633_113633083_qa_5/environment/pull_bucket.py b/tasks/0113_633_113633083_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_633_113633083_qa_5/environment/pull_bucket.py +++ b/tasks/0113_633_113633083_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_633_113633083_qa_5/task.toml b/tasks/0113_633_113633083_qa_5/task.toml index 9903be9cf93bde0d3ca3c3676a092ae284cd935f..2f07cbd068c4afc206bc90eee84c5cd125bd51b5 100644 --- a/tasks/0113_633_113633083_qa_5/task.toml +++ b/tasks/0113_633_113633083_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_657_113657881_qa_3/environment/bootstrap.sh b/tasks/0113_657_113657881_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_657_113657881_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_657_113657881_qa_3/environment/pull_bucket.py b/tasks/0113_657_113657881_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_657_113657881_qa_3/environment/pull_bucket.py +++ b/tasks/0113_657_113657881_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_657_113657881_qa_3/task.toml b/tasks/0113_657_113657881_qa_3/task.toml index 7279e132d0b02660997759e6534e7f4f5001bc67..aaf25bf654d9f7cd972bd211c4cf45286c4ad0e5 100644 --- a/tasks/0113_657_113657881_qa_3/task.toml +++ b/tasks/0113_657_113657881_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_694_113694619_qa_1/environment/bootstrap.sh b/tasks/0113_694_113694619_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_694_113694619_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_694_113694619_qa_1/environment/pull_bucket.py b/tasks/0113_694_113694619_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_694_113694619_qa_1/environment/pull_bucket.py +++ b/tasks/0113_694_113694619_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_694_113694619_qa_1/task.toml b/tasks/0113_694_113694619_qa_1/task.toml index 27544249a8ef01c5639123fe701e3a68be3b678c..3ec912c82371dbb97df2016ccfee7b6c83e40c9d 100644 --- a/tasks/0113_694_113694619_qa_1/task.toml +++ b/tasks/0113_694_113694619_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_768_113768809_qa_2/environment/bootstrap.sh b/tasks/0113_768_113768809_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_768_113768809_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_768_113768809_qa_2/environment/pull_bucket.py b/tasks/0113_768_113768809_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_768_113768809_qa_2/environment/pull_bucket.py +++ b/tasks/0113_768_113768809_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_768_113768809_qa_2/task.toml b/tasks/0113_768_113768809_qa_2/task.toml index c75c29001a65628f66df57c0d054c6ab85b57676..b68ec72b2c0bec9879c8454cc17df888d16d23aa 100644 --- a/tasks/0113_768_113768809_qa_2/task.toml +++ b/tasks/0113_768_113768809_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_768_113768809_qa_5/environment/bootstrap.sh b/tasks/0113_768_113768809_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_768_113768809_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_768_113768809_qa_5/environment/pull_bucket.py b/tasks/0113_768_113768809_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_768_113768809_qa_5/environment/pull_bucket.py +++ b/tasks/0113_768_113768809_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_768_113768809_qa_5/task.toml b/tasks/0113_768_113768809_qa_5/task.toml index 8b70a8215827af574b1428d27e0e7c0ea0532027..325149d34a6796d2d34368b3dae25f5657682636 100644 --- a/tasks/0113_768_113768809_qa_5/task.toml +++ b/tasks/0113_768_113768809_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_777_113777393_qa_2/environment/bootstrap.sh b/tasks/0113_777_113777393_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_777_113777393_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_777_113777393_qa_2/environment/pull_bucket.py b/tasks/0113_777_113777393_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_777_113777393_qa_2/environment/pull_bucket.py +++ b/tasks/0113_777_113777393_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_777_113777393_qa_2/task.toml b/tasks/0113_777_113777393_qa_2/task.toml index a546090e6faf34f4813c65f8e839c051a5ff4aff..0f6c2bc1768be1e230d912b7bee4c0fdb79a0957 100644 --- a/tasks/0113_777_113777393_qa_2/task.toml +++ b/tasks/0113_777_113777393_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_777_113777393_qa_5/environment/bootstrap.sh b/tasks/0113_777_113777393_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_777_113777393_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_777_113777393_qa_5/environment/pull_bucket.py b/tasks/0113_777_113777393_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_777_113777393_qa_5/environment/pull_bucket.py +++ b/tasks/0113_777_113777393_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_777_113777393_qa_5/task.toml b/tasks/0113_777_113777393_qa_5/task.toml index 228fe515b2d5f03369172501f8deccff07425349..f6fe59efda6bb0db502c798b20e0f9a1f58d7831 100644 --- a/tasks/0113_777_113777393_qa_5/task.toml +++ b/tasks/0113_777_113777393_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_834_113834948_qa_1/environment/bootstrap.sh b/tasks/0113_834_113834948_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_834_113834948_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_834_113834948_qa_1/environment/pull_bucket.py b/tasks/0113_834_113834948_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_834_113834948_qa_1/environment/pull_bucket.py +++ b/tasks/0113_834_113834948_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_834_113834948_qa_1/task.toml b/tasks/0113_834_113834948_qa_1/task.toml index 3d2e8e77d852d9cda5db4ae93de48d02d371b973..a3a66d9e810aa073fb3f2c10f2e45406d71d17f1 100644 --- a/tasks/0113_834_113834948_qa_1/task.toml +++ b/tasks/0113_834_113834948_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_851_113851860_qa_3/environment/bootstrap.sh b/tasks/0113_851_113851860_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_851_113851860_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_851_113851860_qa_3/environment/pull_bucket.py b/tasks/0113_851_113851860_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_851_113851860_qa_3/environment/pull_bucket.py +++ b/tasks/0113_851_113851860_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_851_113851860_qa_3/task.toml b/tasks/0113_851_113851860_qa_3/task.toml index 064a785575f6a6b8d2b08bb2ee055a06f9bfd568..e9734fd7f0657c01722c18799223255dfcbfb2a6 100644 --- a/tasks/0113_851_113851860_qa_3/task.toml +++ b/tasks/0113_851_113851860_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_851_113851860_qa_5/environment/bootstrap.sh b/tasks/0113_851_113851860_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_851_113851860_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_851_113851860_qa_5/environment/pull_bucket.py b/tasks/0113_851_113851860_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_851_113851860_qa_5/environment/pull_bucket.py +++ b/tasks/0113_851_113851860_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_851_113851860_qa_5/task.toml b/tasks/0113_851_113851860_qa_5/task.toml index bbe4bdf257bf20c749b7e3e0eaa47ab0d5d71217..5378aa99541c406d60da71ec5f3df8516578e064 100644 --- a/tasks/0113_851_113851860_qa_5/task.toml +++ b/tasks/0113_851_113851860_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_907_113907466_qa_1/environment/bootstrap.sh b/tasks/0113_907_113907466_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_907_113907466_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_907_113907466_qa_1/environment/pull_bucket.py b/tasks/0113_907_113907466_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_907_113907466_qa_1/environment/pull_bucket.py +++ b/tasks/0113_907_113907466_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_907_113907466_qa_1/task.toml b/tasks/0113_907_113907466_qa_1/task.toml index 5d709c211c20e3506c83bcea7320b8822361c2ac..539739928b58e602140cd3af3404c175f5605a2f 100644 --- a/tasks/0113_907_113907466_qa_1/task.toml +++ b/tasks/0113_907_113907466_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_924_113924850_qa_4/environment/bootstrap.sh b/tasks/0113_924_113924850_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_924_113924850_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_924_113924850_qa_4/environment/pull_bucket.py b/tasks/0113_924_113924850_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_924_113924850_qa_4/environment/pull_bucket.py +++ b/tasks/0113_924_113924850_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_924_113924850_qa_4/task.toml b/tasks/0113_924_113924850_qa_4/task.toml index c0f7944670f22a546c10495103e4914705259dff..29dc8a2d9f5cab0cd7f00e0f4f84ddaf9c2d372e 100644 --- a/tasks/0113_924_113924850_qa_4/task.toml +++ b/tasks/0113_924_113924850_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_929_113929776_qa_2/environment/bootstrap.sh b/tasks/0113_929_113929776_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_929_113929776_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_929_113929776_qa_2/environment/pull_bucket.py b/tasks/0113_929_113929776_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_929_113929776_qa_2/environment/pull_bucket.py +++ b/tasks/0113_929_113929776_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_929_113929776_qa_2/task.toml b/tasks/0113_929_113929776_qa_2/task.toml index aa85b87bf506dc733b8da9add39a19766943e9cf..21c3128a2515e7596cd81b19aceb56d54358d98c 100644 --- a/tasks/0113_929_113929776_qa_2/task.toml +++ b/tasks/0113_929_113929776_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_929_113929776_qa_3/environment/bootstrap.sh b/tasks/0113_929_113929776_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_929_113929776_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_929_113929776_qa_3/environment/pull_bucket.py b/tasks/0113_929_113929776_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_929_113929776_qa_3/environment/pull_bucket.py +++ b/tasks/0113_929_113929776_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_929_113929776_qa_3/task.toml b/tasks/0113_929_113929776_qa_3/task.toml index deadb1560f15abee20798e693a51559b39f4a00e..27ddcaf6d37a4f397f345bb5efea3f12755ed715 100644 --- a/tasks/0113_929_113929776_qa_3/task.toml +++ b/tasks/0113_929_113929776_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_929_113929776_qa_5/environment/bootstrap.sh b/tasks/0113_929_113929776_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_929_113929776_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_929_113929776_qa_5/environment/pull_bucket.py b/tasks/0113_929_113929776_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_929_113929776_qa_5/environment/pull_bucket.py +++ b/tasks/0113_929_113929776_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_929_113929776_qa_5/task.toml b/tasks/0113_929_113929776_qa_5/task.toml index 1e649e45049a37dfb633e5bcefe47cd965745958..98aaccddae40dddc1ab0ee92ae9ea093f7e3f66e 100644 --- a/tasks/0113_929_113929776_qa_5/task.toml +++ b/tasks/0113_929_113929776_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_941_113941848_qa_4/environment/bootstrap.sh b/tasks/0113_941_113941848_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_941_113941848_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_941_113941848_qa_4/environment/pull_bucket.py b/tasks/0113_941_113941848_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_941_113941848_qa_4/environment/pull_bucket.py +++ b/tasks/0113_941_113941848_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_941_113941848_qa_4/task.toml b/tasks/0113_941_113941848_qa_4/task.toml index 76291d7db02746dc4544c24086f4f506f2034e9d..6b0f6a3a8744547ade111916690317f44220952e 100644 --- a/tasks/0113_941_113941848_qa_4/task.toml +++ b/tasks/0113_941_113941848_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_942_113942967_qa_4/environment/bootstrap.sh b/tasks/0113_942_113942967_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_942_113942967_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_942_113942967_qa_4/environment/pull_bucket.py b/tasks/0113_942_113942967_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_942_113942967_qa_4/environment/pull_bucket.py +++ b/tasks/0113_942_113942967_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_942_113942967_qa_4/task.toml b/tasks/0113_942_113942967_qa_4/task.toml index 1ad4e7282c3275860b472795e252dbe513dad6f9..3f32c3069b7a9b2eb8810315b29c245d327e7ec5 100644 --- a/tasks/0113_942_113942967_qa_4/task.toml +++ b/tasks/0113_942_113942967_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_964_113964418_qa_5/environment/bootstrap.sh b/tasks/0113_964_113964418_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_964_113964418_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_964_113964418_qa_5/environment/pull_bucket.py b/tasks/0113_964_113964418_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_964_113964418_qa_5/environment/pull_bucket.py +++ b/tasks/0113_964_113964418_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_964_113964418_qa_5/task.toml b/tasks/0113_964_113964418_qa_5/task.toml index daeae6eb4aeeae4e983feea5113b56da8acd1026..da12d0c5ae32518f0dae776baac5da9391a61349 100644 --- a/tasks/0113_964_113964418_qa_5/task.toml +++ b/tasks/0113_964_113964418_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_981_113981609_qa_5/environment/bootstrap.sh b/tasks/0113_981_113981609_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_981_113981609_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_981_113981609_qa_5/environment/pull_bucket.py b/tasks/0113_981_113981609_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_981_113981609_qa_5/environment/pull_bucket.py +++ b/tasks/0113_981_113981609_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_981_113981609_qa_5/task.toml b/tasks/0113_981_113981609_qa_5/task.toml index 208af55c58e7ac0e0e909e69458ea8c1d1047d2d..04f5d370d24a5e2b3dfc77cf0f2e786b76e8c40d 100644 --- a/tasks/0113_981_113981609_qa_5/task.toml +++ b/tasks/0113_981_113981609_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_996_113996719_qa_2/environment/bootstrap.sh b/tasks/0113_996_113996719_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_996_113996719_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_996_113996719_qa_2/environment/pull_bucket.py b/tasks/0113_996_113996719_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_996_113996719_qa_2/environment/pull_bucket.py +++ b/tasks/0113_996_113996719_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_996_113996719_qa_2/task.toml b/tasks/0113_996_113996719_qa_2/task.toml index 70d0796387df8427db34966667c4b5b8efb2ebc5..3b2a98212ca6a77640d959290fe7289b65766340 100644 --- a/tasks/0113_996_113996719_qa_2/task.toml +++ b/tasks/0113_996_113996719_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_996_113996719_qa_4/environment/bootstrap.sh b/tasks/0113_996_113996719_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_996_113996719_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_996_113996719_qa_4/environment/pull_bucket.py b/tasks/0113_996_113996719_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_996_113996719_qa_4/environment/pull_bucket.py +++ b/tasks/0113_996_113996719_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_996_113996719_qa_4/task.toml b/tasks/0113_996_113996719_qa_4/task.toml index 2f6df6973372d0b6e02b9777200c7259e8eb4ecc..425b6db37f6e03b9d6e28f2a8d60ad66c2be7076 100644 --- a/tasks/0113_996_113996719_qa_4/task.toml +++ b/tasks/0113_996_113996719_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0113_997_113997588_qa_4/environment/bootstrap.sh b/tasks/0113_997_113997588_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0113_997_113997588_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0113_997_113997588_qa_4/environment/pull_bucket.py b/tasks/0113_997_113997588_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0113_997_113997588_qa_4/environment/pull_bucket.py +++ b/tasks/0113_997_113997588_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0113_997_113997588_qa_4/task.toml b/tasks/0113_997_113997588_qa_4/task.toml index 237a72ea0144819b9d8e177ef49fd45dffff30a1..bb2789ff6b93f0b04d7a9362c6994d2a074a538e 100644 --- a/tasks/0113_997_113997588_qa_4/task.toml +++ b/tasks/0113_997_113997588_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_063_114063568_qa_3/environment/bootstrap.sh b/tasks/0114_063_114063568_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_063_114063568_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_063_114063568_qa_3/environment/pull_bucket.py b/tasks/0114_063_114063568_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_063_114063568_qa_3/environment/pull_bucket.py +++ b/tasks/0114_063_114063568_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_063_114063568_qa_3/task.toml b/tasks/0114_063_114063568_qa_3/task.toml index 8bc284dc16387077d0f599978f7d85fdb6d7b050..08b99a78a705797b136d98491e2e582aabb3db57 100644 --- a/tasks/0114_063_114063568_qa_3/task.toml +++ b/tasks/0114_063_114063568_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_091_114091161_qa_1/environment/bootstrap.sh b/tasks/0114_091_114091161_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_091_114091161_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_091_114091161_qa_1/environment/pull_bucket.py b/tasks/0114_091_114091161_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_091_114091161_qa_1/environment/pull_bucket.py +++ b/tasks/0114_091_114091161_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_091_114091161_qa_1/task.toml b/tasks/0114_091_114091161_qa_1/task.toml index 412fa3a564d2f2ccf301776e8b9fbe7efda921ac..3b33f85c925d2ff3e5da95c53d79f3c4d5c8752c 100644 --- a/tasks/0114_091_114091161_qa_1/task.toml +++ b/tasks/0114_091_114091161_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_091_114091161_qa_2/environment/bootstrap.sh b/tasks/0114_091_114091161_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_091_114091161_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_091_114091161_qa_2/environment/pull_bucket.py b/tasks/0114_091_114091161_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_091_114091161_qa_2/environment/pull_bucket.py +++ b/tasks/0114_091_114091161_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_091_114091161_qa_2/task.toml b/tasks/0114_091_114091161_qa_2/task.toml index 2e8f87f487d9c464c5dc394d5c6eefae279b18a7..5af3b0e2d3f32568fcab152e9cddd95c033c7505 100644 --- a/tasks/0114_091_114091161_qa_2/task.toml +++ b/tasks/0114_091_114091161_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_091_114091161_qa_3/environment/bootstrap.sh b/tasks/0114_091_114091161_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_091_114091161_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_091_114091161_qa_3/environment/pull_bucket.py b/tasks/0114_091_114091161_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_091_114091161_qa_3/environment/pull_bucket.py +++ b/tasks/0114_091_114091161_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_091_114091161_qa_3/task.toml b/tasks/0114_091_114091161_qa_3/task.toml index 174d280ebefc3654c906d6c32435f7dcc6488ac8..512059d21eef6137978d78ba84410a2e9ea1862b 100644 --- a/tasks/0114_091_114091161_qa_3/task.toml +++ b/tasks/0114_091_114091161_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_161_114161356_qa_1/environment/bootstrap.sh b/tasks/0114_161_114161356_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_161_114161356_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_161_114161356_qa_1/environment/pull_bucket.py b/tasks/0114_161_114161356_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_161_114161356_qa_1/environment/pull_bucket.py +++ b/tasks/0114_161_114161356_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_161_114161356_qa_1/task.toml b/tasks/0114_161_114161356_qa_1/task.toml index 89b1a4f3f1e79b942c3e72dde0bc0c09e57b4d96..73016169be795d950a1fc03b58954efe11959f50 100644 --- a/tasks/0114_161_114161356_qa_1/task.toml +++ b/tasks/0114_161_114161356_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_161_114161356_qa_4/environment/bootstrap.sh b/tasks/0114_161_114161356_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_161_114161356_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_161_114161356_qa_4/environment/pull_bucket.py b/tasks/0114_161_114161356_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_161_114161356_qa_4/environment/pull_bucket.py +++ b/tasks/0114_161_114161356_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_161_114161356_qa_4/task.toml b/tasks/0114_161_114161356_qa_4/task.toml index 3e515eb6bd4595bfa691743701e6407b87e8204b..3a59741f89840338e972007a54396f20f66dba49 100644 --- a/tasks/0114_161_114161356_qa_4/task.toml +++ b/tasks/0114_161_114161356_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_240_114240861_qa_2/environment/bootstrap.sh b/tasks/0114_240_114240861_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_240_114240861_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_240_114240861_qa_2/environment/pull_bucket.py b/tasks/0114_240_114240861_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_240_114240861_qa_2/environment/pull_bucket.py +++ b/tasks/0114_240_114240861_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_240_114240861_qa_2/task.toml b/tasks/0114_240_114240861_qa_2/task.toml index 65e076e9c23fa064feb123799763dfa803e66ca0..19b1724f4c382c3c9bd7f9a2c298825f4e59eb1f 100644 --- a/tasks/0114_240_114240861_qa_2/task.toml +++ b/tasks/0114_240_114240861_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_240_114240861_qa_4/environment/bootstrap.sh b/tasks/0114_240_114240861_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_240_114240861_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_240_114240861_qa_4/environment/pull_bucket.py b/tasks/0114_240_114240861_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_240_114240861_qa_4/environment/pull_bucket.py +++ b/tasks/0114_240_114240861_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_240_114240861_qa_4/task.toml b/tasks/0114_240_114240861_qa_4/task.toml index caba3398abfde1ec6875da0010ab6f064a054e10..8a1d1b346ebcd480e323d28f579c15261a62e7cb 100644 --- a/tasks/0114_240_114240861_qa_4/task.toml +++ b/tasks/0114_240_114240861_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_325_114325622_qa_4/environment/bootstrap.sh b/tasks/0114_325_114325622_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_325_114325622_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_325_114325622_qa_4/environment/pull_bucket.py b/tasks/0114_325_114325622_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_325_114325622_qa_4/environment/pull_bucket.py +++ b/tasks/0114_325_114325622_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_325_114325622_qa_4/task.toml b/tasks/0114_325_114325622_qa_4/task.toml index 68995cb59d5479535379f89fc0319f7bef4ff59f..503811364551421b0fc66f5b0af16acea1fcad85 100644 --- a/tasks/0114_325_114325622_qa_4/task.toml +++ b/tasks/0114_325_114325622_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_365_114365503_qa_5/environment/bootstrap.sh b/tasks/0114_365_114365503_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_365_114365503_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_365_114365503_qa_5/environment/pull_bucket.py b/tasks/0114_365_114365503_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_365_114365503_qa_5/environment/pull_bucket.py +++ b/tasks/0114_365_114365503_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_365_114365503_qa_5/task.toml b/tasks/0114_365_114365503_qa_5/task.toml index a6f45240039e4f559173c8be209d805a44e52175..c2cc962cfd92146a009d2562692be18fe1af1f54 100644 --- a/tasks/0114_365_114365503_qa_5/task.toml +++ b/tasks/0114_365_114365503_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_451_114451465_qa_1/environment/bootstrap.sh b/tasks/0114_451_114451465_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_451_114451465_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_451_114451465_qa_1/environment/pull_bucket.py b/tasks/0114_451_114451465_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_451_114451465_qa_1/environment/pull_bucket.py +++ b/tasks/0114_451_114451465_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_451_114451465_qa_1/task.toml b/tasks/0114_451_114451465_qa_1/task.toml index 09fe4c3b55180f612306f206d5d52b799811e1e5..16be0d5e9a42aff36f1dad23aa4a81be4921565b 100644 --- a/tasks/0114_451_114451465_qa_1/task.toml +++ b/tasks/0114_451_114451465_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_484_114484617_qa_1/environment/bootstrap.sh b/tasks/0114_484_114484617_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_484_114484617_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_484_114484617_qa_1/environment/pull_bucket.py b/tasks/0114_484_114484617_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_484_114484617_qa_1/environment/pull_bucket.py +++ b/tasks/0114_484_114484617_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_484_114484617_qa_1/task.toml b/tasks/0114_484_114484617_qa_1/task.toml index ac315467f462d853383ac0ea140cf1ba60e108d2..a4f555640211ce5e456f3d56a6c7a194c95ee156 100644 --- a/tasks/0114_484_114484617_qa_1/task.toml +++ b/tasks/0114_484_114484617_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_484_114484617_qa_4/environment/bootstrap.sh b/tasks/0114_484_114484617_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_484_114484617_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_484_114484617_qa_4/environment/pull_bucket.py b/tasks/0114_484_114484617_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_484_114484617_qa_4/environment/pull_bucket.py +++ b/tasks/0114_484_114484617_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_484_114484617_qa_4/task.toml b/tasks/0114_484_114484617_qa_4/task.toml index cc339cecf7431d1f324fef72d191cd6f120aad84..041619f3fbb118654f50d280f45cad9130ae292e 100644 --- a/tasks/0114_484_114484617_qa_4/task.toml +++ b/tasks/0114_484_114484617_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_484_114484829_qa_4/environment/bootstrap.sh b/tasks/0114_484_114484829_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_484_114484829_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_484_114484829_qa_4/environment/pull_bucket.py b/tasks/0114_484_114484829_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_484_114484829_qa_4/environment/pull_bucket.py +++ b/tasks/0114_484_114484829_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_484_114484829_qa_4/task.toml b/tasks/0114_484_114484829_qa_4/task.toml index 3e54f770c5dd6cf2e1cec560550832f10accf8cc..bbcc6aa82b6d9c8e313a6256f6c9ccba2467fcce 100644 --- a/tasks/0114_484_114484829_qa_4/task.toml +++ b/tasks/0114_484_114484829_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_503_114503160_qa_2/environment/bootstrap.sh b/tasks/0114_503_114503160_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_503_114503160_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_503_114503160_qa_2/environment/pull_bucket.py b/tasks/0114_503_114503160_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_503_114503160_qa_2/environment/pull_bucket.py +++ b/tasks/0114_503_114503160_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_503_114503160_qa_2/task.toml b/tasks/0114_503_114503160_qa_2/task.toml index 50000b7dcdb9517fa9d3122bd9a4ec19ff522245..08abf1edb815bf98cbbc33d16453abc3fa8233da 100644 --- a/tasks/0114_503_114503160_qa_2/task.toml +++ b/tasks/0114_503_114503160_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_525_114525119_qa_3/environment/bootstrap.sh b/tasks/0114_525_114525119_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_525_114525119_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_525_114525119_qa_3/environment/pull_bucket.py b/tasks/0114_525_114525119_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_525_114525119_qa_3/environment/pull_bucket.py +++ b/tasks/0114_525_114525119_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_525_114525119_qa_3/task.toml b/tasks/0114_525_114525119_qa_3/task.toml index 4f3cd8c05c626dc3cb946258bf8bfaaa4e6e82fd..5cf48b53dd238f97d488a8494a1220a3f382d364 100644 --- a/tasks/0114_525_114525119_qa_3/task.toml +++ b/tasks/0114_525_114525119_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_582_114582781_qa_1/environment/bootstrap.sh b/tasks/0114_582_114582781_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_582_114582781_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_582_114582781_qa_1/environment/pull_bucket.py b/tasks/0114_582_114582781_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_582_114582781_qa_1/environment/pull_bucket.py +++ b/tasks/0114_582_114582781_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_582_114582781_qa_1/task.toml b/tasks/0114_582_114582781_qa_1/task.toml index f24bd13ed2a60fef214bf2450626808052374b8c..ba179b1177121ee11fd9b8b239388dd4c50002d6 100644 --- a/tasks/0114_582_114582781_qa_1/task.toml +++ b/tasks/0114_582_114582781_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_582_114582781_qa_5/environment/bootstrap.sh b/tasks/0114_582_114582781_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_582_114582781_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_582_114582781_qa_5/environment/pull_bucket.py b/tasks/0114_582_114582781_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_582_114582781_qa_5/environment/pull_bucket.py +++ b/tasks/0114_582_114582781_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_582_114582781_qa_5/task.toml b/tasks/0114_582_114582781_qa_5/task.toml index 435bbca2106bf6a2785545513ab3b8ab24f80779..3167131defbc9df3aeb8efc29c318cd9fd9535d5 100644 --- a/tasks/0114_582_114582781_qa_5/task.toml +++ b/tasks/0114_582_114582781_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_618_114618907_qa_2/environment/bootstrap.sh b/tasks/0114_618_114618907_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_618_114618907_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_618_114618907_qa_2/environment/pull_bucket.py b/tasks/0114_618_114618907_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_618_114618907_qa_2/environment/pull_bucket.py +++ b/tasks/0114_618_114618907_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_618_114618907_qa_2/task.toml b/tasks/0114_618_114618907_qa_2/task.toml index cf02abbc6cb67353840e9466eb844e9736bac760..bb07d25fc7802664de2d7e3fc2f53bfcadb70bc1 100644 --- a/tasks/0114_618_114618907_qa_2/task.toml +++ b/tasks/0114_618_114618907_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_673_114673575_qa_5/environment/bootstrap.sh b/tasks/0114_673_114673575_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_673_114673575_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_673_114673575_qa_5/environment/pull_bucket.py b/tasks/0114_673_114673575_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_673_114673575_qa_5/environment/pull_bucket.py +++ b/tasks/0114_673_114673575_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_673_114673575_qa_5/task.toml b/tasks/0114_673_114673575_qa_5/task.toml index 1165b4c09b9cecec841d7b092a09135ddb1cad5f..1b14d08712ef1d9ba21eeca75858b9fbe862fc7f 100644 --- a/tasks/0114_673_114673575_qa_5/task.toml +++ b/tasks/0114_673_114673575_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_713_114713370_qa_2/environment/bootstrap.sh b/tasks/0114_713_114713370_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_713_114713370_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_713_114713370_qa_2/environment/pull_bucket.py b/tasks/0114_713_114713370_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_713_114713370_qa_2/environment/pull_bucket.py +++ b/tasks/0114_713_114713370_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_713_114713370_qa_2/task.toml b/tasks/0114_713_114713370_qa_2/task.toml index 4464fe72506d20dc77f50722f11d7016fc9e0fe8..908bb35315581e30330ee47baba044c7408a4a7e 100644 --- a/tasks/0114_713_114713370_qa_2/task.toml +++ b/tasks/0114_713_114713370_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_713_114713370_qa_5/environment/bootstrap.sh b/tasks/0114_713_114713370_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_713_114713370_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_713_114713370_qa_5/environment/pull_bucket.py b/tasks/0114_713_114713370_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_713_114713370_qa_5/environment/pull_bucket.py +++ b/tasks/0114_713_114713370_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_713_114713370_qa_5/task.toml b/tasks/0114_713_114713370_qa_5/task.toml index 57c1d444bdcac625461316a1c338095b81a74fb6..835154dad5e7d142af44f01aa13164fcf83aa160 100644 --- a/tasks/0114_713_114713370_qa_5/task.toml +++ b/tasks/0114_713_114713370_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_726_114726307_qa_4/environment/bootstrap.sh b/tasks/0114_726_114726307_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_726_114726307_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_726_114726307_qa_4/environment/pull_bucket.py b/tasks/0114_726_114726307_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_726_114726307_qa_4/environment/pull_bucket.py +++ b/tasks/0114_726_114726307_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_726_114726307_qa_4/task.toml b/tasks/0114_726_114726307_qa_4/task.toml index b205a0bb11950b72225dc47317671bba24388277..b20a3d496202bbb492c97399a5a5541b94913c7a 100644 --- a/tasks/0114_726_114726307_qa_4/task.toml +++ b/tasks/0114_726_114726307_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_908_114908217_qa_4/environment/bootstrap.sh b/tasks/0114_908_114908217_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_908_114908217_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_908_114908217_qa_4/environment/pull_bucket.py b/tasks/0114_908_114908217_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_908_114908217_qa_4/environment/pull_bucket.py +++ b/tasks/0114_908_114908217_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_908_114908217_qa_4/task.toml b/tasks/0114_908_114908217_qa_4/task.toml index 60724193b2a2f5125442de0f511cd115c64ed131..d62bda18a53d10520ab422fe58e4e5196f83c2e8 100644 --- a/tasks/0114_908_114908217_qa_4/task.toml +++ b/tasks/0114_908_114908217_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_928_114928761_qa_2/environment/bootstrap.sh b/tasks/0114_928_114928761_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_928_114928761_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_928_114928761_qa_2/environment/pull_bucket.py b/tasks/0114_928_114928761_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_928_114928761_qa_2/environment/pull_bucket.py +++ b/tasks/0114_928_114928761_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_928_114928761_qa_2/task.toml b/tasks/0114_928_114928761_qa_2/task.toml index bc7f0afdfbbbc0d765e849202bdcaf0284a9e687..e8de5a83cb4c878d1db959ac57a5b2ceebc63bc0 100644 --- a/tasks/0114_928_114928761_qa_2/task.toml +++ b/tasks/0114_928_114928761_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_928_114928761_qa_5/environment/bootstrap.sh b/tasks/0114_928_114928761_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_928_114928761_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_928_114928761_qa_5/environment/pull_bucket.py b/tasks/0114_928_114928761_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_928_114928761_qa_5/environment/pull_bucket.py +++ b/tasks/0114_928_114928761_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_928_114928761_qa_5/task.toml b/tasks/0114_928_114928761_qa_5/task.toml index 992cf9da9085e6ef97fd82a81328827052ef63a5..877dbe849148a7446f423ee741bfa518709ffb16 100644 --- a/tasks/0114_928_114928761_qa_5/task.toml +++ b/tasks/0114_928_114928761_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_944_114944895_qa_1/environment/bootstrap.sh b/tasks/0114_944_114944895_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_944_114944895_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_944_114944895_qa_1/environment/pull_bucket.py b/tasks/0114_944_114944895_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_944_114944895_qa_1/environment/pull_bucket.py +++ b/tasks/0114_944_114944895_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_944_114944895_qa_1/task.toml b/tasks/0114_944_114944895_qa_1/task.toml index 3bafe077d14c173fb678159dc110b266bfc2de10..3bb92d176df1244f5a83489366a42646c68c8db5 100644 --- a/tasks/0114_944_114944895_qa_1/task.toml +++ b/tasks/0114_944_114944895_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_982_114982067_qa_2/environment/bootstrap.sh b/tasks/0114_982_114982067_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_982_114982067_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_982_114982067_qa_2/environment/pull_bucket.py b/tasks/0114_982_114982067_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_982_114982067_qa_2/environment/pull_bucket.py +++ b/tasks/0114_982_114982067_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_982_114982067_qa_2/task.toml b/tasks/0114_982_114982067_qa_2/task.toml index 30b5f959aba20a16dd0703c5b4934cf885b79da1..f22c19432304352a4777e6f2b4f8d9a14ffc4b3f 100644 --- a/tasks/0114_982_114982067_qa_2/task.toml +++ b/tasks/0114_982_114982067_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0114_986_114986805_qa_2/environment/bootstrap.sh b/tasks/0114_986_114986805_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0114_986_114986805_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0114_986_114986805_qa_2/environment/pull_bucket.py b/tasks/0114_986_114986805_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0114_986_114986805_qa_2/environment/pull_bucket.py +++ b/tasks/0114_986_114986805_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0114_986_114986805_qa_2/task.toml b/tasks/0114_986_114986805_qa_2/task.toml index 4d50e3f6af313feebc9315aba47265a0920f761e..39e5fe0cdf099bebada715d05c8f831a3577c641 100644 --- a/tasks/0114_986_114986805_qa_2/task.toml +++ b/tasks/0114_986_114986805_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_004_115004067_qa_2/environment/bootstrap.sh b/tasks/0115_004_115004067_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_004_115004067_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_004_115004067_qa_2/environment/pull_bucket.py b/tasks/0115_004_115004067_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_004_115004067_qa_2/environment/pull_bucket.py +++ b/tasks/0115_004_115004067_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_004_115004067_qa_2/task.toml b/tasks/0115_004_115004067_qa_2/task.toml index 8d5e5599f0bf76c543d098d58a5f64d7c005aa06..cab81e9df90ef5f44cf91301ce8b904a60bede14 100644 --- a/tasks/0115_004_115004067_qa_2/task.toml +++ b/tasks/0115_004_115004067_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_004_115004067_qa_3/environment/bootstrap.sh b/tasks/0115_004_115004067_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_004_115004067_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_004_115004067_qa_3/environment/pull_bucket.py b/tasks/0115_004_115004067_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_004_115004067_qa_3/environment/pull_bucket.py +++ b/tasks/0115_004_115004067_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_004_115004067_qa_3/task.toml b/tasks/0115_004_115004067_qa_3/task.toml index 94f66ce5eb3be04d36cd953434c4c25188a9d779..328f5ba9e4861c2bd9a077071351d993f8b12a20 100644 --- a/tasks/0115_004_115004067_qa_3/task.toml +++ b/tasks/0115_004_115004067_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_004_115004067_qa_4/environment/bootstrap.sh b/tasks/0115_004_115004067_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_004_115004067_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_004_115004067_qa_4/environment/pull_bucket.py b/tasks/0115_004_115004067_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_004_115004067_qa_4/environment/pull_bucket.py +++ b/tasks/0115_004_115004067_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_004_115004067_qa_4/task.toml b/tasks/0115_004_115004067_qa_4/task.toml index 5503c0a17a0f1ac6acc93941fde95e3b3deb58de..29a411f5dedc7ae77b9e508d42c511217d30b8b4 100644 --- a/tasks/0115_004_115004067_qa_4/task.toml +++ b/tasks/0115_004_115004067_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_105_115105744_qa_2/environment/bootstrap.sh b/tasks/0115_105_115105744_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_105_115105744_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_105_115105744_qa_2/environment/pull_bucket.py b/tasks/0115_105_115105744_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_105_115105744_qa_2/environment/pull_bucket.py +++ b/tasks/0115_105_115105744_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_105_115105744_qa_2/task.toml b/tasks/0115_105_115105744_qa_2/task.toml index 40baf553af4a83b4a05c56a0e5ed719b48bbba0a..19b5c88421d9c7a537263ddb10a5cc51af873fb6 100644 --- a/tasks/0115_105_115105744_qa_2/task.toml +++ b/tasks/0115_105_115105744_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_105_115105744_qa_3/environment/bootstrap.sh b/tasks/0115_105_115105744_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_105_115105744_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_105_115105744_qa_3/environment/pull_bucket.py b/tasks/0115_105_115105744_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_105_115105744_qa_3/environment/pull_bucket.py +++ b/tasks/0115_105_115105744_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_105_115105744_qa_3/task.toml b/tasks/0115_105_115105744_qa_3/task.toml index 36de1f167d5b7d7bd8ec2238374de563f95e554e..fc5d2772158648c47c7024cba5f95345db89ae95 100644 --- a/tasks/0115_105_115105744_qa_3/task.toml +++ b/tasks/0115_105_115105744_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_266_115266605_qa_1/environment/bootstrap.sh b/tasks/0115_266_115266605_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_266_115266605_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_266_115266605_qa_1/environment/pull_bucket.py b/tasks/0115_266_115266605_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_266_115266605_qa_1/environment/pull_bucket.py +++ b/tasks/0115_266_115266605_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_266_115266605_qa_1/task.toml b/tasks/0115_266_115266605_qa_1/task.toml index 3eb20191a5df1b62bcb06d77f52d00c9cd8278ec..f983b8213f9a0f4b34a2107c80e506db89c59583 100644 --- a/tasks/0115_266_115266605_qa_1/task.toml +++ b/tasks/0115_266_115266605_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_266_115266605_qa_3/environment/bootstrap.sh b/tasks/0115_266_115266605_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_266_115266605_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_266_115266605_qa_3/environment/pull_bucket.py b/tasks/0115_266_115266605_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_266_115266605_qa_3/environment/pull_bucket.py +++ b/tasks/0115_266_115266605_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_266_115266605_qa_3/task.toml b/tasks/0115_266_115266605_qa_3/task.toml index 35d3ea5f1f9b3d6f144d530a16908f71220b7cd9..56252b2a031d2406c3d08bc4cb871d1aba87333b 100644 --- a/tasks/0115_266_115266605_qa_3/task.toml +++ b/tasks/0115_266_115266605_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_266_115266605_qa_4/environment/bootstrap.sh b/tasks/0115_266_115266605_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_266_115266605_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_266_115266605_qa_4/environment/pull_bucket.py b/tasks/0115_266_115266605_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_266_115266605_qa_4/environment/pull_bucket.py +++ b/tasks/0115_266_115266605_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_266_115266605_qa_4/task.toml b/tasks/0115_266_115266605_qa_4/task.toml index 412c9599af9e2fa31c0de99833ea548bc2fa1b43..52b83f59b50ac0551e8cdf798c34bac6291dea85 100644 --- a/tasks/0115_266_115266605_qa_4/task.toml +++ b/tasks/0115_266_115266605_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_281_115281076_qa_2/environment/bootstrap.sh b/tasks/0115_281_115281076_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_281_115281076_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_281_115281076_qa_2/environment/pull_bucket.py b/tasks/0115_281_115281076_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_281_115281076_qa_2/environment/pull_bucket.py +++ b/tasks/0115_281_115281076_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_281_115281076_qa_2/task.toml b/tasks/0115_281_115281076_qa_2/task.toml index 6e43e48411c2dc477f3e50f4e681331a9b68e276..bb9cee1f288436eae84380f2cd76a24e5ddd4124 100644 --- a/tasks/0115_281_115281076_qa_2/task.toml +++ b/tasks/0115_281_115281076_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_308_115308728_qa_4/environment/bootstrap.sh b/tasks/0115_308_115308728_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_308_115308728_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_308_115308728_qa_4/environment/pull_bucket.py b/tasks/0115_308_115308728_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_308_115308728_qa_4/environment/pull_bucket.py +++ b/tasks/0115_308_115308728_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_308_115308728_qa_4/task.toml b/tasks/0115_308_115308728_qa_4/task.toml index 7e4f8b20efa732d4744048f41a89f016cd2f1734..db7fa44ce9a0bf4b10048fa913bf11b4e711ce53 100644 --- a/tasks/0115_308_115308728_qa_4/task.toml +++ b/tasks/0115_308_115308728_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_324_115324886_qa_1/environment/bootstrap.sh b/tasks/0115_324_115324886_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_324_115324886_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_324_115324886_qa_1/environment/pull_bucket.py b/tasks/0115_324_115324886_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_324_115324886_qa_1/environment/pull_bucket.py +++ b/tasks/0115_324_115324886_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_324_115324886_qa_1/task.toml b/tasks/0115_324_115324886_qa_1/task.toml index 95f419caea6be23b79f2d4ad6ae80dff30461e91..c97928fff88e13ac1b627383443b886f404e0a51 100644 --- a/tasks/0115_324_115324886_qa_1/task.toml +++ b/tasks/0115_324_115324886_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_350_115350781_qa_2/environment/bootstrap.sh b/tasks/0115_350_115350781_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_350_115350781_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_350_115350781_qa_2/environment/pull_bucket.py b/tasks/0115_350_115350781_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_350_115350781_qa_2/environment/pull_bucket.py +++ b/tasks/0115_350_115350781_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_350_115350781_qa_2/task.toml b/tasks/0115_350_115350781_qa_2/task.toml index 8053e5475a4e1a32a7c8a2cb5c8ac14a438615c6..9de3b26817f5524b65310f7a87650045e84bf0f5 100644 --- a/tasks/0115_350_115350781_qa_2/task.toml +++ b/tasks/0115_350_115350781_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_410_115410234_qa_2/environment/bootstrap.sh b/tasks/0115_410_115410234_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_410_115410234_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_410_115410234_qa_2/environment/pull_bucket.py b/tasks/0115_410_115410234_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_410_115410234_qa_2/environment/pull_bucket.py +++ b/tasks/0115_410_115410234_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_410_115410234_qa_2/task.toml b/tasks/0115_410_115410234_qa_2/task.toml index 1672bcbbfb90ccbc6b4d0b75791e47d6d547ee95..86d30d4283e7849b14499abf2cd3e730dc96c6e2 100644 --- a/tasks/0115_410_115410234_qa_2/task.toml +++ b/tasks/0115_410_115410234_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_420_115420161_qa_3/environment/bootstrap.sh b/tasks/0115_420_115420161_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_420_115420161_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_420_115420161_qa_3/environment/pull_bucket.py b/tasks/0115_420_115420161_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_420_115420161_qa_3/environment/pull_bucket.py +++ b/tasks/0115_420_115420161_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_420_115420161_qa_3/task.toml b/tasks/0115_420_115420161_qa_3/task.toml index a33ed56e2916a41d7ec5cb34c4bc93395a952ea5..6810582f67048ae0f859f6f2f428e65b7fba56ec 100644 --- a/tasks/0115_420_115420161_qa_3/task.toml +++ b/tasks/0115_420_115420161_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_422_115422452_qa_4/environment/bootstrap.sh b/tasks/0115_422_115422452_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_422_115422452_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_422_115422452_qa_4/environment/pull_bucket.py b/tasks/0115_422_115422452_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_422_115422452_qa_4/environment/pull_bucket.py +++ b/tasks/0115_422_115422452_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_422_115422452_qa_4/task.toml b/tasks/0115_422_115422452_qa_4/task.toml index 6b299026a4cb6e22313c2527b667e071cb83ebed..dab667e817f3471dc306843719583e624efbff16 100644 --- a/tasks/0115_422_115422452_qa_4/task.toml +++ b/tasks/0115_422_115422452_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_422_115422452_qa_5/environment/bootstrap.sh b/tasks/0115_422_115422452_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_422_115422452_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_422_115422452_qa_5/environment/pull_bucket.py b/tasks/0115_422_115422452_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_422_115422452_qa_5/environment/pull_bucket.py +++ b/tasks/0115_422_115422452_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_422_115422452_qa_5/task.toml b/tasks/0115_422_115422452_qa_5/task.toml index 095f2d760fd73833601b0aabeafbd67b44b77df9..442b488f2e75ba96d977431537d60db1022e3adc 100644 --- a/tasks/0115_422_115422452_qa_5/task.toml +++ b/tasks/0115_422_115422452_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_424_115424006_qa_1/environment/bootstrap.sh b/tasks/0115_424_115424006_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_424_115424006_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_424_115424006_qa_1/environment/pull_bucket.py b/tasks/0115_424_115424006_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_424_115424006_qa_1/environment/pull_bucket.py +++ b/tasks/0115_424_115424006_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_424_115424006_qa_1/task.toml b/tasks/0115_424_115424006_qa_1/task.toml index ef0e318dd8fcae91bc17ea2f6f633775eb8d0667..f59770988288ac5069bcf9b7b49a108d3b33eb41 100644 --- a/tasks/0115_424_115424006_qa_1/task.toml +++ b/tasks/0115_424_115424006_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_428_115428542_qa_1/environment/bootstrap.sh b/tasks/0115_428_115428542_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_428_115428542_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_428_115428542_qa_1/environment/pull_bucket.py b/tasks/0115_428_115428542_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_428_115428542_qa_1/environment/pull_bucket.py +++ b/tasks/0115_428_115428542_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_428_115428542_qa_1/task.toml b/tasks/0115_428_115428542_qa_1/task.toml index 3119e062ebe965393dafea238a70e7673b362562..d674e97f5096fff2341ae0b5719640fc52ae88a7 100644 --- a/tasks/0115_428_115428542_qa_1/task.toml +++ b/tasks/0115_428_115428542_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_428_115428542_qa_3/environment/bootstrap.sh b/tasks/0115_428_115428542_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_428_115428542_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_428_115428542_qa_3/environment/pull_bucket.py b/tasks/0115_428_115428542_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_428_115428542_qa_3/environment/pull_bucket.py +++ b/tasks/0115_428_115428542_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_428_115428542_qa_3/task.toml b/tasks/0115_428_115428542_qa_3/task.toml index 75d94cdefc3b7277e906a9128fcdc762a56d10e9..a4fcd0969bc9331cdb8137d66ba242c14b5fcd0d 100644 --- a/tasks/0115_428_115428542_qa_3/task.toml +++ b/tasks/0115_428_115428542_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_428_115428542_qa_5/environment/bootstrap.sh b/tasks/0115_428_115428542_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_428_115428542_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_428_115428542_qa_5/environment/pull_bucket.py b/tasks/0115_428_115428542_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_428_115428542_qa_5/environment/pull_bucket.py +++ b/tasks/0115_428_115428542_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_428_115428542_qa_5/task.toml b/tasks/0115_428_115428542_qa_5/task.toml index 7483c47c7057239698f3fefcee94c31a6cd43af3..a5aebdb34aa408150a33d3b9d76a5214cee6fd67 100644 --- a/tasks/0115_428_115428542_qa_5/task.toml +++ b/tasks/0115_428_115428542_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_450_115450695_qa_2/environment/bootstrap.sh b/tasks/0115_450_115450695_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_450_115450695_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_450_115450695_qa_2/environment/pull_bucket.py b/tasks/0115_450_115450695_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_450_115450695_qa_2/environment/pull_bucket.py +++ b/tasks/0115_450_115450695_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_450_115450695_qa_2/task.toml b/tasks/0115_450_115450695_qa_2/task.toml index 44604d03ef0bd3c1c23db76a13c3799b00ea982d..39b7fe6b2a7836e777d9c2759932c7dde355089c 100644 --- a/tasks/0115_450_115450695_qa_2/task.toml +++ b/tasks/0115_450_115450695_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_450_115450695_qa_4/environment/bootstrap.sh b/tasks/0115_450_115450695_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_450_115450695_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_450_115450695_qa_4/environment/pull_bucket.py b/tasks/0115_450_115450695_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_450_115450695_qa_4/environment/pull_bucket.py +++ b/tasks/0115_450_115450695_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_450_115450695_qa_4/task.toml b/tasks/0115_450_115450695_qa_4/task.toml index 60e46152e4b84a5b81bf7f7d7cf16251243c46a0..3c6f08615e7b1dbe5b530e2fb8c17fe1f17a645c 100644 --- a/tasks/0115_450_115450695_qa_4/task.toml +++ b/tasks/0115_450_115450695_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_454_115454255_qa_3/environment/bootstrap.sh b/tasks/0115_454_115454255_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_454_115454255_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_454_115454255_qa_3/environment/pull_bucket.py b/tasks/0115_454_115454255_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_454_115454255_qa_3/environment/pull_bucket.py +++ b/tasks/0115_454_115454255_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_454_115454255_qa_3/task.toml b/tasks/0115_454_115454255_qa_3/task.toml index 309ffd4b1307791e1b61808257033713a619a1dc..a451421e43c48f0b7830b2dfaafd8be0f1946bd1 100644 --- a/tasks/0115_454_115454255_qa_3/task.toml +++ b/tasks/0115_454_115454255_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_504_115504947_qa_3/environment/bootstrap.sh b/tasks/0115_504_115504947_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_504_115504947_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_504_115504947_qa_3/environment/pull_bucket.py b/tasks/0115_504_115504947_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_504_115504947_qa_3/environment/pull_bucket.py +++ b/tasks/0115_504_115504947_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_504_115504947_qa_3/task.toml b/tasks/0115_504_115504947_qa_3/task.toml index 76f3f2dba73f774064cfa381ecd4fe3efdcf4b5b..11e2238637c2213f98d3b9b3b3ffcb094e185c75 100644 --- a/tasks/0115_504_115504947_qa_3/task.toml +++ b/tasks/0115_504_115504947_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_504_115504947_qa_4/environment/bootstrap.sh b/tasks/0115_504_115504947_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_504_115504947_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_504_115504947_qa_4/environment/pull_bucket.py b/tasks/0115_504_115504947_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_504_115504947_qa_4/environment/pull_bucket.py +++ b/tasks/0115_504_115504947_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_504_115504947_qa_4/task.toml b/tasks/0115_504_115504947_qa_4/task.toml index 58e74af50b4c5d195eda23d3a17f4f75a3570ab8..35ea8d8fa10557dc6509011c78db4a490f48e20e 100644 --- a/tasks/0115_504_115504947_qa_4/task.toml +++ b/tasks/0115_504_115504947_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_504_115504947_qa_5/environment/bootstrap.sh b/tasks/0115_504_115504947_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_504_115504947_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_504_115504947_qa_5/environment/pull_bucket.py b/tasks/0115_504_115504947_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_504_115504947_qa_5/environment/pull_bucket.py +++ b/tasks/0115_504_115504947_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_504_115504947_qa_5/task.toml b/tasks/0115_504_115504947_qa_5/task.toml index fda121dd8a9b5fdff027b20337da6d6e117eedfe..19e2f4b8b5c9cc1a8e6e14b551cc2bd64ab1f5bd 100644 --- a/tasks/0115_504_115504947_qa_5/task.toml +++ b/tasks/0115_504_115504947_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_514_115514429_qa_4/environment/bootstrap.sh b/tasks/0115_514_115514429_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_514_115514429_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_514_115514429_qa_4/environment/pull_bucket.py b/tasks/0115_514_115514429_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_514_115514429_qa_4/environment/pull_bucket.py +++ b/tasks/0115_514_115514429_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_514_115514429_qa_4/task.toml b/tasks/0115_514_115514429_qa_4/task.toml index f97c7ee0304cf5fde5cdca8afdc283c5a4e43d15..b923a2ef81e3ff793ce0d62f935ae2cf781b67c9 100644 --- a/tasks/0115_514_115514429_qa_4/task.toml +++ b/tasks/0115_514_115514429_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_532_115532151_qa_3/environment/bootstrap.sh b/tasks/0115_532_115532151_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_532_115532151_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_532_115532151_qa_3/environment/pull_bucket.py b/tasks/0115_532_115532151_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_532_115532151_qa_3/environment/pull_bucket.py +++ b/tasks/0115_532_115532151_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_532_115532151_qa_3/task.toml b/tasks/0115_532_115532151_qa_3/task.toml index b7e7026d0aea5192c7433ef15fb30e316de104ac..068b20ee6ff8577dc779bad52494619c21f0fe1d 100644 --- a/tasks/0115_532_115532151_qa_3/task.toml +++ b/tasks/0115_532_115532151_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_567_115567035_qa_5/environment/bootstrap.sh b/tasks/0115_567_115567035_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_567_115567035_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_567_115567035_qa_5/environment/pull_bucket.py b/tasks/0115_567_115567035_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_567_115567035_qa_5/environment/pull_bucket.py +++ b/tasks/0115_567_115567035_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_567_115567035_qa_5/task.toml b/tasks/0115_567_115567035_qa_5/task.toml index 83febe991de27a4538f0d4905bbd8f2a089f120c..d4553f82fb9dfcc6a4a2788d388cba925351974f 100644 --- a/tasks/0115_567_115567035_qa_5/task.toml +++ b/tasks/0115_567_115567035_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_609_115609623_qa_1/environment/bootstrap.sh b/tasks/0115_609_115609623_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_609_115609623_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_609_115609623_qa_1/environment/pull_bucket.py b/tasks/0115_609_115609623_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_609_115609623_qa_1/environment/pull_bucket.py +++ b/tasks/0115_609_115609623_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_609_115609623_qa_1/task.toml b/tasks/0115_609_115609623_qa_1/task.toml index bd6cf6c4302015973c5b168300c411d56a001571..09ea1ea7853e86bcd3fdf689fbea1ce1efb11c1a 100644 --- a/tasks/0115_609_115609623_qa_1/task.toml +++ b/tasks/0115_609_115609623_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_609_115609623_qa_2/environment/bootstrap.sh b/tasks/0115_609_115609623_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_609_115609623_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_609_115609623_qa_2/environment/pull_bucket.py b/tasks/0115_609_115609623_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_609_115609623_qa_2/environment/pull_bucket.py +++ b/tasks/0115_609_115609623_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_609_115609623_qa_2/task.toml b/tasks/0115_609_115609623_qa_2/task.toml index 36ecd19e255873d32eb69d8375710c188ea4dbb9..6a77369a707bf3f8e4dc8d2f3383ba7cf6f3d624 100644 --- a/tasks/0115_609_115609623_qa_2/task.toml +++ b/tasks/0115_609_115609623_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_609_115609623_qa_5/environment/bootstrap.sh b/tasks/0115_609_115609623_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_609_115609623_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_609_115609623_qa_5/environment/pull_bucket.py b/tasks/0115_609_115609623_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_609_115609623_qa_5/environment/pull_bucket.py +++ b/tasks/0115_609_115609623_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_609_115609623_qa_5/task.toml b/tasks/0115_609_115609623_qa_5/task.toml index 8e9f5caec0ee87c61a1b9992cb075d2aa697fee7..f8c260c577ee1c8a233d4a81320704384a9b95f4 100644 --- a/tasks/0115_609_115609623_qa_5/task.toml +++ b/tasks/0115_609_115609623_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_621_115621359_qa_4/environment/bootstrap.sh b/tasks/0115_621_115621359_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_621_115621359_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_621_115621359_qa_4/environment/pull_bucket.py b/tasks/0115_621_115621359_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_621_115621359_qa_4/environment/pull_bucket.py +++ b/tasks/0115_621_115621359_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_621_115621359_qa_4/task.toml b/tasks/0115_621_115621359_qa_4/task.toml index 8223a442a5d93868d6d2d53bc72ecdafaf7706fd..1932f5fdf4498ff039f8f30c5442fa90d5bc9a46 100644 --- a/tasks/0115_621_115621359_qa_4/task.toml +++ b/tasks/0115_621_115621359_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_634_115634779_qa_3/environment/bootstrap.sh b/tasks/0115_634_115634779_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_634_115634779_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_634_115634779_qa_3/environment/pull_bucket.py b/tasks/0115_634_115634779_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_634_115634779_qa_3/environment/pull_bucket.py +++ b/tasks/0115_634_115634779_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_634_115634779_qa_3/task.toml b/tasks/0115_634_115634779_qa_3/task.toml index f6f23a863f84c6dfe0ad51078f16eeca613a8985..6c872efd6a510822ae688a13c1a4f9532a032281 100644 --- a/tasks/0115_634_115634779_qa_3/task.toml +++ b/tasks/0115_634_115634779_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_634_115634779_qa_4/environment/bootstrap.sh b/tasks/0115_634_115634779_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_634_115634779_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_634_115634779_qa_4/environment/pull_bucket.py b/tasks/0115_634_115634779_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_634_115634779_qa_4/environment/pull_bucket.py +++ b/tasks/0115_634_115634779_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_634_115634779_qa_4/task.toml b/tasks/0115_634_115634779_qa_4/task.toml index 7bcf43d581d79e5602eb8faca6a8b91401118631..f007eb5b3a53cd5ef46861fa7d6c0880057f0d0f 100644 --- a/tasks/0115_634_115634779_qa_4/task.toml +++ b/tasks/0115_634_115634779_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_676_115676411_qa_2/environment/bootstrap.sh b/tasks/0115_676_115676411_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_676_115676411_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_676_115676411_qa_2/environment/pull_bucket.py b/tasks/0115_676_115676411_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_676_115676411_qa_2/environment/pull_bucket.py +++ b/tasks/0115_676_115676411_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_676_115676411_qa_2/task.toml b/tasks/0115_676_115676411_qa_2/task.toml index 47b91f109e390afbdbdb53b9e4f3873fa066601f..521b4b85893943b27d53845a7355ae17f2ff73e3 100644 --- a/tasks/0115_676_115676411_qa_2/task.toml +++ b/tasks/0115_676_115676411_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_676_115676411_qa_5/environment/bootstrap.sh b/tasks/0115_676_115676411_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_676_115676411_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_676_115676411_qa_5/environment/pull_bucket.py b/tasks/0115_676_115676411_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_676_115676411_qa_5/environment/pull_bucket.py +++ b/tasks/0115_676_115676411_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_676_115676411_qa_5/task.toml b/tasks/0115_676_115676411_qa_5/task.toml index c5a20d3cf75769af251d1780309d8e2615f39d3a..1e954eb6c841154ea9f8270411419cfa130f77af 100644 --- a/tasks/0115_676_115676411_qa_5/task.toml +++ b/tasks/0115_676_115676411_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_722_115722970_qa_3/environment/bootstrap.sh b/tasks/0115_722_115722970_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_722_115722970_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_722_115722970_qa_3/environment/pull_bucket.py b/tasks/0115_722_115722970_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_722_115722970_qa_3/environment/pull_bucket.py +++ b/tasks/0115_722_115722970_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_722_115722970_qa_3/task.toml b/tasks/0115_722_115722970_qa_3/task.toml index 80300fd2c7b7389eeb5326a0b50c95a97f1afd68..0081ae02267358bebe028dd3b3d8c5bab77c754b 100644 --- a/tasks/0115_722_115722970_qa_3/task.toml +++ b/tasks/0115_722_115722970_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_763_115763539_qa_2/environment/bootstrap.sh b/tasks/0115_763_115763539_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_763_115763539_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_763_115763539_qa_2/environment/pull_bucket.py b/tasks/0115_763_115763539_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_763_115763539_qa_2/environment/pull_bucket.py +++ b/tasks/0115_763_115763539_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_763_115763539_qa_2/task.toml b/tasks/0115_763_115763539_qa_2/task.toml index 1588915c59df43ab75ea94980e126779c8c8a7eb..5a0edec967566c5543653a2f256884859dc721cb 100644 --- a/tasks/0115_763_115763539_qa_2/task.toml +++ b/tasks/0115_763_115763539_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_767_115767675_qa_2/environment/bootstrap.sh b/tasks/0115_767_115767675_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_767_115767675_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_767_115767675_qa_2/environment/pull_bucket.py b/tasks/0115_767_115767675_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_767_115767675_qa_2/environment/pull_bucket.py +++ b/tasks/0115_767_115767675_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_767_115767675_qa_2/task.toml b/tasks/0115_767_115767675_qa_2/task.toml index e32d68585a4e692ecce7874851f69fb9824b7ca2..874c53ff72546d5284d4cb928e64fe87fa0a799d 100644 --- a/tasks/0115_767_115767675_qa_2/task.toml +++ b/tasks/0115_767_115767675_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_807_115807171_qa_2/environment/bootstrap.sh b/tasks/0115_807_115807171_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_807_115807171_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_807_115807171_qa_2/environment/pull_bucket.py b/tasks/0115_807_115807171_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_807_115807171_qa_2/environment/pull_bucket.py +++ b/tasks/0115_807_115807171_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_807_115807171_qa_2/task.toml b/tasks/0115_807_115807171_qa_2/task.toml index fc46aa613740d3d6e8f5fda551e42df840815cf7..61a8f6dac3bdca57e81ae9aa466e38abba1a74ac 100644 --- a/tasks/0115_807_115807171_qa_2/task.toml +++ b/tasks/0115_807_115807171_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_814_115814701_qa_4/environment/bootstrap.sh b/tasks/0115_814_115814701_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_814_115814701_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_814_115814701_qa_4/environment/pull_bucket.py b/tasks/0115_814_115814701_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_814_115814701_qa_4/environment/pull_bucket.py +++ b/tasks/0115_814_115814701_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_814_115814701_qa_4/task.toml b/tasks/0115_814_115814701_qa_4/task.toml index b3e02f75d2890734d2e54ac6e2a87379ca56ae83..a0c820d430f5f1cf79025c6f5fc9a257ebc343b7 100644 --- a/tasks/0115_814_115814701_qa_4/task.toml +++ b/tasks/0115_814_115814701_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_907_115907821_qa_2/environment/bootstrap.sh b/tasks/0115_907_115907821_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_907_115907821_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_907_115907821_qa_2/environment/pull_bucket.py b/tasks/0115_907_115907821_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_907_115907821_qa_2/environment/pull_bucket.py +++ b/tasks/0115_907_115907821_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_907_115907821_qa_2/task.toml b/tasks/0115_907_115907821_qa_2/task.toml index bffb1aade9e0868aba6000f916c458a7b8542514..08d24711767b2b97949fdd6da117f10c7c50974e 100644 --- a/tasks/0115_907_115907821_qa_2/task.toml +++ b/tasks/0115_907_115907821_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_907_115907821_qa_5/environment/bootstrap.sh b/tasks/0115_907_115907821_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_907_115907821_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_907_115907821_qa_5/environment/pull_bucket.py b/tasks/0115_907_115907821_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_907_115907821_qa_5/environment/pull_bucket.py +++ b/tasks/0115_907_115907821_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_907_115907821_qa_5/task.toml b/tasks/0115_907_115907821_qa_5/task.toml index 56253a3ed2a3f76ab968f06f96d3af34362c1cef..3052323f8e308fe90cf0f587e197d98ec969a12a 100644 --- a/tasks/0115_907_115907821_qa_5/task.toml +++ b/tasks/0115_907_115907821_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_943_115943948_qa_3/environment/bootstrap.sh b/tasks/0115_943_115943948_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_943_115943948_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_943_115943948_qa_3/environment/pull_bucket.py b/tasks/0115_943_115943948_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_943_115943948_qa_3/environment/pull_bucket.py +++ b/tasks/0115_943_115943948_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_943_115943948_qa_3/task.toml b/tasks/0115_943_115943948_qa_3/task.toml index 4440e664ec678b16215aeae1f660c455809c02b4..45b6be7f9ce0fd25e703d7c0621a9fb412efeff8 100644 --- a/tasks/0115_943_115943948_qa_3/task.toml +++ b/tasks/0115_943_115943948_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_972_115972863_qa_1/environment/bootstrap.sh b/tasks/0115_972_115972863_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_972_115972863_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_972_115972863_qa_1/environment/pull_bucket.py b/tasks/0115_972_115972863_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_972_115972863_qa_1/environment/pull_bucket.py +++ b/tasks/0115_972_115972863_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_972_115972863_qa_1/task.toml b/tasks/0115_972_115972863_qa_1/task.toml index 4211b977e5b8cdd40234f326876e7e6ec1840051..3e0c0805eda7a6fa499004d870cb797c53d94856 100644 --- a/tasks/0115_972_115972863_qa_1/task.toml +++ b/tasks/0115_972_115972863_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0115_972_115972863_qa_3/environment/bootstrap.sh b/tasks/0115_972_115972863_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0115_972_115972863_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0115_972_115972863_qa_3/environment/pull_bucket.py b/tasks/0115_972_115972863_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0115_972_115972863_qa_3/environment/pull_bucket.py +++ b/tasks/0115_972_115972863_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0115_972_115972863_qa_3/task.toml b/tasks/0115_972_115972863_qa_3/task.toml index 97bb8d9427799e6bd0a7e0ce15386fddd49b5c6c..ab5ad7e34377c4113286e16cc90f0403abb5953f 100644 --- a/tasks/0115_972_115972863_qa_3/task.toml +++ b/tasks/0115_972_115972863_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_015_116015692_qa_3/environment/bootstrap.sh b/tasks/0116_015_116015692_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_015_116015692_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_015_116015692_qa_3/environment/pull_bucket.py b/tasks/0116_015_116015692_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_015_116015692_qa_3/environment/pull_bucket.py +++ b/tasks/0116_015_116015692_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_015_116015692_qa_3/task.toml b/tasks/0116_015_116015692_qa_3/task.toml index 87249c0436dcde3e4f62f680b5822ff87dde1768..b7ebcf8f98f4fee7cc47f88baa64cc3ec70a6d2b 100644 --- a/tasks/0116_015_116015692_qa_3/task.toml +++ b/tasks/0116_015_116015692_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_015_116015692_qa_5/environment/bootstrap.sh b/tasks/0116_015_116015692_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_015_116015692_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_015_116015692_qa_5/environment/pull_bucket.py b/tasks/0116_015_116015692_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_015_116015692_qa_5/environment/pull_bucket.py +++ b/tasks/0116_015_116015692_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_015_116015692_qa_5/task.toml b/tasks/0116_015_116015692_qa_5/task.toml index 60d095f6b74c23dce2a59eb1087b27b150e22ff4..c5ce9cc9238bfa0e63557e2f70bf5896a8bb5127 100644 --- a/tasks/0116_015_116015692_qa_5/task.toml +++ b/tasks/0116_015_116015692_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_025_116025601_qa_5/environment/bootstrap.sh b/tasks/0116_025_116025601_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_025_116025601_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_025_116025601_qa_5/environment/pull_bucket.py b/tasks/0116_025_116025601_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_025_116025601_qa_5/environment/pull_bucket.py +++ b/tasks/0116_025_116025601_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_025_116025601_qa_5/task.toml b/tasks/0116_025_116025601_qa_5/task.toml index 092188befe29b9320d7265b761b91b5dfc032a58..69cec976f9563e9e3213d76491b25141294defde 100644 --- a/tasks/0116_025_116025601_qa_5/task.toml +++ b/tasks/0116_025_116025601_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_026_116026387_qa_3/environment/bootstrap.sh b/tasks/0116_026_116026387_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_026_116026387_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_026_116026387_qa_3/environment/pull_bucket.py b/tasks/0116_026_116026387_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_026_116026387_qa_3/environment/pull_bucket.py +++ b/tasks/0116_026_116026387_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_026_116026387_qa_3/task.toml b/tasks/0116_026_116026387_qa_3/task.toml index 6aef905e07b37b8a7f533f0b95a6160508e14818..e2ed60dfaa032a5438b7aa6cf3303403e8024236 100644 --- a/tasks/0116_026_116026387_qa_3/task.toml +++ b/tasks/0116_026_116026387_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_026_116026387_qa_5/environment/bootstrap.sh b/tasks/0116_026_116026387_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_026_116026387_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_026_116026387_qa_5/environment/pull_bucket.py b/tasks/0116_026_116026387_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_026_116026387_qa_5/environment/pull_bucket.py +++ b/tasks/0116_026_116026387_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_026_116026387_qa_5/task.toml b/tasks/0116_026_116026387_qa_5/task.toml index 5683d96a68f7e313e99541766cc3413141179c6e..7e2693543a367398775c16f1671bc413c03f5e2a 100644 --- a/tasks/0116_026_116026387_qa_5/task.toml +++ b/tasks/0116_026_116026387_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_131_116131227_qa_5/environment/bootstrap.sh b/tasks/0116_131_116131227_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_131_116131227_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_131_116131227_qa_5/environment/pull_bucket.py b/tasks/0116_131_116131227_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_131_116131227_qa_5/environment/pull_bucket.py +++ b/tasks/0116_131_116131227_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_131_116131227_qa_5/task.toml b/tasks/0116_131_116131227_qa_5/task.toml index 94ee1433fbea00ff8d99b710fea82d97d66cc042..a6a0e2367fa11a5df7a2b12ab0f5f425f47cff01 100644 --- a/tasks/0116_131_116131227_qa_5/task.toml +++ b/tasks/0116_131_116131227_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_140_116140223_qa_3/environment/bootstrap.sh b/tasks/0116_140_116140223_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_140_116140223_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_140_116140223_qa_3/environment/pull_bucket.py b/tasks/0116_140_116140223_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_140_116140223_qa_3/environment/pull_bucket.py +++ b/tasks/0116_140_116140223_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_140_116140223_qa_3/task.toml b/tasks/0116_140_116140223_qa_3/task.toml index a120f72b044d4a833e336390d0fbd00423fe726d..db38521be3ffe04663d4f722d3a90133f043373c 100644 --- a/tasks/0116_140_116140223_qa_3/task.toml +++ b/tasks/0116_140_116140223_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_195_116195791_qa_2/environment/bootstrap.sh b/tasks/0116_195_116195791_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_195_116195791_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_195_116195791_qa_2/environment/pull_bucket.py b/tasks/0116_195_116195791_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_195_116195791_qa_2/environment/pull_bucket.py +++ b/tasks/0116_195_116195791_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_195_116195791_qa_2/task.toml b/tasks/0116_195_116195791_qa_2/task.toml index 64b9b30e81f4839f9054099841dd6f1ee5a8c3f3..557f868f923fe26438aa14ad414ed10f696c4e76 100644 --- a/tasks/0116_195_116195791_qa_2/task.toml +++ b/tasks/0116_195_116195791_qa_2/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_195_116195791_qa_4/environment/bootstrap.sh b/tasks/0116_195_116195791_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_195_116195791_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_195_116195791_qa_4/environment/pull_bucket.py b/tasks/0116_195_116195791_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_195_116195791_qa_4/environment/pull_bucket.py +++ b/tasks/0116_195_116195791_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_195_116195791_qa_4/task.toml b/tasks/0116_195_116195791_qa_4/task.toml index 4741f34ef5f64f0a7ed10b9dce9e0b3098a666a9..6d78149d6917d68b0b6ecb23395ccd2c35ec5f2b 100644 --- a/tasks/0116_195_116195791_qa_4/task.toml +++ b/tasks/0116_195_116195791_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_220_116220361_qa_4/environment/bootstrap.sh b/tasks/0116_220_116220361_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_220_116220361_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_220_116220361_qa_4/environment/pull_bucket.py b/tasks/0116_220_116220361_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_220_116220361_qa_4/environment/pull_bucket.py +++ b/tasks/0116_220_116220361_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_220_116220361_qa_4/task.toml b/tasks/0116_220_116220361_qa_4/task.toml index a1c95719c3426f31c42adcad89d4c3a370e2d60a..bd0790058179042057854ae6fecde34df5a05908 100644 --- a/tasks/0116_220_116220361_qa_4/task.toml +++ b/tasks/0116_220_116220361_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_278_116278227_qa_3/environment/bootstrap.sh b/tasks/0116_278_116278227_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_278_116278227_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_278_116278227_qa_3/environment/pull_bucket.py b/tasks/0116_278_116278227_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_278_116278227_qa_3/environment/pull_bucket.py +++ b/tasks/0116_278_116278227_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_278_116278227_qa_3/task.toml b/tasks/0116_278_116278227_qa_3/task.toml index 7d55d052a60bc28e074e680b653859c78d898952..4fe34ed6457b5a3c7dbac5cb4914f5334d34f62f 100644 --- a/tasks/0116_278_116278227_qa_3/task.toml +++ b/tasks/0116_278_116278227_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_278_116278227_qa_4/environment/bootstrap.sh b/tasks/0116_278_116278227_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_278_116278227_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_278_116278227_qa_4/environment/pull_bucket.py b/tasks/0116_278_116278227_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_278_116278227_qa_4/environment/pull_bucket.py +++ b/tasks/0116_278_116278227_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_278_116278227_qa_4/task.toml b/tasks/0116_278_116278227_qa_4/task.toml index 593d76e454740dcffe254660c45a7f5e4ac0f140..a7a239a0c0bc39ce82bd7e049d9eb34c5c9641c3 100644 --- a/tasks/0116_278_116278227_qa_4/task.toml +++ b/tasks/0116_278_116278227_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_418_116418769_qa_3/environment/bootstrap.sh b/tasks/0116_418_116418769_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_418_116418769_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_418_116418769_qa_3/environment/pull_bucket.py b/tasks/0116_418_116418769_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_418_116418769_qa_3/environment/pull_bucket.py +++ b/tasks/0116_418_116418769_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_418_116418769_qa_3/task.toml b/tasks/0116_418_116418769_qa_3/task.toml index 85946e9efec1df1962122ecbdb4c83c9872f4fab..6b6b0f0a92d974779bf3b88fa5a311ffd2d0005d 100644 --- a/tasks/0116_418_116418769_qa_3/task.toml +++ b/tasks/0116_418_116418769_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_418_116418769_qa_4/environment/bootstrap.sh b/tasks/0116_418_116418769_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_418_116418769_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_418_116418769_qa_4/environment/pull_bucket.py b/tasks/0116_418_116418769_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_418_116418769_qa_4/environment/pull_bucket.py +++ b/tasks/0116_418_116418769_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_418_116418769_qa_4/task.toml b/tasks/0116_418_116418769_qa_4/task.toml index 3648fea75e6d6dfb2b1f8bcc2c44b6de8bdf5c4a..00c6d8ce9b07819d96a8dee8c91817439edebdb3 100644 --- a/tasks/0116_418_116418769_qa_4/task.toml +++ b/tasks/0116_418_116418769_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_436_116436448_qa_1/environment/bootstrap.sh b/tasks/0116_436_116436448_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_436_116436448_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_436_116436448_qa_1/environment/pull_bucket.py b/tasks/0116_436_116436448_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_436_116436448_qa_1/environment/pull_bucket.py +++ b/tasks/0116_436_116436448_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_436_116436448_qa_1/task.toml b/tasks/0116_436_116436448_qa_1/task.toml index 5c0cb6dae0304f9f159adb52a77ad872646bbf72..44823ea3f9d6b8c38e86c94d489828cdc79fcc9e 100644 --- a/tasks/0116_436_116436448_qa_1/task.toml +++ b/tasks/0116_436_116436448_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_436_116436448_qa_2/environment/bootstrap.sh b/tasks/0116_436_116436448_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_436_116436448_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_436_116436448_qa_2/environment/pull_bucket.py b/tasks/0116_436_116436448_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_436_116436448_qa_2/environment/pull_bucket.py +++ b/tasks/0116_436_116436448_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_436_116436448_qa_2/task.toml b/tasks/0116_436_116436448_qa_2/task.toml index 9c5c4a1a300c347a478ca416c521995307c1a11b..e1a31ab6adafaa48f5ccbafffb7c7f88d84c2fba 100644 --- a/tasks/0116_436_116436448_qa_2/task.toml +++ b/tasks/0116_436_116436448_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_436_116436448_qa_5/environment/bootstrap.sh b/tasks/0116_436_116436448_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_436_116436448_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_436_116436448_qa_5/environment/pull_bucket.py b/tasks/0116_436_116436448_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_436_116436448_qa_5/environment/pull_bucket.py +++ b/tasks/0116_436_116436448_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_436_116436448_qa_5/task.toml b/tasks/0116_436_116436448_qa_5/task.toml index 640b6b629074da92414d3a087cf9aa260873d16b..dc500e9ed769c3f5d6ba165ebd4229de34621457 100644 --- a/tasks/0116_436_116436448_qa_5/task.toml +++ b/tasks/0116_436_116436448_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_489_116489046_qa_5/environment/bootstrap.sh b/tasks/0116_489_116489046_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_489_116489046_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_489_116489046_qa_5/environment/pull_bucket.py b/tasks/0116_489_116489046_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_489_116489046_qa_5/environment/pull_bucket.py +++ b/tasks/0116_489_116489046_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_489_116489046_qa_5/task.toml b/tasks/0116_489_116489046_qa_5/task.toml index 01401430d2d7329a1e1eb5dc8c39bf36a5bd288b..27bdcce6d4fe52d379d58e59b0eccff045e4d4ba 100644 --- a/tasks/0116_489_116489046_qa_5/task.toml +++ b/tasks/0116_489_116489046_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_553_116553968_qa_1/environment/bootstrap.sh b/tasks/0116_553_116553968_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_553_116553968_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_553_116553968_qa_1/environment/pull_bucket.py b/tasks/0116_553_116553968_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_553_116553968_qa_1/environment/pull_bucket.py +++ b/tasks/0116_553_116553968_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_553_116553968_qa_1/task.toml b/tasks/0116_553_116553968_qa_1/task.toml index 410b4042ae72d5692bdb34bf3ed39d8a8642087d..212632bdbe35acc75397900a94be5424c874f47e 100644 --- a/tasks/0116_553_116553968_qa_1/task.toml +++ b/tasks/0116_553_116553968_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_553_116553968_qa_5/environment/bootstrap.sh b/tasks/0116_553_116553968_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_553_116553968_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_553_116553968_qa_5/environment/pull_bucket.py b/tasks/0116_553_116553968_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_553_116553968_qa_5/environment/pull_bucket.py +++ b/tasks/0116_553_116553968_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_553_116553968_qa_5/task.toml b/tasks/0116_553_116553968_qa_5/task.toml index cdb7b16db935808c4c17e7861ddad36903552d35..004e98fbf786d3436959c697ae66d4446b2791bc 100644 --- a/tasks/0116_553_116553968_qa_5/task.toml +++ b/tasks/0116_553_116553968_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_564_116564780_qa_4/environment/bootstrap.sh b/tasks/0116_564_116564780_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_564_116564780_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_564_116564780_qa_4/environment/pull_bucket.py b/tasks/0116_564_116564780_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_564_116564780_qa_4/environment/pull_bucket.py +++ b/tasks/0116_564_116564780_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_564_116564780_qa_4/task.toml b/tasks/0116_564_116564780_qa_4/task.toml index 577672faa758e4540239eebc3d529741f748628c..b29d239dc1ef4923618353dd3fd12472d71b8f98 100644 --- a/tasks/0116_564_116564780_qa_4/task.toml +++ b/tasks/0116_564_116564780_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_621_116621192_qa_3/environment/bootstrap.sh b/tasks/0116_621_116621192_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_621_116621192_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_621_116621192_qa_3/environment/pull_bucket.py b/tasks/0116_621_116621192_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_621_116621192_qa_3/environment/pull_bucket.py +++ b/tasks/0116_621_116621192_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_621_116621192_qa_3/task.toml b/tasks/0116_621_116621192_qa_3/task.toml index 31a85bd717ff54434995f2a9b8e785899111739f..ba5c0a8651fa2d29bfb66c8297d0bdfa14036cc4 100644 --- a/tasks/0116_621_116621192_qa_3/task.toml +++ b/tasks/0116_621_116621192_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_621_116621192_qa_4/environment/bootstrap.sh b/tasks/0116_621_116621192_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_621_116621192_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_621_116621192_qa_4/environment/pull_bucket.py b/tasks/0116_621_116621192_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_621_116621192_qa_4/environment/pull_bucket.py +++ b/tasks/0116_621_116621192_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_621_116621192_qa_4/task.toml b/tasks/0116_621_116621192_qa_4/task.toml index 866cbc37efefcfce1e4de47848be0a7c59228c16..18da365ad81b264146ad9a003e93ef6afaf14393 100644 --- a/tasks/0116_621_116621192_qa_4/task.toml +++ b/tasks/0116_621_116621192_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_621_116621192_qa_5/environment/bootstrap.sh b/tasks/0116_621_116621192_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_621_116621192_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_621_116621192_qa_5/environment/pull_bucket.py b/tasks/0116_621_116621192_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_621_116621192_qa_5/environment/pull_bucket.py +++ b/tasks/0116_621_116621192_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_621_116621192_qa_5/task.toml b/tasks/0116_621_116621192_qa_5/task.toml index 21e172f0b2e0c6836951bd436437de30a611ff5c..18799290ede1716180ad08de6b30a93a5ee0a435 100644 --- a/tasks/0116_621_116621192_qa_5/task.toml +++ b/tasks/0116_621_116621192_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_643_116643019_qa_4/environment/bootstrap.sh b/tasks/0116_643_116643019_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_643_116643019_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_643_116643019_qa_4/environment/pull_bucket.py b/tasks/0116_643_116643019_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_643_116643019_qa_4/environment/pull_bucket.py +++ b/tasks/0116_643_116643019_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_643_116643019_qa_4/task.toml b/tasks/0116_643_116643019_qa_4/task.toml index 992c5109db66547067fa2bf53af690ee124418c7..3f781004aa7c56f8e9cbd7b1f171f56241e231b0 100644 --- a/tasks/0116_643_116643019_qa_4/task.toml +++ b/tasks/0116_643_116643019_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_897_116897141_qa_3/environment/bootstrap.sh b/tasks/0116_897_116897141_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_897_116897141_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_897_116897141_qa_3/environment/pull_bucket.py b/tasks/0116_897_116897141_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_897_116897141_qa_3/environment/pull_bucket.py +++ b/tasks/0116_897_116897141_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_897_116897141_qa_3/task.toml b/tasks/0116_897_116897141_qa_3/task.toml index 2dc50985a7da3ccc45e79b003aafca3a40848ce3..205778b80f403875cac85b430d84362db92e0956 100644 --- a/tasks/0116_897_116897141_qa_3/task.toml +++ b/tasks/0116_897_116897141_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_898_116898391_qa_3/environment/bootstrap.sh b/tasks/0116_898_116898391_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_898_116898391_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_898_116898391_qa_3/environment/pull_bucket.py b/tasks/0116_898_116898391_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_898_116898391_qa_3/environment/pull_bucket.py +++ b/tasks/0116_898_116898391_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_898_116898391_qa_3/task.toml b/tasks/0116_898_116898391_qa_3/task.toml index 744755514a25be107a3e759ecd3de0e269c4b241..bc6a98137db8b9dcc79abdc71bc101f9ef6e28f1 100644 --- a/tasks/0116_898_116898391_qa_3/task.toml +++ b/tasks/0116_898_116898391_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_967_116967370_qa_4/environment/bootstrap.sh b/tasks/0116_967_116967370_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_967_116967370_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_967_116967370_qa_4/environment/pull_bucket.py b/tasks/0116_967_116967370_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_967_116967370_qa_4/environment/pull_bucket.py +++ b/tasks/0116_967_116967370_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_967_116967370_qa_4/task.toml b/tasks/0116_967_116967370_qa_4/task.toml index 04ed5b41722327d318970fae768aa8021cecb07f..e3ebedb9f4455b99d01cc5826c065b42a418ae5d 100644 --- a/tasks/0116_967_116967370_qa_4/task.toml +++ b/tasks/0116_967_116967370_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_967_116967370_qa_5/environment/bootstrap.sh b/tasks/0116_967_116967370_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_967_116967370_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_967_116967370_qa_5/environment/pull_bucket.py b/tasks/0116_967_116967370_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_967_116967370_qa_5/environment/pull_bucket.py +++ b/tasks/0116_967_116967370_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_967_116967370_qa_5/task.toml b/tasks/0116_967_116967370_qa_5/task.toml index 397d55712186acbc38a459c8b2b14e0b7cdf10df..d45c0601bc39ca3912149fb7f4e9d998762e31d6 100644 --- a/tasks/0116_967_116967370_qa_5/task.toml +++ b/tasks/0116_967_116967370_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0116_992_116992800_qa_2/environment/bootstrap.sh b/tasks/0116_992_116992800_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0116_992_116992800_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0116_992_116992800_qa_2/environment/pull_bucket.py b/tasks/0116_992_116992800_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0116_992_116992800_qa_2/environment/pull_bucket.py +++ b/tasks/0116_992_116992800_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0116_992_116992800_qa_2/task.toml b/tasks/0116_992_116992800_qa_2/task.toml index cc0ab32b8f2edacb791bbef30abe89d1e1f5b737..e0d1587fc9763ec6f4206c2600cd7d448757f93f 100644 --- a/tasks/0116_992_116992800_qa_2/task.toml +++ b/tasks/0116_992_116992800_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_122_117122383_qa_2/environment/bootstrap.sh b/tasks/0117_122_117122383_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_122_117122383_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_122_117122383_qa_2/environment/pull_bucket.py b/tasks/0117_122_117122383_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_122_117122383_qa_2/environment/pull_bucket.py +++ b/tasks/0117_122_117122383_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_122_117122383_qa_2/task.toml b/tasks/0117_122_117122383_qa_2/task.toml index 6d172a50e0c2f4cbab802ed1315dcd2ad66d3037..e6bc6baed9c05e4b1a5314608e5de52466656e75 100644 --- a/tasks/0117_122_117122383_qa_2/task.toml +++ b/tasks/0117_122_117122383_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_137_117137785_qa_2/environment/bootstrap.sh b/tasks/0117_137_117137785_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_137_117137785_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_137_117137785_qa_2/environment/pull_bucket.py b/tasks/0117_137_117137785_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_137_117137785_qa_2/environment/pull_bucket.py +++ b/tasks/0117_137_117137785_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_137_117137785_qa_2/task.toml b/tasks/0117_137_117137785_qa_2/task.toml index 4453930740aa54f77072e6b84c28f4f7a5589eae..bfb95f367881eb6e1fae632ff154e97890a4d602 100644 --- a/tasks/0117_137_117137785_qa_2/task.toml +++ b/tasks/0117_137_117137785_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_137_117137785_qa_5/environment/bootstrap.sh b/tasks/0117_137_117137785_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_137_117137785_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_137_117137785_qa_5/environment/pull_bucket.py b/tasks/0117_137_117137785_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_137_117137785_qa_5/environment/pull_bucket.py +++ b/tasks/0117_137_117137785_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_137_117137785_qa_5/task.toml b/tasks/0117_137_117137785_qa_5/task.toml index 97bb4c9004b66f19b7f5b136d714502632c6aeea..8c3eb3d2d154b51a5ac47ea6f32ae48d7e5d316f 100644 --- a/tasks/0117_137_117137785_qa_5/task.toml +++ b/tasks/0117_137_117137785_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_445_117445192_qa_4/environment/bootstrap.sh b/tasks/0117_445_117445192_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_445_117445192_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_445_117445192_qa_4/environment/pull_bucket.py b/tasks/0117_445_117445192_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_445_117445192_qa_4/environment/pull_bucket.py +++ b/tasks/0117_445_117445192_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_445_117445192_qa_4/task.toml b/tasks/0117_445_117445192_qa_4/task.toml index 0961f19a1eeada6f4ca6cf468a5bd15274808353..8f9e282df3d4b34a8ca1baa735bde3dc8808c4c7 100644 --- a/tasks/0117_445_117445192_qa_4/task.toml +++ b/tasks/0117_445_117445192_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_445_117445192_qa_5/environment/bootstrap.sh b/tasks/0117_445_117445192_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_445_117445192_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_445_117445192_qa_5/environment/pull_bucket.py b/tasks/0117_445_117445192_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_445_117445192_qa_5/environment/pull_bucket.py +++ b/tasks/0117_445_117445192_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_445_117445192_qa_5/task.toml b/tasks/0117_445_117445192_qa_5/task.toml index d610b498ef230bd5f12b72ddd277ea4446118ff3..854831d4dbcd5065edb544bb980f9f3a431a8bc4 100644 --- a/tasks/0117_445_117445192_qa_5/task.toml +++ b/tasks/0117_445_117445192_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_519_117519892_qa_1/environment/bootstrap.sh b/tasks/0117_519_117519892_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_519_117519892_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_519_117519892_qa_1/environment/pull_bucket.py b/tasks/0117_519_117519892_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_519_117519892_qa_1/environment/pull_bucket.py +++ b/tasks/0117_519_117519892_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_519_117519892_qa_1/task.toml b/tasks/0117_519_117519892_qa_1/task.toml index 9cdc7b2175d8822e48a0e924eb43a156fb420e0f..b2cc36b08d231d2348d6e95fe698b4b853a30207 100644 --- a/tasks/0117_519_117519892_qa_1/task.toml +++ b/tasks/0117_519_117519892_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_519_117519892_qa_4/environment/bootstrap.sh b/tasks/0117_519_117519892_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_519_117519892_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_519_117519892_qa_4/environment/pull_bucket.py b/tasks/0117_519_117519892_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_519_117519892_qa_4/environment/pull_bucket.py +++ b/tasks/0117_519_117519892_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_519_117519892_qa_4/task.toml b/tasks/0117_519_117519892_qa_4/task.toml index da5e67dcf16aa4ea3b9f2a556d0900de56b17950..408e2c24f5bcf714b484a1654642d02d987dd89e 100644 --- a/tasks/0117_519_117519892_qa_4/task.toml +++ b/tasks/0117_519_117519892_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_571_117571850_qa_1/environment/bootstrap.sh b/tasks/0117_571_117571850_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_571_117571850_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_571_117571850_qa_1/environment/pull_bucket.py b/tasks/0117_571_117571850_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_571_117571850_qa_1/environment/pull_bucket.py +++ b/tasks/0117_571_117571850_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_571_117571850_qa_1/task.toml b/tasks/0117_571_117571850_qa_1/task.toml index 3d542e9cc3583340c22b6845f9f78266784eb444..4b38f1230837a5239020134912a2de3c7645a2c4 100644 --- a/tasks/0117_571_117571850_qa_1/task.toml +++ b/tasks/0117_571_117571850_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_594_117594280_qa_2/environment/bootstrap.sh b/tasks/0117_594_117594280_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_594_117594280_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_594_117594280_qa_2/environment/pull_bucket.py b/tasks/0117_594_117594280_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_594_117594280_qa_2/environment/pull_bucket.py +++ b/tasks/0117_594_117594280_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_594_117594280_qa_2/task.toml b/tasks/0117_594_117594280_qa_2/task.toml index d18b1b4625c85c310ce3aef1db3f7d05e42ef05b..d958a87e52bbc2082be0f71112144c4dee554f18 100644 --- a/tasks/0117_594_117594280_qa_2/task.toml +++ b/tasks/0117_594_117594280_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_608_117608671_qa_4/environment/bootstrap.sh b/tasks/0117_608_117608671_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_608_117608671_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_608_117608671_qa_4/environment/pull_bucket.py b/tasks/0117_608_117608671_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_608_117608671_qa_4/environment/pull_bucket.py +++ b/tasks/0117_608_117608671_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_608_117608671_qa_4/task.toml b/tasks/0117_608_117608671_qa_4/task.toml index d16224da31e4fe6fe4e79d8afe153840a5247516..b4ea5c0752e15fc7c950da07403682e9c7796c74 100644 --- a/tasks/0117_608_117608671_qa_4/task.toml +++ b/tasks/0117_608_117608671_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_612_117612368_qa_1/environment/bootstrap.sh b/tasks/0117_612_117612368_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_612_117612368_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_612_117612368_qa_1/environment/pull_bucket.py b/tasks/0117_612_117612368_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_612_117612368_qa_1/environment/pull_bucket.py +++ b/tasks/0117_612_117612368_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_612_117612368_qa_1/task.toml b/tasks/0117_612_117612368_qa_1/task.toml index dfb0396f8cc8ee338fa2d932543ae0cb044755c4..8c51ae3200103bb3494f3ded4dde84c19cbbbc0c 100644 --- a/tasks/0117_612_117612368_qa_1/task.toml +++ b/tasks/0117_612_117612368_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_621_117621488_qa_2/environment/bootstrap.sh b/tasks/0117_621_117621488_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_621_117621488_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_621_117621488_qa_2/environment/pull_bucket.py b/tasks/0117_621_117621488_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_621_117621488_qa_2/environment/pull_bucket.py +++ b/tasks/0117_621_117621488_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_621_117621488_qa_2/task.toml b/tasks/0117_621_117621488_qa_2/task.toml index 27affde332f8c977185416c89ecc1fb3f167a76e..aba9008c6e4bae172d4aa5f34f0fd05adadeae14 100644 --- a/tasks/0117_621_117621488_qa_2/task.toml +++ b/tasks/0117_621_117621488_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_642_117642587_qa_1/environment/bootstrap.sh b/tasks/0117_642_117642587_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_642_117642587_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_642_117642587_qa_1/environment/pull_bucket.py b/tasks/0117_642_117642587_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_642_117642587_qa_1/environment/pull_bucket.py +++ b/tasks/0117_642_117642587_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_642_117642587_qa_1/task.toml b/tasks/0117_642_117642587_qa_1/task.toml index 0ad492f198c1336a77fdae849d585f079c0d3355..074d9d6e57ca34d53a20bbc0052efb3b22b7e611 100644 --- a/tasks/0117_642_117642587_qa_1/task.toml +++ b/tasks/0117_642_117642587_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_642_117642587_qa_4/environment/bootstrap.sh b/tasks/0117_642_117642587_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_642_117642587_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_642_117642587_qa_4/environment/pull_bucket.py b/tasks/0117_642_117642587_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_642_117642587_qa_4/environment/pull_bucket.py +++ b/tasks/0117_642_117642587_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_642_117642587_qa_4/task.toml b/tasks/0117_642_117642587_qa_4/task.toml index 489b4f6a43ba7a1b6ce8b1c213972dae558bd112..26170bf1d45e1a3603ca506315e19cc0230c49ef 100644 --- a/tasks/0117_642_117642587_qa_4/task.toml +++ b/tasks/0117_642_117642587_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_642_117642587_qa_5/environment/bootstrap.sh b/tasks/0117_642_117642587_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_642_117642587_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_642_117642587_qa_5/environment/pull_bucket.py b/tasks/0117_642_117642587_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_642_117642587_qa_5/environment/pull_bucket.py +++ b/tasks/0117_642_117642587_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_642_117642587_qa_5/task.toml b/tasks/0117_642_117642587_qa_5/task.toml index dee3a84e6053135e14a8317f8c6c57b11242df4d..1ca419d16c8117a928851997b721fd4f0d71542f 100644 --- a/tasks/0117_642_117642587_qa_5/task.toml +++ b/tasks/0117_642_117642587_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_685_117685347_qa_2/environment/bootstrap.sh b/tasks/0117_685_117685347_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_685_117685347_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_685_117685347_qa_2/environment/pull_bucket.py b/tasks/0117_685_117685347_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_685_117685347_qa_2/environment/pull_bucket.py +++ b/tasks/0117_685_117685347_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_685_117685347_qa_2/task.toml b/tasks/0117_685_117685347_qa_2/task.toml index 9515b2bc25e205f168a90ffe2d18a0e5c4f4ba67..be7ddd7d22edc6ae875bef5ec714d345fc7e2c8e 100644 --- a/tasks/0117_685_117685347_qa_2/task.toml +++ b/tasks/0117_685_117685347_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_685_117685347_qa_4/environment/bootstrap.sh b/tasks/0117_685_117685347_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_685_117685347_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_685_117685347_qa_4/environment/pull_bucket.py b/tasks/0117_685_117685347_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_685_117685347_qa_4/environment/pull_bucket.py +++ b/tasks/0117_685_117685347_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_685_117685347_qa_4/task.toml b/tasks/0117_685_117685347_qa_4/task.toml index 2c4633f36880f5aa955469bf99901be79bc84dda..d9738fa7b9f9548d0a894edb750c4daa29932457 100644 --- a/tasks/0117_685_117685347_qa_4/task.toml +++ b/tasks/0117_685_117685347_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_815_117815262_qa_1/environment/bootstrap.sh b/tasks/0117_815_117815262_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_815_117815262_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_815_117815262_qa_1/environment/pull_bucket.py b/tasks/0117_815_117815262_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_815_117815262_qa_1/environment/pull_bucket.py +++ b/tasks/0117_815_117815262_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_815_117815262_qa_1/task.toml b/tasks/0117_815_117815262_qa_1/task.toml index 509b36e84ce91fc618fbcda6454751171884b686..6005e350f79213a33f96ea6671f13addd1df55f7 100644 --- a/tasks/0117_815_117815262_qa_1/task.toml +++ b/tasks/0117_815_117815262_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_905_117905284_qa_1/environment/bootstrap.sh b/tasks/0117_905_117905284_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_905_117905284_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_905_117905284_qa_1/environment/pull_bucket.py b/tasks/0117_905_117905284_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_905_117905284_qa_1/environment/pull_bucket.py +++ b/tasks/0117_905_117905284_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_905_117905284_qa_1/task.toml b/tasks/0117_905_117905284_qa_1/task.toml index 45f3ea4a2eb304ecade5510304672145030543a4..84fcdd6504982229a857ff63ac251aa9dae8edb6 100644 --- a/tasks/0117_905_117905284_qa_1/task.toml +++ b/tasks/0117_905_117905284_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_907_117907208_qa_2/environment/bootstrap.sh b/tasks/0117_907_117907208_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_907_117907208_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_907_117907208_qa_2/environment/pull_bucket.py b/tasks/0117_907_117907208_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_907_117907208_qa_2/environment/pull_bucket.py +++ b/tasks/0117_907_117907208_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_907_117907208_qa_2/task.toml b/tasks/0117_907_117907208_qa_2/task.toml index e9fb5e2e1a22aaca542b76baa74b027f38c6b33c..d8c48f3d2f9db7eca567c1a0490eb48977a2cee0 100644 --- a/tasks/0117_907_117907208_qa_2/task.toml +++ b/tasks/0117_907_117907208_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0117_949_117949173_qa_2/environment/bootstrap.sh b/tasks/0117_949_117949173_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0117_949_117949173_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0117_949_117949173_qa_2/environment/pull_bucket.py b/tasks/0117_949_117949173_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0117_949_117949173_qa_2/environment/pull_bucket.py +++ b/tasks/0117_949_117949173_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0117_949_117949173_qa_2/task.toml b/tasks/0117_949_117949173_qa_2/task.toml index bfc431b21a722c2a0eb24f92ef21230136752f76..a25c94d8f5e7b339585e33851de3343c9cb613a9 100644 --- a/tasks/0117_949_117949173_qa_2/task.toml +++ b/tasks/0117_949_117949173_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_014_118014024_qa_1/environment/bootstrap.sh b/tasks/0118_014_118014024_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_014_118014024_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_014_118014024_qa_1/environment/pull_bucket.py b/tasks/0118_014_118014024_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_014_118014024_qa_1/environment/pull_bucket.py +++ b/tasks/0118_014_118014024_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_014_118014024_qa_1/task.toml b/tasks/0118_014_118014024_qa_1/task.toml index 3cf08e75bffb82b84c153c43021532ecc9067fef..f10edbfd29834e9d6107e713f34606ba40b6d4c9 100644 --- a/tasks/0118_014_118014024_qa_1/task.toml +++ b/tasks/0118_014_118014024_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_014_118014024_qa_3/environment/bootstrap.sh b/tasks/0118_014_118014024_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_014_118014024_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_014_118014024_qa_3/environment/pull_bucket.py b/tasks/0118_014_118014024_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_014_118014024_qa_3/environment/pull_bucket.py +++ b/tasks/0118_014_118014024_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_014_118014024_qa_3/task.toml b/tasks/0118_014_118014024_qa_3/task.toml index 87ad725d1baaaa046efcca7650f3c04fdbc59072..bb3fc82ccaf1d6ca74e43d2826d9b2ca4d3b2c04 100644 --- a/tasks/0118_014_118014024_qa_3/task.toml +++ b/tasks/0118_014_118014024_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_014_118014024_qa_4/environment/bootstrap.sh b/tasks/0118_014_118014024_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_014_118014024_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_014_118014024_qa_4/environment/pull_bucket.py b/tasks/0118_014_118014024_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_014_118014024_qa_4/environment/pull_bucket.py +++ b/tasks/0118_014_118014024_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_014_118014024_qa_4/task.toml b/tasks/0118_014_118014024_qa_4/task.toml index 184e264452ddf240e7c40701e75be3a982c4b194..d90e7064096a7ce5f93559be456674a7801b388f 100644 --- a/tasks/0118_014_118014024_qa_4/task.toml +++ b/tasks/0118_014_118014024_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_032_118032627_qa_1/environment/bootstrap.sh b/tasks/0118_032_118032627_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_032_118032627_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_032_118032627_qa_1/environment/pull_bucket.py b/tasks/0118_032_118032627_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_032_118032627_qa_1/environment/pull_bucket.py +++ b/tasks/0118_032_118032627_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_032_118032627_qa_1/task.toml b/tasks/0118_032_118032627_qa_1/task.toml index 8d345d0cd049f08c2e37b598f73cd7c2b8eb9320..219d6e1dddf654abf8285e69c9f6aa5dbda44d6f 100644 --- a/tasks/0118_032_118032627_qa_1/task.toml +++ b/tasks/0118_032_118032627_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_088_118088123_qa_1/environment/bootstrap.sh b/tasks/0118_088_118088123_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_088_118088123_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_088_118088123_qa_1/environment/pull_bucket.py b/tasks/0118_088_118088123_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_088_118088123_qa_1/environment/pull_bucket.py +++ b/tasks/0118_088_118088123_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_088_118088123_qa_1/task.toml b/tasks/0118_088_118088123_qa_1/task.toml index 05b9d004b1ccf0680c34b2872ec78dab2efc3c4b..9ad0ba1fd7bf99476a9a61941d8d497375b46925 100644 --- a/tasks/0118_088_118088123_qa_1/task.toml +++ b/tasks/0118_088_118088123_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_265_118265412_qa_5/environment/bootstrap.sh b/tasks/0118_265_118265412_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_265_118265412_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_265_118265412_qa_5/environment/pull_bucket.py b/tasks/0118_265_118265412_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_265_118265412_qa_5/environment/pull_bucket.py +++ b/tasks/0118_265_118265412_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_265_118265412_qa_5/task.toml b/tasks/0118_265_118265412_qa_5/task.toml index 30307e1753d8020d78605aa5b6889509c45b4e96..b0ea281dd8925eeb8f8cda038a61227de17f1262 100644 --- a/tasks/0118_265_118265412_qa_5/task.toml +++ b/tasks/0118_265_118265412_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_360_118360203_qa_1/environment/bootstrap.sh b/tasks/0118_360_118360203_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_360_118360203_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_360_118360203_qa_1/environment/pull_bucket.py b/tasks/0118_360_118360203_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_360_118360203_qa_1/environment/pull_bucket.py +++ b/tasks/0118_360_118360203_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_360_118360203_qa_1/task.toml b/tasks/0118_360_118360203_qa_1/task.toml index 0e35bc0d712ce92aa49844b6a3d4e395850a1513..90c90d455a476602069805f42fd88c29e8589b22 100644 --- a/tasks/0118_360_118360203_qa_1/task.toml +++ b/tasks/0118_360_118360203_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_360_118360203_qa_5/environment/bootstrap.sh b/tasks/0118_360_118360203_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_360_118360203_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_360_118360203_qa_5/environment/pull_bucket.py b/tasks/0118_360_118360203_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_360_118360203_qa_5/environment/pull_bucket.py +++ b/tasks/0118_360_118360203_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_360_118360203_qa_5/task.toml b/tasks/0118_360_118360203_qa_5/task.toml index 449f0fc9712f7f365914e1854f3d33b03c311448..9fd334f3a183d559272a5d06e388d79fffe4fbc2 100644 --- a/tasks/0118_360_118360203_qa_5/task.toml +++ b/tasks/0118_360_118360203_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_428_118428597_qa_3/environment/bootstrap.sh b/tasks/0118_428_118428597_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_428_118428597_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_428_118428597_qa_3/environment/pull_bucket.py b/tasks/0118_428_118428597_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_428_118428597_qa_3/environment/pull_bucket.py +++ b/tasks/0118_428_118428597_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_428_118428597_qa_3/task.toml b/tasks/0118_428_118428597_qa_3/task.toml index 10638077110275d514f3dba2a97ae910e2ebbb95..16d3970cb427a40d82123d368e6f3a7da5b60232 100644 --- a/tasks/0118_428_118428597_qa_3/task.toml +++ b/tasks/0118_428_118428597_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_567_118567628_qa_5/environment/bootstrap.sh b/tasks/0118_567_118567628_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_567_118567628_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_567_118567628_qa_5/environment/pull_bucket.py b/tasks/0118_567_118567628_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_567_118567628_qa_5/environment/pull_bucket.py +++ b/tasks/0118_567_118567628_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_567_118567628_qa_5/task.toml b/tasks/0118_567_118567628_qa_5/task.toml index 732f425543833f1b1863c52ea75a003aaa3ca9ad..6e0078159cd0dee06520e4194d2e011e8a3556ff 100644 --- a/tasks/0118_567_118567628_qa_5/task.toml +++ b/tasks/0118_567_118567628_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_595_118595576_qa_5/environment/bootstrap.sh b/tasks/0118_595_118595576_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_595_118595576_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_595_118595576_qa_5/environment/pull_bucket.py b/tasks/0118_595_118595576_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_595_118595576_qa_5/environment/pull_bucket.py +++ b/tasks/0118_595_118595576_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_595_118595576_qa_5/task.toml b/tasks/0118_595_118595576_qa_5/task.toml index 2e762b9a222c99e9bb9f93bf1544f03efcd9f66d..4228e163e61a835823f494f9283486701cfc3f80 100644 --- a/tasks/0118_595_118595576_qa_5/task.toml +++ b/tasks/0118_595_118595576_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_607_118607538_qa_2/environment/bootstrap.sh b/tasks/0118_607_118607538_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_607_118607538_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_607_118607538_qa_2/environment/pull_bucket.py b/tasks/0118_607_118607538_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_607_118607538_qa_2/environment/pull_bucket.py +++ b/tasks/0118_607_118607538_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_607_118607538_qa_2/task.toml b/tasks/0118_607_118607538_qa_2/task.toml index 3bca71ea70e69cc12abcda667b8ba399c2b97a8e..bd80b9ca7189e22c3356a6f8c0fa6b2236f64938 100644 --- a/tasks/0118_607_118607538_qa_2/task.toml +++ b/tasks/0118_607_118607538_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_642_118642840_qa_3/environment/bootstrap.sh b/tasks/0118_642_118642840_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_642_118642840_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_642_118642840_qa_3/environment/pull_bucket.py b/tasks/0118_642_118642840_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_642_118642840_qa_3/environment/pull_bucket.py +++ b/tasks/0118_642_118642840_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_642_118642840_qa_3/task.toml b/tasks/0118_642_118642840_qa_3/task.toml index 415e7cffbce890106c07d46c4673a3092419145f..5d3aaff2a456b107cb8d573bbe4c3ada852eb3d8 100644 --- a/tasks/0118_642_118642840_qa_3/task.toml +++ b/tasks/0118_642_118642840_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_642_118642840_qa_5/environment/bootstrap.sh b/tasks/0118_642_118642840_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_642_118642840_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_642_118642840_qa_5/environment/pull_bucket.py b/tasks/0118_642_118642840_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_642_118642840_qa_5/environment/pull_bucket.py +++ b/tasks/0118_642_118642840_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_642_118642840_qa_5/task.toml b/tasks/0118_642_118642840_qa_5/task.toml index a68906d287dbe272ad56dae98b90772d57e823bf..8104c8349b9d66e261e0ee222058b0cd00c0d33d 100644 --- a/tasks/0118_642_118642840_qa_5/task.toml +++ b/tasks/0118_642_118642840_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_722_118722407_qa_2/environment/bootstrap.sh b/tasks/0118_722_118722407_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_722_118722407_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_722_118722407_qa_2/environment/pull_bucket.py b/tasks/0118_722_118722407_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_722_118722407_qa_2/environment/pull_bucket.py +++ b/tasks/0118_722_118722407_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_722_118722407_qa_2/task.toml b/tasks/0118_722_118722407_qa_2/task.toml index 799224287cbac7505246f235a6c979df9c796462..53de8674f76316e358859d9bfa3284f0bde59f68 100644 --- a/tasks/0118_722_118722407_qa_2/task.toml +++ b/tasks/0118_722_118722407_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_899_118899556_qa_4/environment/bootstrap.sh b/tasks/0118_899_118899556_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_899_118899556_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_899_118899556_qa_4/environment/pull_bucket.py b/tasks/0118_899_118899556_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_899_118899556_qa_4/environment/pull_bucket.py +++ b/tasks/0118_899_118899556_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_899_118899556_qa_4/task.toml b/tasks/0118_899_118899556_qa_4/task.toml index cf4151f0f6f1ab2963efc2659b8f9d7c1f0901d8..8d8414732ad4b523f75b565871fc7aa5016646ce 100644 --- a/tasks/0118_899_118899556_qa_4/task.toml +++ b/tasks/0118_899_118899556_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_899_118899556_qa_5/environment/bootstrap.sh b/tasks/0118_899_118899556_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_899_118899556_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_899_118899556_qa_5/environment/pull_bucket.py b/tasks/0118_899_118899556_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_899_118899556_qa_5/environment/pull_bucket.py +++ b/tasks/0118_899_118899556_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_899_118899556_qa_5/task.toml b/tasks/0118_899_118899556_qa_5/task.toml index 5c6bd2566f9f3e3c6f8485b944b38747f2f1b2b0..1e5861246dd6645616933ebf1b4b01405a65c45d 100644 --- a/tasks/0118_899_118899556_qa_5/task.toml +++ b/tasks/0118_899_118899556_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_918_118918945_qa_2/environment/bootstrap.sh b/tasks/0118_918_118918945_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_918_118918945_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_918_118918945_qa_2/environment/pull_bucket.py b/tasks/0118_918_118918945_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_918_118918945_qa_2/environment/pull_bucket.py +++ b/tasks/0118_918_118918945_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_918_118918945_qa_2/task.toml b/tasks/0118_918_118918945_qa_2/task.toml index 873a1dace5d73bf8659c719e64bd18bfb1cb4307..9515efc628c5597ffc070e80c561042f0bc061dc 100644 --- a/tasks/0118_918_118918945_qa_2/task.toml +++ b/tasks/0118_918_118918945_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0118_978_118978270_qa_3/environment/bootstrap.sh b/tasks/0118_978_118978270_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0118_978_118978270_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0118_978_118978270_qa_3/environment/pull_bucket.py b/tasks/0118_978_118978270_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0118_978_118978270_qa_3/environment/pull_bucket.py +++ b/tasks/0118_978_118978270_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0118_978_118978270_qa_3/task.toml b/tasks/0118_978_118978270_qa_3/task.toml index a8bed800312d865e7295bc4bfef51beedbb721b2..eda78b48823f8bb2644f702505a47b4a028942a5 100644 --- a/tasks/0118_978_118978270_qa_3/task.toml +++ b/tasks/0118_978_118978270_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_001_119001162_qa_4/environment/bootstrap.sh b/tasks/0119_001_119001162_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_001_119001162_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_001_119001162_qa_4/environment/pull_bucket.py b/tasks/0119_001_119001162_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_001_119001162_qa_4/environment/pull_bucket.py +++ b/tasks/0119_001_119001162_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_001_119001162_qa_4/task.toml b/tasks/0119_001_119001162_qa_4/task.toml index 0a80fc06034ec9cc250b33bf4e07ba424db2d4f6..96eeef96bebf18b3d06276748e57f41a01074879 100644 --- a/tasks/0119_001_119001162_qa_4/task.toml +++ b/tasks/0119_001_119001162_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_018_119018113_qa_1/environment/bootstrap.sh b/tasks/0119_018_119018113_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_018_119018113_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_018_119018113_qa_1/environment/pull_bucket.py b/tasks/0119_018_119018113_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_018_119018113_qa_1/environment/pull_bucket.py +++ b/tasks/0119_018_119018113_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_018_119018113_qa_1/task.toml b/tasks/0119_018_119018113_qa_1/task.toml index 035ee2f0ab8c5ec8862aaef02718787d56b6f2fc..54456d009dc5a80d67e88a311f4a029899b0db98 100644 --- a/tasks/0119_018_119018113_qa_1/task.toml +++ b/tasks/0119_018_119018113_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_018_119018113_qa_5/environment/bootstrap.sh b/tasks/0119_018_119018113_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_018_119018113_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_018_119018113_qa_5/environment/pull_bucket.py b/tasks/0119_018_119018113_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_018_119018113_qa_5/environment/pull_bucket.py +++ b/tasks/0119_018_119018113_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_018_119018113_qa_5/task.toml b/tasks/0119_018_119018113_qa_5/task.toml index 84a29c9dc9efe2f4c510bdbc4241b1c22a0bca7e..df699c126f9f18d956062356179836816782ef1a 100644 --- a/tasks/0119_018_119018113_qa_5/task.toml +++ b/tasks/0119_018_119018113_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_037_119037763_qa_4/environment/bootstrap.sh b/tasks/0119_037_119037763_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_037_119037763_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_037_119037763_qa_4/environment/pull_bucket.py b/tasks/0119_037_119037763_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_037_119037763_qa_4/environment/pull_bucket.py +++ b/tasks/0119_037_119037763_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_037_119037763_qa_4/task.toml b/tasks/0119_037_119037763_qa_4/task.toml index b4c3768183e50f74017345b3b04d8bae0cf92b6f..56fd080d0c60aff7edfd50f7e599b7095c0bb327 100644 --- a/tasks/0119_037_119037763_qa_4/task.toml +++ b/tasks/0119_037_119037763_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_045_119045887_qa_3/environment/bootstrap.sh b/tasks/0119_045_119045887_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_045_119045887_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_045_119045887_qa_3/environment/pull_bucket.py b/tasks/0119_045_119045887_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_045_119045887_qa_3/environment/pull_bucket.py +++ b/tasks/0119_045_119045887_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_045_119045887_qa_3/task.toml b/tasks/0119_045_119045887_qa_3/task.toml index 9a443a5ecc7968ebd14532c8a648488372c56962..4fa812dcddb6485a9dde36fbde5432725e7d1456 100644 --- a/tasks/0119_045_119045887_qa_3/task.toml +++ b/tasks/0119_045_119045887_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_178_119178142_qa_4/environment/bootstrap.sh b/tasks/0119_178_119178142_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_178_119178142_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_178_119178142_qa_4/environment/pull_bucket.py b/tasks/0119_178_119178142_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_178_119178142_qa_4/environment/pull_bucket.py +++ b/tasks/0119_178_119178142_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_178_119178142_qa_4/task.toml b/tasks/0119_178_119178142_qa_4/task.toml index bfd835f28369ff7c95168282e268c52b8428b744..04ccd952c1d1694480246c664f03372bf774aa53 100644 --- a/tasks/0119_178_119178142_qa_4/task.toml +++ b/tasks/0119_178_119178142_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_277_119277434_qa_4/environment/bootstrap.sh b/tasks/0119_277_119277434_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_277_119277434_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_277_119277434_qa_4/environment/pull_bucket.py b/tasks/0119_277_119277434_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_277_119277434_qa_4/environment/pull_bucket.py +++ b/tasks/0119_277_119277434_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_277_119277434_qa_4/task.toml b/tasks/0119_277_119277434_qa_4/task.toml index abec29b0f444139a34864628ea153a81ee099130..91c6884e07e2b68571cddb03e91c39d348e759b0 100644 --- a/tasks/0119_277_119277434_qa_4/task.toml +++ b/tasks/0119_277_119277434_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_277_119277434_qa_5/environment/bootstrap.sh b/tasks/0119_277_119277434_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_277_119277434_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_277_119277434_qa_5/environment/pull_bucket.py b/tasks/0119_277_119277434_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_277_119277434_qa_5/environment/pull_bucket.py +++ b/tasks/0119_277_119277434_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_277_119277434_qa_5/task.toml b/tasks/0119_277_119277434_qa_5/task.toml index 045405bcdcd32f96dc7ad027f4959df4fc8b4e02..0896f3692bd98af2575897879d1be7dc915f90c8 100644 --- a/tasks/0119_277_119277434_qa_5/task.toml +++ b/tasks/0119_277_119277434_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_289_119289330_qa_4/environment/bootstrap.sh b/tasks/0119_289_119289330_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_289_119289330_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_289_119289330_qa_4/environment/pull_bucket.py b/tasks/0119_289_119289330_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_289_119289330_qa_4/environment/pull_bucket.py +++ b/tasks/0119_289_119289330_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_289_119289330_qa_4/task.toml b/tasks/0119_289_119289330_qa_4/task.toml index 7d08e0bccd1d8c040cb2b73296c6e5f64153a093..2a66eb339265d1a34921f49d1353da07b39106d6 100644 --- a/tasks/0119_289_119289330_qa_4/task.toml +++ b/tasks/0119_289_119289330_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_313_119313422_qa_1/environment/bootstrap.sh b/tasks/0119_313_119313422_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_313_119313422_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_313_119313422_qa_1/environment/pull_bucket.py b/tasks/0119_313_119313422_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_313_119313422_qa_1/environment/pull_bucket.py +++ b/tasks/0119_313_119313422_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_313_119313422_qa_1/task.toml b/tasks/0119_313_119313422_qa_1/task.toml index ecab593e6e5416894c858d7cc831091f1d646ddb..44a48d7d4c575119f0c92015977fda155a34f0ce 100644 --- a/tasks/0119_313_119313422_qa_1/task.toml +++ b/tasks/0119_313_119313422_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_313_119313422_qa_3/environment/bootstrap.sh b/tasks/0119_313_119313422_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_313_119313422_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_313_119313422_qa_3/environment/pull_bucket.py b/tasks/0119_313_119313422_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_313_119313422_qa_3/environment/pull_bucket.py +++ b/tasks/0119_313_119313422_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_313_119313422_qa_3/task.toml b/tasks/0119_313_119313422_qa_3/task.toml index 482b1afe79712cf4d3e87f9bc3082050a86120ea..acb952405ac411f737d1d77e48bda53c205f03bb 100644 --- a/tasks/0119_313_119313422_qa_3/task.toml +++ b/tasks/0119_313_119313422_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_484_119484635_qa_2/environment/bootstrap.sh b/tasks/0119_484_119484635_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_484_119484635_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_484_119484635_qa_2/environment/pull_bucket.py b/tasks/0119_484_119484635_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_484_119484635_qa_2/environment/pull_bucket.py +++ b/tasks/0119_484_119484635_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_484_119484635_qa_2/task.toml b/tasks/0119_484_119484635_qa_2/task.toml index c34b8ca921167e098c918a6eaf4a48c46bfe3211..73b04cbddca713aaec7a01937e5bad7c52739fe3 100644 --- a/tasks/0119_484_119484635_qa_2/task.toml +++ b/tasks/0119_484_119484635_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_484_119484635_qa_5/environment/bootstrap.sh b/tasks/0119_484_119484635_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_484_119484635_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_484_119484635_qa_5/environment/pull_bucket.py b/tasks/0119_484_119484635_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_484_119484635_qa_5/environment/pull_bucket.py +++ b/tasks/0119_484_119484635_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_484_119484635_qa_5/task.toml b/tasks/0119_484_119484635_qa_5/task.toml index e9ed9db843deb9642458e1c768c13051402b6b94..379b0698433050898a8f3929286d07a908180c14 100644 --- a/tasks/0119_484_119484635_qa_5/task.toml +++ b/tasks/0119_484_119484635_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_554_119554814_qa_1/environment/bootstrap.sh b/tasks/0119_554_119554814_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_554_119554814_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_554_119554814_qa_1/environment/pull_bucket.py b/tasks/0119_554_119554814_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_554_119554814_qa_1/environment/pull_bucket.py +++ b/tasks/0119_554_119554814_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_554_119554814_qa_1/task.toml b/tasks/0119_554_119554814_qa_1/task.toml index e1589bb750c2193d841ef59a9ee475a6381f0c0f..87428eca1ca3ba09c04338fccc4319a758ff7f83 100644 --- a/tasks/0119_554_119554814_qa_1/task.toml +++ b/tasks/0119_554_119554814_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_554_119554814_qa_4/environment/bootstrap.sh b/tasks/0119_554_119554814_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_554_119554814_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_554_119554814_qa_4/environment/pull_bucket.py b/tasks/0119_554_119554814_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_554_119554814_qa_4/environment/pull_bucket.py +++ b/tasks/0119_554_119554814_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_554_119554814_qa_4/task.toml b/tasks/0119_554_119554814_qa_4/task.toml index 5f1a5219c42d9129adb1db443d3108e24ad4b016..57fea2c83151199d99e5af9870c5d62ef2386ecb 100644 --- a/tasks/0119_554_119554814_qa_4/task.toml +++ b/tasks/0119_554_119554814_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_557_119557726_qa_5/environment/bootstrap.sh b/tasks/0119_557_119557726_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_557_119557726_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_557_119557726_qa_5/environment/pull_bucket.py b/tasks/0119_557_119557726_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_557_119557726_qa_5/environment/pull_bucket.py +++ b/tasks/0119_557_119557726_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_557_119557726_qa_5/task.toml b/tasks/0119_557_119557726_qa_5/task.toml index 54b4f3f5e17887bc14911aad05a66f27701e8124..8198cdacc87501a117a3ebd2eccb6e8afbf93c02 100644 --- a/tasks/0119_557_119557726_qa_5/task.toml +++ b/tasks/0119_557_119557726_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_585_119585532_qa_5/environment/bootstrap.sh b/tasks/0119_585_119585532_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_585_119585532_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_585_119585532_qa_5/environment/pull_bucket.py b/tasks/0119_585_119585532_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_585_119585532_qa_5/environment/pull_bucket.py +++ b/tasks/0119_585_119585532_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_585_119585532_qa_5/task.toml b/tasks/0119_585_119585532_qa_5/task.toml index c0f6831b1505a75f745416606cf0e5d119de33a5..309ca01669078d7eea4c281f8d6817f6d7e8d78d 100644 --- a/tasks/0119_585_119585532_qa_5/task.toml +++ b/tasks/0119_585_119585532_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_590_119590030_qa_2/environment/bootstrap.sh b/tasks/0119_590_119590030_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_590_119590030_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_590_119590030_qa_2/environment/pull_bucket.py b/tasks/0119_590_119590030_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_590_119590030_qa_2/environment/pull_bucket.py +++ b/tasks/0119_590_119590030_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_590_119590030_qa_2/task.toml b/tasks/0119_590_119590030_qa_2/task.toml index 994b3cc34c8af0e17035c3126ab1d4322e35f235..f7852407e312cfbaa7df50925d7ec5f01b978f31 100644 --- a/tasks/0119_590_119590030_qa_2/task.toml +++ b/tasks/0119_590_119590030_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_629_119629452_qa_1/environment/bootstrap.sh b/tasks/0119_629_119629452_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_629_119629452_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_629_119629452_qa_1/environment/pull_bucket.py b/tasks/0119_629_119629452_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_629_119629452_qa_1/environment/pull_bucket.py +++ b/tasks/0119_629_119629452_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_629_119629452_qa_1/task.toml b/tasks/0119_629_119629452_qa_1/task.toml index 1afd234df61f37d396bac6cdcbed07b784760f59..1280feafb000c5fd152ce56ad49731297000a4e2 100644 --- a/tasks/0119_629_119629452_qa_1/task.toml +++ b/tasks/0119_629_119629452_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_629_119629452_qa_4/environment/bootstrap.sh b/tasks/0119_629_119629452_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_629_119629452_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_629_119629452_qa_4/environment/pull_bucket.py b/tasks/0119_629_119629452_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_629_119629452_qa_4/environment/pull_bucket.py +++ b/tasks/0119_629_119629452_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_629_119629452_qa_4/task.toml b/tasks/0119_629_119629452_qa_4/task.toml index 0eb7f0de4e58b59d3da9260f3bd339716fd6c397..6446f6e5e8ab36f7babb0d87d979c1f60c17102d 100644 --- a/tasks/0119_629_119629452_qa_4/task.toml +++ b/tasks/0119_629_119629452_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_653_119653509_qa_1/environment/bootstrap.sh b/tasks/0119_653_119653509_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_653_119653509_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_653_119653509_qa_1/environment/pull_bucket.py b/tasks/0119_653_119653509_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_653_119653509_qa_1/environment/pull_bucket.py +++ b/tasks/0119_653_119653509_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_653_119653509_qa_1/task.toml b/tasks/0119_653_119653509_qa_1/task.toml index a74c756c3e7236bb163b63a30aac9d46792703e2..be11521af98f19ccffeec8ed328f079588cb2f84 100644 --- a/tasks/0119_653_119653509_qa_1/task.toml +++ b/tasks/0119_653_119653509_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_653_119653509_qa_2/environment/bootstrap.sh b/tasks/0119_653_119653509_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_653_119653509_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_653_119653509_qa_2/environment/pull_bucket.py b/tasks/0119_653_119653509_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_653_119653509_qa_2/environment/pull_bucket.py +++ b/tasks/0119_653_119653509_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_653_119653509_qa_2/task.toml b/tasks/0119_653_119653509_qa_2/task.toml index 468d5c3141650a1438e15ca2b56e260a761ce37f..79d7482027a444801b6f867f0f3f7fc0c218e1df 100644 --- a/tasks/0119_653_119653509_qa_2/task.toml +++ b/tasks/0119_653_119653509_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_653_119653509_qa_5/environment/bootstrap.sh b/tasks/0119_653_119653509_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_653_119653509_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_653_119653509_qa_5/environment/pull_bucket.py b/tasks/0119_653_119653509_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_653_119653509_qa_5/environment/pull_bucket.py +++ b/tasks/0119_653_119653509_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_653_119653509_qa_5/task.toml b/tasks/0119_653_119653509_qa_5/task.toml index 373a6c7240fb068f87e2a2623e288bb208cc198d..6622d6514904ea5b34d2acdb0bc4266540308b56 100644 --- a/tasks/0119_653_119653509_qa_5/task.toml +++ b/tasks/0119_653_119653509_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_666_119666168_qa_2/environment/bootstrap.sh b/tasks/0119_666_119666168_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_666_119666168_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_666_119666168_qa_2/environment/pull_bucket.py b/tasks/0119_666_119666168_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_666_119666168_qa_2/environment/pull_bucket.py +++ b/tasks/0119_666_119666168_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_666_119666168_qa_2/task.toml b/tasks/0119_666_119666168_qa_2/task.toml index 807a65d3b89d117562d9706d5d942f45ef6d5bf0..0e5f3161ab0f34714462d5c17e4ba69493b28e9f 100644 --- a/tasks/0119_666_119666168_qa_2/task.toml +++ b/tasks/0119_666_119666168_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_760_119760174_qa_3/environment/bootstrap.sh b/tasks/0119_760_119760174_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_760_119760174_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_760_119760174_qa_3/environment/pull_bucket.py b/tasks/0119_760_119760174_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_760_119760174_qa_3/environment/pull_bucket.py +++ b/tasks/0119_760_119760174_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_760_119760174_qa_3/task.toml b/tasks/0119_760_119760174_qa_3/task.toml index 80aa1eb6c26cf3c4699ae03a86c4601625a473b7..d627c9792a525b45f8b8b4071703a19f3f88fba8 100644 --- a/tasks/0119_760_119760174_qa_3/task.toml +++ b/tasks/0119_760_119760174_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_768_119768016_qa_3/environment/bootstrap.sh b/tasks/0119_768_119768016_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_768_119768016_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_768_119768016_qa_3/environment/pull_bucket.py b/tasks/0119_768_119768016_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_768_119768016_qa_3/environment/pull_bucket.py +++ b/tasks/0119_768_119768016_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_768_119768016_qa_3/task.toml b/tasks/0119_768_119768016_qa_3/task.toml index add6ff435f754e75f8f4cb1be187d09c6778aa6d..709476d33e7bd147b44413f8ac27c189b3362555 100644 --- a/tasks/0119_768_119768016_qa_3/task.toml +++ b/tasks/0119_768_119768016_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_782_119782096_qa_2/environment/bootstrap.sh b/tasks/0119_782_119782096_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_782_119782096_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_782_119782096_qa_2/environment/pull_bucket.py b/tasks/0119_782_119782096_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_782_119782096_qa_2/environment/pull_bucket.py +++ b/tasks/0119_782_119782096_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_782_119782096_qa_2/task.toml b/tasks/0119_782_119782096_qa_2/task.toml index c1beff46ff20f3eda19613db99aa02bf792d1212..76cc3b60e45e6bceaa38995e2497c0e36c1f6c08 100644 --- a/tasks/0119_782_119782096_qa_2/task.toml +++ b/tasks/0119_782_119782096_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_783_119783005_qa_5/environment/bootstrap.sh b/tasks/0119_783_119783005_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_783_119783005_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_783_119783005_qa_5/environment/pull_bucket.py b/tasks/0119_783_119783005_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_783_119783005_qa_5/environment/pull_bucket.py +++ b/tasks/0119_783_119783005_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_783_119783005_qa_5/task.toml b/tasks/0119_783_119783005_qa_5/task.toml index 5c6f8dc746f3bd9ca11096239a478b31f5057236..2476d2f36560d186dab74a3c8feb4b478bd2332d 100644 --- a/tasks/0119_783_119783005_qa_5/task.toml +++ b/tasks/0119_783_119783005_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_894_119894753_qa_4/environment/bootstrap.sh b/tasks/0119_894_119894753_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_894_119894753_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_894_119894753_qa_4/environment/pull_bucket.py b/tasks/0119_894_119894753_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_894_119894753_qa_4/environment/pull_bucket.py +++ b/tasks/0119_894_119894753_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_894_119894753_qa_4/task.toml b/tasks/0119_894_119894753_qa_4/task.toml index bd198fe2cbd3f9b50c0889b71ffdcec23d6421b3..4fb4df2836e6d4d7ec3e311132299a57de3f640d 100644 --- a/tasks/0119_894_119894753_qa_4/task.toml +++ b/tasks/0119_894_119894753_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_896_119896768_qa_3/environment/bootstrap.sh b/tasks/0119_896_119896768_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_896_119896768_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_896_119896768_qa_3/environment/pull_bucket.py b/tasks/0119_896_119896768_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_896_119896768_qa_3/environment/pull_bucket.py +++ b/tasks/0119_896_119896768_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_896_119896768_qa_3/task.toml b/tasks/0119_896_119896768_qa_3/task.toml index 5b8e62b3000ea65b7e7824d17d6b2246f05b6300..0d9d5725c2f123161ed45d3a9f63bdce8f618f2b 100644 --- a/tasks/0119_896_119896768_qa_3/task.toml +++ b/tasks/0119_896_119896768_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_907_119907848_qa_1/environment/bootstrap.sh b/tasks/0119_907_119907848_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_907_119907848_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_907_119907848_qa_1/environment/pull_bucket.py b/tasks/0119_907_119907848_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_907_119907848_qa_1/environment/pull_bucket.py +++ b/tasks/0119_907_119907848_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_907_119907848_qa_1/task.toml b/tasks/0119_907_119907848_qa_1/task.toml index 76b601948151f83b7e65d9c9aa1075627efa241d..ddd3d93466735fa32401e89dbd32470ce3a44e2f 100644 --- a/tasks/0119_907_119907848_qa_1/task.toml +++ b/tasks/0119_907_119907848_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_926_119926274_qa_1/environment/bootstrap.sh b/tasks/0119_926_119926274_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_926_119926274_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_926_119926274_qa_1/environment/pull_bucket.py b/tasks/0119_926_119926274_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_926_119926274_qa_1/environment/pull_bucket.py +++ b/tasks/0119_926_119926274_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_926_119926274_qa_1/task.toml b/tasks/0119_926_119926274_qa_1/task.toml index 55f8f63bddc4c78ced9c672f7af469bc09e34776..237ff02972c57e6f94e97f8b169b51eab8465811 100644 --- a/tasks/0119_926_119926274_qa_1/task.toml +++ b/tasks/0119_926_119926274_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_926_119926274_qa_5/environment/bootstrap.sh b/tasks/0119_926_119926274_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_926_119926274_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_926_119926274_qa_5/environment/pull_bucket.py b/tasks/0119_926_119926274_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_926_119926274_qa_5/environment/pull_bucket.py +++ b/tasks/0119_926_119926274_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_926_119926274_qa_5/task.toml b/tasks/0119_926_119926274_qa_5/task.toml index 62d1ae65e8eeec66d67e240c081cf5c9d2fcfe1e..53e0ad1358d114f312b51d53da62a5b3f7117545 100644 --- a/tasks/0119_926_119926274_qa_5/task.toml +++ b/tasks/0119_926_119926274_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_931_119931935_qa_1/environment/bootstrap.sh b/tasks/0119_931_119931935_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_931_119931935_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_931_119931935_qa_1/environment/pull_bucket.py b/tasks/0119_931_119931935_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_931_119931935_qa_1/environment/pull_bucket.py +++ b/tasks/0119_931_119931935_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_931_119931935_qa_1/task.toml b/tasks/0119_931_119931935_qa_1/task.toml index 92c822ab52cfced61975e76489535420ab0c03e7..e84ea2acbaf40a118b585cb477ab21b234925c42 100644 --- a/tasks/0119_931_119931935_qa_1/task.toml +++ b/tasks/0119_931_119931935_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_932_119932663_qa_2/environment/bootstrap.sh b/tasks/0119_932_119932663_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_932_119932663_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_932_119932663_qa_2/environment/pull_bucket.py b/tasks/0119_932_119932663_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_932_119932663_qa_2/environment/pull_bucket.py +++ b/tasks/0119_932_119932663_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_932_119932663_qa_2/task.toml b/tasks/0119_932_119932663_qa_2/task.toml index 7dc433b2b72d149b918c6f0550d1ceef3aa848b0..540fe4d8f733625edc64a5ef96960b32010b204f 100644 --- a/tasks/0119_932_119932663_qa_2/task.toml +++ b/tasks/0119_932_119932663_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_971_119971188_qa_3/environment/bootstrap.sh b/tasks/0119_971_119971188_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_971_119971188_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_971_119971188_qa_3/environment/pull_bucket.py b/tasks/0119_971_119971188_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_971_119971188_qa_3/environment/pull_bucket.py +++ b/tasks/0119_971_119971188_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_971_119971188_qa_3/task.toml b/tasks/0119_971_119971188_qa_3/task.toml index a7508c6546c31ca6ec4d6cdbdea8f83b6feb3302..f7039a17efcd87266ca9927ebd0574906ced4497 100644 --- a/tasks/0119_971_119971188_qa_3/task.toml +++ b/tasks/0119_971_119971188_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0119_986_119986677_qa_3/environment/bootstrap.sh b/tasks/0119_986_119986677_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0119_986_119986677_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0119_986_119986677_qa_3/environment/pull_bucket.py b/tasks/0119_986_119986677_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0119_986_119986677_qa_3/environment/pull_bucket.py +++ b/tasks/0119_986_119986677_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0119_986_119986677_qa_3/task.toml b/tasks/0119_986_119986677_qa_3/task.toml index 6a3e84752e0658a15d6d972e0d887046414ea1e3..93593a30bac7f67e8c59249cb4dd2aa9940f64ec 100644 --- a/tasks/0119_986_119986677_qa_3/task.toml +++ b/tasks/0119_986_119986677_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_037_120037630_qa_2/environment/bootstrap.sh b/tasks/0120_037_120037630_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_037_120037630_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_037_120037630_qa_2/environment/pull_bucket.py b/tasks/0120_037_120037630_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_037_120037630_qa_2/environment/pull_bucket.py +++ b/tasks/0120_037_120037630_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_037_120037630_qa_2/task.toml b/tasks/0120_037_120037630_qa_2/task.toml index 675786171d52dbc4345ae4fda8e1aa69296e1e4b..9710c26e02ba43a48576c55c828fe5a343e6b131 100644 --- a/tasks/0120_037_120037630_qa_2/task.toml +++ b/tasks/0120_037_120037630_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_037_120037630_qa_4/environment/bootstrap.sh b/tasks/0120_037_120037630_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_037_120037630_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_037_120037630_qa_4/environment/pull_bucket.py b/tasks/0120_037_120037630_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_037_120037630_qa_4/environment/pull_bucket.py +++ b/tasks/0120_037_120037630_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_037_120037630_qa_4/task.toml b/tasks/0120_037_120037630_qa_4/task.toml index 77927188dc25af5faea9d8c7d56ae70cfbd1e755..512d3d62b909db6a43030d47ef72225967dad7aa 100644 --- a/tasks/0120_037_120037630_qa_4/task.toml +++ b/tasks/0120_037_120037630_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_102_120102768_qa_1/environment/bootstrap.sh b/tasks/0120_102_120102768_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_102_120102768_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_102_120102768_qa_1/environment/pull_bucket.py b/tasks/0120_102_120102768_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_102_120102768_qa_1/environment/pull_bucket.py +++ b/tasks/0120_102_120102768_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_102_120102768_qa_1/task.toml b/tasks/0120_102_120102768_qa_1/task.toml index 81be56c42a617567a209a097602208657fdc83c6..e22f5f5313951bdbf2d99d3fc0772aa52329ca4a 100644 --- a/tasks/0120_102_120102768_qa_1/task.toml +++ b/tasks/0120_102_120102768_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_102_120102768_qa_2/environment/bootstrap.sh b/tasks/0120_102_120102768_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_102_120102768_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_102_120102768_qa_2/environment/pull_bucket.py b/tasks/0120_102_120102768_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_102_120102768_qa_2/environment/pull_bucket.py +++ b/tasks/0120_102_120102768_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_102_120102768_qa_2/task.toml b/tasks/0120_102_120102768_qa_2/task.toml index 3094264c4435ae8d127f78f2a5ca233a68142666..4c51c505c37796035171e3a117d15eb8481d2675 100644 --- a/tasks/0120_102_120102768_qa_2/task.toml +++ b/tasks/0120_102_120102768_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_295_120295119_qa_2/environment/bootstrap.sh b/tasks/0120_295_120295119_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_295_120295119_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_295_120295119_qa_2/environment/pull_bucket.py b/tasks/0120_295_120295119_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_295_120295119_qa_2/environment/pull_bucket.py +++ b/tasks/0120_295_120295119_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_295_120295119_qa_2/task.toml b/tasks/0120_295_120295119_qa_2/task.toml index 56afb421a5526bd3686984c5a94d9329550128d3..540f2d4d8ac0de890ff6f333b741dee3776690a2 100644 --- a/tasks/0120_295_120295119_qa_2/task.toml +++ b/tasks/0120_295_120295119_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_295_120295119_qa_5/environment/bootstrap.sh b/tasks/0120_295_120295119_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_295_120295119_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_295_120295119_qa_5/environment/pull_bucket.py b/tasks/0120_295_120295119_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_295_120295119_qa_5/environment/pull_bucket.py +++ b/tasks/0120_295_120295119_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_295_120295119_qa_5/task.toml b/tasks/0120_295_120295119_qa_5/task.toml index de8798dfae12d4ef344589d1fa9379070d2c1900..5da2a6a940d0795affd5f827702145659e250418 100644 --- a/tasks/0120_295_120295119_qa_5/task.toml +++ b/tasks/0120_295_120295119_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_304_120304069_qa_1/environment/bootstrap.sh b/tasks/0120_304_120304069_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_304_120304069_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_304_120304069_qa_1/environment/pull_bucket.py b/tasks/0120_304_120304069_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_304_120304069_qa_1/environment/pull_bucket.py +++ b/tasks/0120_304_120304069_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_304_120304069_qa_1/task.toml b/tasks/0120_304_120304069_qa_1/task.toml index a8e1b17b77c7ad2dd7eb00548e707c9054091a4f..20aad8add9c367f97b93dc36729481237f850ab6 100644 --- a/tasks/0120_304_120304069_qa_1/task.toml +++ b/tasks/0120_304_120304069_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_313_120313409_qa_1/environment/bootstrap.sh b/tasks/0120_313_120313409_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_313_120313409_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_313_120313409_qa_1/environment/pull_bucket.py b/tasks/0120_313_120313409_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_313_120313409_qa_1/environment/pull_bucket.py +++ b/tasks/0120_313_120313409_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_313_120313409_qa_1/task.toml b/tasks/0120_313_120313409_qa_1/task.toml index 2cfa6c8ea9be089a3f90f30556fc5e7190a30751..3b57c6917b567cc3135603b176dd57e0e4b014c8 100644 --- a/tasks/0120_313_120313409_qa_1/task.toml +++ b/tasks/0120_313_120313409_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_313_120313409_qa_3/environment/bootstrap.sh b/tasks/0120_313_120313409_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_313_120313409_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_313_120313409_qa_3/environment/pull_bucket.py b/tasks/0120_313_120313409_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_313_120313409_qa_3/environment/pull_bucket.py +++ b/tasks/0120_313_120313409_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_313_120313409_qa_3/task.toml b/tasks/0120_313_120313409_qa_3/task.toml index 955b5d39862498a3bc4aff3753aca267e79834c1..f0a4abe403c8863f338232c40dab4a326a3d782c 100644 --- a/tasks/0120_313_120313409_qa_3/task.toml +++ b/tasks/0120_313_120313409_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_387_120387726_qa_1/environment/bootstrap.sh b/tasks/0120_387_120387726_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_387_120387726_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_387_120387726_qa_1/environment/pull_bucket.py b/tasks/0120_387_120387726_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_387_120387726_qa_1/environment/pull_bucket.py +++ b/tasks/0120_387_120387726_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_387_120387726_qa_1/task.toml b/tasks/0120_387_120387726_qa_1/task.toml index 0b6c26c58ea5f961ae6ca5e73951221d2b24c965..e875b93f19e9675b0bb025b3a50183f618dc6a37 100644 --- a/tasks/0120_387_120387726_qa_1/task.toml +++ b/tasks/0120_387_120387726_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_413_120413293_qa_3/environment/bootstrap.sh b/tasks/0120_413_120413293_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_413_120413293_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_413_120413293_qa_3/environment/pull_bucket.py b/tasks/0120_413_120413293_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_413_120413293_qa_3/environment/pull_bucket.py +++ b/tasks/0120_413_120413293_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_413_120413293_qa_3/task.toml b/tasks/0120_413_120413293_qa_3/task.toml index 4cbfc52447cf68fd27383e5b7d026d23b249ea4f..6f70a61ee59de1e2e3b5e8b98f32bbb68adf956d 100644 --- a/tasks/0120_413_120413293_qa_3/task.toml +++ b/tasks/0120_413_120413293_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_461_120461715_qa_2/environment/bootstrap.sh b/tasks/0120_461_120461715_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_461_120461715_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_461_120461715_qa_2/environment/pull_bucket.py b/tasks/0120_461_120461715_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_461_120461715_qa_2/environment/pull_bucket.py +++ b/tasks/0120_461_120461715_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_461_120461715_qa_2/task.toml b/tasks/0120_461_120461715_qa_2/task.toml index dacde45afa0163354598c6abbda394b983ad23b3..88b2234b6df00ee2232c648971433ce82b9ec7c8 100644 --- a/tasks/0120_461_120461715_qa_2/task.toml +++ b/tasks/0120_461_120461715_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_461_120461715_qa_3/environment/bootstrap.sh b/tasks/0120_461_120461715_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_461_120461715_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_461_120461715_qa_3/environment/pull_bucket.py b/tasks/0120_461_120461715_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_461_120461715_qa_3/environment/pull_bucket.py +++ b/tasks/0120_461_120461715_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_461_120461715_qa_3/task.toml b/tasks/0120_461_120461715_qa_3/task.toml index c10988cdcbc8dfcb112521badd670fe473212b5e..6f1018c559ffaacf8fab7413e850b321ec893753 100644 --- a/tasks/0120_461_120461715_qa_3/task.toml +++ b/tasks/0120_461_120461715_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_461_120461715_qa_5/environment/bootstrap.sh b/tasks/0120_461_120461715_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_461_120461715_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_461_120461715_qa_5/environment/pull_bucket.py b/tasks/0120_461_120461715_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_461_120461715_qa_5/environment/pull_bucket.py +++ b/tasks/0120_461_120461715_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_461_120461715_qa_5/task.toml b/tasks/0120_461_120461715_qa_5/task.toml index 94daf02c5eb6732b9918d5c7fa42274a09f89f56..7b2df1b9dedb50bfb75bab36aed6606b1242e555 100644 --- a/tasks/0120_461_120461715_qa_5/task.toml +++ b/tasks/0120_461_120461715_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_525_120525286_qa_2/environment/bootstrap.sh b/tasks/0120_525_120525286_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_525_120525286_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_525_120525286_qa_2/environment/pull_bucket.py b/tasks/0120_525_120525286_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_525_120525286_qa_2/environment/pull_bucket.py +++ b/tasks/0120_525_120525286_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_525_120525286_qa_2/task.toml b/tasks/0120_525_120525286_qa_2/task.toml index e891f0de83a2f9bd1cb104f522c7b453b1fa09d7..c6fdfac18c90c47a8f97e58e0b39f60a4d13ac9b 100644 --- a/tasks/0120_525_120525286_qa_2/task.toml +++ b/tasks/0120_525_120525286_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_525_120525884_qa_4/environment/bootstrap.sh b/tasks/0120_525_120525884_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_525_120525884_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_525_120525884_qa_4/environment/pull_bucket.py b/tasks/0120_525_120525884_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_525_120525884_qa_4/environment/pull_bucket.py +++ b/tasks/0120_525_120525884_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_525_120525884_qa_4/task.toml b/tasks/0120_525_120525884_qa_4/task.toml index 90e3e11cd42fe9651bc67c3c1d233a8ebbe90f07..b1f95c38e562ad507f805d7013dfba09245c2a85 100644 --- a/tasks/0120_525_120525884_qa_4/task.toml +++ b/tasks/0120_525_120525884_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_535_120535462_qa_3/environment/bootstrap.sh b/tasks/0120_535_120535462_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_535_120535462_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_535_120535462_qa_3/environment/pull_bucket.py b/tasks/0120_535_120535462_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_535_120535462_qa_3/environment/pull_bucket.py +++ b/tasks/0120_535_120535462_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_535_120535462_qa_3/task.toml b/tasks/0120_535_120535462_qa_3/task.toml index 0d158cde38d4a107a748001efbce185944e32f15..6563a08bd11d6ad32cc96377a2fceed81dfc3eb1 100644 --- a/tasks/0120_535_120535462_qa_3/task.toml +++ b/tasks/0120_535_120535462_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_574_120574465_qa_1/environment/bootstrap.sh b/tasks/0120_574_120574465_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_574_120574465_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_574_120574465_qa_1/environment/pull_bucket.py b/tasks/0120_574_120574465_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_574_120574465_qa_1/environment/pull_bucket.py +++ b/tasks/0120_574_120574465_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_574_120574465_qa_1/task.toml b/tasks/0120_574_120574465_qa_1/task.toml index 1a0273c3549215fc34c41bf14b460cc11b846f52..3facd4e17d0f5cac9da039787eff2a7cec2712fe 100644 --- a/tasks/0120_574_120574465_qa_1/task.toml +++ b/tasks/0120_574_120574465_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_574_120574465_qa_2/environment/bootstrap.sh b/tasks/0120_574_120574465_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_574_120574465_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_574_120574465_qa_2/environment/pull_bucket.py b/tasks/0120_574_120574465_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_574_120574465_qa_2/environment/pull_bucket.py +++ b/tasks/0120_574_120574465_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_574_120574465_qa_2/task.toml b/tasks/0120_574_120574465_qa_2/task.toml index 0c83380e5e86bce228690b887cfd154d49545438..2135775ceff3e2b54e0b6c883064d0ea0602bc22 100644 --- a/tasks/0120_574_120574465_qa_2/task.toml +++ b/tasks/0120_574_120574465_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_687_120687537_qa_5/environment/bootstrap.sh b/tasks/0120_687_120687537_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_687_120687537_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_687_120687537_qa_5/environment/pull_bucket.py b/tasks/0120_687_120687537_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_687_120687537_qa_5/environment/pull_bucket.py +++ b/tasks/0120_687_120687537_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_687_120687537_qa_5/task.toml b/tasks/0120_687_120687537_qa_5/task.toml index 8714916056d58cc1478db861d4ceb444734720cf..2bb803038125bad83af11a3c3400added1b5f522 100644 --- a/tasks/0120_687_120687537_qa_5/task.toml +++ b/tasks/0120_687_120687537_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_783_120783348_qa_3/environment/bootstrap.sh b/tasks/0120_783_120783348_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_783_120783348_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_783_120783348_qa_3/environment/pull_bucket.py b/tasks/0120_783_120783348_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_783_120783348_qa_3/environment/pull_bucket.py +++ b/tasks/0120_783_120783348_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_783_120783348_qa_3/task.toml b/tasks/0120_783_120783348_qa_3/task.toml index f5324b8f9a1bc5fbb7e48cfeb14dcc2408b538b6..8281c4c126c5ecea451475f4def6605712f853a8 100644 --- a/tasks/0120_783_120783348_qa_3/task.toml +++ b/tasks/0120_783_120783348_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_921_120921808_qa_3/environment/bootstrap.sh b/tasks/0120_921_120921808_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_921_120921808_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_921_120921808_qa_3/environment/pull_bucket.py b/tasks/0120_921_120921808_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_921_120921808_qa_3/environment/pull_bucket.py +++ b/tasks/0120_921_120921808_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_921_120921808_qa_3/task.toml b/tasks/0120_921_120921808_qa_3/task.toml index 1a6bdf5bd400f74b92315cc967de0b83d0f9f472..58709ed7fc52655cbca41fdf56ae449ccd4ec35f 100644 --- a/tasks/0120_921_120921808_qa_3/task.toml +++ b/tasks/0120_921_120921808_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_952_120952804_qa_4/environment/bootstrap.sh b/tasks/0120_952_120952804_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_952_120952804_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_952_120952804_qa_4/environment/pull_bucket.py b/tasks/0120_952_120952804_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_952_120952804_qa_4/environment/pull_bucket.py +++ b/tasks/0120_952_120952804_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_952_120952804_qa_4/task.toml b/tasks/0120_952_120952804_qa_4/task.toml index 6b03535a158fdc4d80867035d1f76ee2297893c2..65d339f664d0b3bb2dd62f2bb58d1ceef6a6bac3 100644 --- a/tasks/0120_952_120952804_qa_4/task.toml +++ b/tasks/0120_952_120952804_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_979_120979302_qa_5/environment/bootstrap.sh b/tasks/0120_979_120979302_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_979_120979302_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_979_120979302_qa_5/environment/pull_bucket.py b/tasks/0120_979_120979302_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_979_120979302_qa_5/environment/pull_bucket.py +++ b/tasks/0120_979_120979302_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_979_120979302_qa_5/task.toml b/tasks/0120_979_120979302_qa_5/task.toml index dcc92110b6f9b5bfcffbbdc54ad491397be17746..818664e9c76f53e7bfcc7f7db3e06ba30c811178 100644 --- a/tasks/0120_979_120979302_qa_5/task.toml +++ b/tasks/0120_979_120979302_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0120_987_120987317_qa_4/environment/bootstrap.sh b/tasks/0120_987_120987317_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0120_987_120987317_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0120_987_120987317_qa_4/environment/pull_bucket.py b/tasks/0120_987_120987317_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0120_987_120987317_qa_4/environment/pull_bucket.py +++ b/tasks/0120_987_120987317_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0120_987_120987317_qa_4/task.toml b/tasks/0120_987_120987317_qa_4/task.toml index 65a05d0c7678a8cf501b884442d0c822a65121a0..2a601795979300af7b761f611b7bbc0894fd4784 100644 --- a/tasks/0120_987_120987317_qa_4/task.toml +++ b/tasks/0120_987_120987317_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_046_121046676_qa_4/environment/bootstrap.sh b/tasks/0121_046_121046676_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_046_121046676_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_046_121046676_qa_4/environment/pull_bucket.py b/tasks/0121_046_121046676_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_046_121046676_qa_4/environment/pull_bucket.py +++ b/tasks/0121_046_121046676_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_046_121046676_qa_4/task.toml b/tasks/0121_046_121046676_qa_4/task.toml index f521b13fd8171b2ba1c204dcd845f798806a50f2..ea1337c5b2a588de2aacdade1a6242c005596371 100644 --- a/tasks/0121_046_121046676_qa_4/task.toml +++ b/tasks/0121_046_121046676_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_095_121095784_qa_1/environment/bootstrap.sh b/tasks/0121_095_121095784_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_095_121095784_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_095_121095784_qa_1/environment/pull_bucket.py b/tasks/0121_095_121095784_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_095_121095784_qa_1/environment/pull_bucket.py +++ b/tasks/0121_095_121095784_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_095_121095784_qa_1/task.toml b/tasks/0121_095_121095784_qa_1/task.toml index 9741f5747a82a04359a22b0d13faa6c43627cc4b..2b416761d75ff66bd15abd8f8cfae9fa9c9ca06a 100644 --- a/tasks/0121_095_121095784_qa_1/task.toml +++ b/tasks/0121_095_121095784_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_095_121095784_qa_3/environment/bootstrap.sh b/tasks/0121_095_121095784_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_095_121095784_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_095_121095784_qa_3/environment/pull_bucket.py b/tasks/0121_095_121095784_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_095_121095784_qa_3/environment/pull_bucket.py +++ b/tasks/0121_095_121095784_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_095_121095784_qa_3/task.toml b/tasks/0121_095_121095784_qa_3/task.toml index 4211de4d58a40502c0531b1bff97389e90e5132e..6a33ed934f0a536b21b081b138359519650faebc 100644 --- a/tasks/0121_095_121095784_qa_3/task.toml +++ b/tasks/0121_095_121095784_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_112_121112789_qa_3/environment/bootstrap.sh b/tasks/0121_112_121112789_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_112_121112789_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_112_121112789_qa_3/environment/pull_bucket.py b/tasks/0121_112_121112789_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_112_121112789_qa_3/environment/pull_bucket.py +++ b/tasks/0121_112_121112789_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_112_121112789_qa_3/task.toml b/tasks/0121_112_121112789_qa_3/task.toml index 0a77849fc35e7c07d972b117d2c795412da08f50..d5b1ff512d41bbc837ec51edf10de5ad3e6abfeb 100644 --- a/tasks/0121_112_121112789_qa_3/task.toml +++ b/tasks/0121_112_121112789_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_112_121112789_qa_4/environment/bootstrap.sh b/tasks/0121_112_121112789_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_112_121112789_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_112_121112789_qa_4/environment/pull_bucket.py b/tasks/0121_112_121112789_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_112_121112789_qa_4/environment/pull_bucket.py +++ b/tasks/0121_112_121112789_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_112_121112789_qa_4/task.toml b/tasks/0121_112_121112789_qa_4/task.toml index 0feeb91441c0b7c466f8c9b40c58e1a5f0633946..9a90508f5dd403243c8df75a5e59c319bd39083e 100644 --- a/tasks/0121_112_121112789_qa_4/task.toml +++ b/tasks/0121_112_121112789_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_113_121113393_qa_2/environment/bootstrap.sh b/tasks/0121_113_121113393_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_113_121113393_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_113_121113393_qa_2/environment/pull_bucket.py b/tasks/0121_113_121113393_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_113_121113393_qa_2/environment/pull_bucket.py +++ b/tasks/0121_113_121113393_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_113_121113393_qa_2/task.toml b/tasks/0121_113_121113393_qa_2/task.toml index b5845be725b5859c7e2377ee161e198c4ab8bc84..0e6310699514aa7f321bd3e180d111b8fe620281 100644 --- a/tasks/0121_113_121113393_qa_2/task.toml +++ b/tasks/0121_113_121113393_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_143_121143084_qa_3/environment/bootstrap.sh b/tasks/0121_143_121143084_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_143_121143084_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_143_121143084_qa_3/environment/pull_bucket.py b/tasks/0121_143_121143084_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_143_121143084_qa_3/environment/pull_bucket.py +++ b/tasks/0121_143_121143084_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_143_121143084_qa_3/task.toml b/tasks/0121_143_121143084_qa_3/task.toml index 6ded33acdd5777a51ca8ee66b8e63a0e5cff623c..e112ebb534f6f05663dd370377417dd15404e69d 100644 --- a/tasks/0121_143_121143084_qa_3/task.toml +++ b/tasks/0121_143_121143084_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_209_121209389_qa_1/environment/bootstrap.sh b/tasks/0121_209_121209389_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_209_121209389_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_209_121209389_qa_1/environment/pull_bucket.py b/tasks/0121_209_121209389_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_209_121209389_qa_1/environment/pull_bucket.py +++ b/tasks/0121_209_121209389_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_209_121209389_qa_1/task.toml b/tasks/0121_209_121209389_qa_1/task.toml index 1f2ef54328fe50f78c04318f01641d2458e4cb0e..b94bf8cfc0d7ef92424cdbd4be4cccee2f1ed027 100644 --- a/tasks/0121_209_121209389_qa_1/task.toml +++ b/tasks/0121_209_121209389_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_209_121209389_qa_2/environment/bootstrap.sh b/tasks/0121_209_121209389_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_209_121209389_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_209_121209389_qa_2/environment/pull_bucket.py b/tasks/0121_209_121209389_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_209_121209389_qa_2/environment/pull_bucket.py +++ b/tasks/0121_209_121209389_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_209_121209389_qa_2/task.toml b/tasks/0121_209_121209389_qa_2/task.toml index a15df7e1e5e02a34729c5a72435e94a0a0227e61..cbd9d4a682283d81e938b3685aa82a21a8f46a14 100644 --- a/tasks/0121_209_121209389_qa_2/task.toml +++ b/tasks/0121_209_121209389_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_319_121319744_qa_1/environment/bootstrap.sh b/tasks/0121_319_121319744_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_319_121319744_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_319_121319744_qa_1/environment/pull_bucket.py b/tasks/0121_319_121319744_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_319_121319744_qa_1/environment/pull_bucket.py +++ b/tasks/0121_319_121319744_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_319_121319744_qa_1/task.toml b/tasks/0121_319_121319744_qa_1/task.toml index 91e699df980fb29d4ec628005b8d91410e95de3c..cade6c38a3c13bcec6ab2f55e6dae34b6e5a0c27 100644 --- a/tasks/0121_319_121319744_qa_1/task.toml +++ b/tasks/0121_319_121319744_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_340_121340014_qa_2/environment/bootstrap.sh b/tasks/0121_340_121340014_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_340_121340014_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_340_121340014_qa_2/environment/pull_bucket.py b/tasks/0121_340_121340014_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_340_121340014_qa_2/environment/pull_bucket.py +++ b/tasks/0121_340_121340014_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_340_121340014_qa_2/task.toml b/tasks/0121_340_121340014_qa_2/task.toml index 248f1971aefa365b41f1ffda7c2ec0cf95fb58ad..3cd882d0913a58574723388ec3ea40ee554f735e 100644 --- a/tasks/0121_340_121340014_qa_2/task.toml +++ b/tasks/0121_340_121340014_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_361_121361496_qa_3/environment/bootstrap.sh b/tasks/0121_361_121361496_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_361_121361496_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_361_121361496_qa_3/environment/pull_bucket.py b/tasks/0121_361_121361496_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_361_121361496_qa_3/environment/pull_bucket.py +++ b/tasks/0121_361_121361496_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_361_121361496_qa_3/task.toml b/tasks/0121_361_121361496_qa_3/task.toml index dd413c076e27e1ceb288a9e91cf8bbd45cb5dbc3..571394910fdba1398626df8d2e486f3d4e5d9610 100644 --- a/tasks/0121_361_121361496_qa_3/task.toml +++ b/tasks/0121_361_121361496_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_366_121366198_qa_4/environment/bootstrap.sh b/tasks/0121_366_121366198_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_366_121366198_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_366_121366198_qa_4/environment/pull_bucket.py b/tasks/0121_366_121366198_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_366_121366198_qa_4/environment/pull_bucket.py +++ b/tasks/0121_366_121366198_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_366_121366198_qa_4/task.toml b/tasks/0121_366_121366198_qa_4/task.toml index 72e52e13526cce975324d9de3f3d887246b8d9a1..0d44d85825f95a188a743d6119beaac6896658cc 100644 --- a/tasks/0121_366_121366198_qa_4/task.toml +++ b/tasks/0121_366_121366198_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_396_121396365_qa_2/environment/bootstrap.sh b/tasks/0121_396_121396365_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_396_121396365_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_396_121396365_qa_2/environment/pull_bucket.py b/tasks/0121_396_121396365_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_396_121396365_qa_2/environment/pull_bucket.py +++ b/tasks/0121_396_121396365_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_396_121396365_qa_2/task.toml b/tasks/0121_396_121396365_qa_2/task.toml index 1e86ad9ba051852b5b9f8cdb168b1a849860e68a..1c9136c9437e680ae49db6232020ff43bf7d126d 100644 --- a/tasks/0121_396_121396365_qa_2/task.toml +++ b/tasks/0121_396_121396365_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_396_121396730_qa_4/environment/bootstrap.sh b/tasks/0121_396_121396730_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_396_121396730_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_396_121396730_qa_4/environment/pull_bucket.py b/tasks/0121_396_121396730_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_396_121396730_qa_4/environment/pull_bucket.py +++ b/tasks/0121_396_121396730_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_396_121396730_qa_4/task.toml b/tasks/0121_396_121396730_qa_4/task.toml index 7a57694a3231e708d3ed1f68e6f9974a74f46a27..6a45bc713dee457d6a6c0489db6cdcab5b1afe8b 100644 --- a/tasks/0121_396_121396730_qa_4/task.toml +++ b/tasks/0121_396_121396730_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_396_121396730_qa_5/environment/bootstrap.sh b/tasks/0121_396_121396730_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_396_121396730_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_396_121396730_qa_5/environment/pull_bucket.py b/tasks/0121_396_121396730_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_396_121396730_qa_5/environment/pull_bucket.py +++ b/tasks/0121_396_121396730_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_396_121396730_qa_5/task.toml b/tasks/0121_396_121396730_qa_5/task.toml index 9ce1d2be9722670435a98ecb703c6e47314e11fe..93c2b9efe697d2cbc75aab5499bf81636a74cc38 100644 --- a/tasks/0121_396_121396730_qa_5/task.toml +++ b/tasks/0121_396_121396730_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_468_121468055_qa_4/environment/bootstrap.sh b/tasks/0121_468_121468055_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_468_121468055_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_468_121468055_qa_4/environment/pull_bucket.py b/tasks/0121_468_121468055_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_468_121468055_qa_4/environment/pull_bucket.py +++ b/tasks/0121_468_121468055_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_468_121468055_qa_4/task.toml b/tasks/0121_468_121468055_qa_4/task.toml index b86595d7ccc37424596101ae4d9173c5e67738b4..70145bf949266f6a9977b81913cb70ecf2078ba3 100644 --- a/tasks/0121_468_121468055_qa_4/task.toml +++ b/tasks/0121_468_121468055_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_521_121521712_qa_1/environment/bootstrap.sh b/tasks/0121_521_121521712_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_521_121521712_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_521_121521712_qa_1/environment/pull_bucket.py b/tasks/0121_521_121521712_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_521_121521712_qa_1/environment/pull_bucket.py +++ b/tasks/0121_521_121521712_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_521_121521712_qa_1/task.toml b/tasks/0121_521_121521712_qa_1/task.toml index 4883c8ee4f44e6f033f76cf5c0a64762a85c386c..6d8a5d3ae7affc4ef22091584404edc29207edc6 100644 --- a/tasks/0121_521_121521712_qa_1/task.toml +++ b/tasks/0121_521_121521712_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_588_121588240_qa_1/environment/bootstrap.sh b/tasks/0121_588_121588240_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_588_121588240_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_588_121588240_qa_1/environment/pull_bucket.py b/tasks/0121_588_121588240_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_588_121588240_qa_1/environment/pull_bucket.py +++ b/tasks/0121_588_121588240_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_588_121588240_qa_1/task.toml b/tasks/0121_588_121588240_qa_1/task.toml index ccc61a1ff0ca1f15254e481c5ab5a4e9cb6583cc..e02450b7fc2aac70cc2c87b5391f6b7146c6e7ac 100644 --- a/tasks/0121_588_121588240_qa_1/task.toml +++ b/tasks/0121_588_121588240_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_588_121588240_qa_2/environment/bootstrap.sh b/tasks/0121_588_121588240_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_588_121588240_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_588_121588240_qa_2/environment/pull_bucket.py b/tasks/0121_588_121588240_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_588_121588240_qa_2/environment/pull_bucket.py +++ b/tasks/0121_588_121588240_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_588_121588240_qa_2/task.toml b/tasks/0121_588_121588240_qa_2/task.toml index b9889cc5c69cd736368e1bf265c83c58f1f07398..dbeb5df032808cf3477bd4ca6ab728b29f8be951 100644 --- a/tasks/0121_588_121588240_qa_2/task.toml +++ b/tasks/0121_588_121588240_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_603_121603419_qa_1/environment/bootstrap.sh b/tasks/0121_603_121603419_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_603_121603419_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_603_121603419_qa_1/environment/pull_bucket.py b/tasks/0121_603_121603419_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_603_121603419_qa_1/environment/pull_bucket.py +++ b/tasks/0121_603_121603419_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_603_121603419_qa_1/task.toml b/tasks/0121_603_121603419_qa_1/task.toml index 84f6d30976454df205f53207b0ed99a9881e7f53..eee96a5a0375a166539c9441b24072722e320223 100644 --- a/tasks/0121_603_121603419_qa_1/task.toml +++ b/tasks/0121_603_121603419_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_603_121603419_qa_3/environment/bootstrap.sh b/tasks/0121_603_121603419_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_603_121603419_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_603_121603419_qa_3/environment/pull_bucket.py b/tasks/0121_603_121603419_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_603_121603419_qa_3/environment/pull_bucket.py +++ b/tasks/0121_603_121603419_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_603_121603419_qa_3/task.toml b/tasks/0121_603_121603419_qa_3/task.toml index e7f1bda687ea6b8695c53d00b3940ffc158e71de..37acc58ed4577fb893d02fba3b15bb19a17c591c 100644 --- a/tasks/0121_603_121603419_qa_3/task.toml +++ b/tasks/0121_603_121603419_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_684_121684737_qa_1/environment/bootstrap.sh b/tasks/0121_684_121684737_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_684_121684737_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_684_121684737_qa_1/environment/pull_bucket.py b/tasks/0121_684_121684737_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_684_121684737_qa_1/environment/pull_bucket.py +++ b/tasks/0121_684_121684737_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_684_121684737_qa_1/task.toml b/tasks/0121_684_121684737_qa_1/task.toml index 7f279cb0f71268028094e1f9cff998227c1a2b72..b1dbefa4d77ac5293f0112f9734fb88a39fb9946 100644 --- a/tasks/0121_684_121684737_qa_1/task.toml +++ b/tasks/0121_684_121684737_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_736_121736095_qa_2/environment/bootstrap.sh b/tasks/0121_736_121736095_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_736_121736095_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_736_121736095_qa_2/environment/pull_bucket.py b/tasks/0121_736_121736095_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_736_121736095_qa_2/environment/pull_bucket.py +++ b/tasks/0121_736_121736095_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_736_121736095_qa_2/task.toml b/tasks/0121_736_121736095_qa_2/task.toml index 46a3b1695e0151344d2893eba986623416889080..f9bcd14fdef95c72d19cf5a62a6ac276c0001acb 100644 --- a/tasks/0121_736_121736095_qa_2/task.toml +++ b/tasks/0121_736_121736095_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_736_121736095_qa_4/environment/bootstrap.sh b/tasks/0121_736_121736095_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_736_121736095_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_736_121736095_qa_4/environment/pull_bucket.py b/tasks/0121_736_121736095_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_736_121736095_qa_4/environment/pull_bucket.py +++ b/tasks/0121_736_121736095_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_736_121736095_qa_4/task.toml b/tasks/0121_736_121736095_qa_4/task.toml index f954db82181725d07610e0d3e119f5fab15f1fac..a0ae555d080ec7415b4b4c521b2726748842dd0b 100644 --- a/tasks/0121_736_121736095_qa_4/task.toml +++ b/tasks/0121_736_121736095_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_738_121738149_qa_3/environment/bootstrap.sh b/tasks/0121_738_121738149_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_738_121738149_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_738_121738149_qa_3/environment/pull_bucket.py b/tasks/0121_738_121738149_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_738_121738149_qa_3/environment/pull_bucket.py +++ b/tasks/0121_738_121738149_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_738_121738149_qa_3/task.toml b/tasks/0121_738_121738149_qa_3/task.toml index dfef572a82aa2126e37a4c3ae127cccda1edda23..55ad481cfb881eeabfaf5696cbe7b4fa01c4895d 100644 --- a/tasks/0121_738_121738149_qa_3/task.toml +++ b/tasks/0121_738_121738149_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_738_121738149_qa_4/environment/bootstrap.sh b/tasks/0121_738_121738149_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_738_121738149_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_738_121738149_qa_4/environment/pull_bucket.py b/tasks/0121_738_121738149_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_738_121738149_qa_4/environment/pull_bucket.py +++ b/tasks/0121_738_121738149_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_738_121738149_qa_4/task.toml b/tasks/0121_738_121738149_qa_4/task.toml index 12a5319bdb74357142e71d6d25082afbf26185e4..2734916d04e36c62b4f2acf4579040ea53a16931 100644 --- a/tasks/0121_738_121738149_qa_4/task.toml +++ b/tasks/0121_738_121738149_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_738_121738149_qa_5/environment/bootstrap.sh b/tasks/0121_738_121738149_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_738_121738149_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_738_121738149_qa_5/environment/pull_bucket.py b/tasks/0121_738_121738149_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_738_121738149_qa_5/environment/pull_bucket.py +++ b/tasks/0121_738_121738149_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_738_121738149_qa_5/task.toml b/tasks/0121_738_121738149_qa_5/task.toml index ad0480cd514d0d9230367c08f15fad9fd7a33d89..b3c0587506f9aaffad8be8e26dfc1d0c585bf174 100644 --- a/tasks/0121_738_121738149_qa_5/task.toml +++ b/tasks/0121_738_121738149_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_801_121801511_qa_3/environment/bootstrap.sh b/tasks/0121_801_121801511_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_801_121801511_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_801_121801511_qa_3/environment/pull_bucket.py b/tasks/0121_801_121801511_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_801_121801511_qa_3/environment/pull_bucket.py +++ b/tasks/0121_801_121801511_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_801_121801511_qa_3/task.toml b/tasks/0121_801_121801511_qa_3/task.toml index c9dd59574fbd7321af1fa3b619a4d8348bc9d1c3..302774131eeb6a06bce70c2c0103d9c65642cc68 100644 --- a/tasks/0121_801_121801511_qa_3/task.toml +++ b/tasks/0121_801_121801511_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_801_121801511_qa_4/environment/bootstrap.sh b/tasks/0121_801_121801511_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_801_121801511_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_801_121801511_qa_4/environment/pull_bucket.py b/tasks/0121_801_121801511_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_801_121801511_qa_4/environment/pull_bucket.py +++ b/tasks/0121_801_121801511_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_801_121801511_qa_4/task.toml b/tasks/0121_801_121801511_qa_4/task.toml index f1b5c4173e757a957d87764c95a6ccac89578384..d3c831e4792ff8058e9e30257c73b9a216e1e320 100644 --- a/tasks/0121_801_121801511_qa_4/task.toml +++ b/tasks/0121_801_121801511_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_823_121823327_qa_4/environment/bootstrap.sh b/tasks/0121_823_121823327_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_823_121823327_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_823_121823327_qa_4/environment/pull_bucket.py b/tasks/0121_823_121823327_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_823_121823327_qa_4/environment/pull_bucket.py +++ b/tasks/0121_823_121823327_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_823_121823327_qa_4/task.toml b/tasks/0121_823_121823327_qa_4/task.toml index 79923d05d7c03cd00d501ca06bf3b8ad3685478b..9cb0e7973fd377bb99d1b4690849c8086cd1899c 100644 --- a/tasks/0121_823_121823327_qa_4/task.toml +++ b/tasks/0121_823_121823327_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_834_121834892_qa_2/environment/bootstrap.sh b/tasks/0121_834_121834892_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_834_121834892_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_834_121834892_qa_2/environment/pull_bucket.py b/tasks/0121_834_121834892_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_834_121834892_qa_2/environment/pull_bucket.py +++ b/tasks/0121_834_121834892_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_834_121834892_qa_2/task.toml b/tasks/0121_834_121834892_qa_2/task.toml index f218dad6b08086c46c075feb83309627d7149b4c..8b66e6c1405216db810ced9c249175e202a79d86 100644 --- a/tasks/0121_834_121834892_qa_2/task.toml +++ b/tasks/0121_834_121834892_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_834_121834892_qa_4/environment/bootstrap.sh b/tasks/0121_834_121834892_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_834_121834892_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_834_121834892_qa_4/environment/pull_bucket.py b/tasks/0121_834_121834892_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_834_121834892_qa_4/environment/pull_bucket.py +++ b/tasks/0121_834_121834892_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_834_121834892_qa_4/task.toml b/tasks/0121_834_121834892_qa_4/task.toml index c1f88ab029c634452ee11789cc653e0c16a7913a..81c24b3d09674e4f36e23f54f3ad8ad8279576f6 100644 --- a/tasks/0121_834_121834892_qa_4/task.toml +++ b/tasks/0121_834_121834892_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_895_121895900_qa_2/environment/bootstrap.sh b/tasks/0121_895_121895900_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_895_121895900_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_895_121895900_qa_2/environment/pull_bucket.py b/tasks/0121_895_121895900_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_895_121895900_qa_2/environment/pull_bucket.py +++ b/tasks/0121_895_121895900_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_895_121895900_qa_2/task.toml b/tasks/0121_895_121895900_qa_2/task.toml index 7344e557504c3161e3141b3bac594d8817da0610..c3f60e61b3e0284ff2fa352882a13a56deb38e2d 100644 --- a/tasks/0121_895_121895900_qa_2/task.toml +++ b/tasks/0121_895_121895900_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_896_121896638_qa_2/environment/bootstrap.sh b/tasks/0121_896_121896638_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_896_121896638_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_896_121896638_qa_2/environment/pull_bucket.py b/tasks/0121_896_121896638_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_896_121896638_qa_2/environment/pull_bucket.py +++ b/tasks/0121_896_121896638_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_896_121896638_qa_2/task.toml b/tasks/0121_896_121896638_qa_2/task.toml index 305ac314a3a2ec1d8319e67a6026dd59e01daabb..30692f18c8a56c651ba760fb14b73637ba2c4daa 100644 --- a/tasks/0121_896_121896638_qa_2/task.toml +++ b/tasks/0121_896_121896638_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_908_121908423_qa_2/environment/bootstrap.sh b/tasks/0121_908_121908423_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_908_121908423_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_908_121908423_qa_2/environment/pull_bucket.py b/tasks/0121_908_121908423_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_908_121908423_qa_2/environment/pull_bucket.py +++ b/tasks/0121_908_121908423_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_908_121908423_qa_2/task.toml b/tasks/0121_908_121908423_qa_2/task.toml index 2633a907cb1124f019122b57791c6476e3c68121..ee37f5460aecd9ab9adfa9e2d2df7ec6c9ffb51a 100644 --- a/tasks/0121_908_121908423_qa_2/task.toml +++ b/tasks/0121_908_121908423_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_947_121947601_qa_1/environment/bootstrap.sh b/tasks/0121_947_121947601_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_947_121947601_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_947_121947601_qa_1/environment/pull_bucket.py b/tasks/0121_947_121947601_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_947_121947601_qa_1/environment/pull_bucket.py +++ b/tasks/0121_947_121947601_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_947_121947601_qa_1/task.toml b/tasks/0121_947_121947601_qa_1/task.toml index b5418421cb10ff16532001cf99b79a50af5fc224..f7e345d6aee0f7557fcc7ce63ab060d97d8de565 100644 --- a/tasks/0121_947_121947601_qa_1/task.toml +++ b/tasks/0121_947_121947601_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_966_121966267_qa_1/environment/bootstrap.sh b/tasks/0121_966_121966267_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_966_121966267_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_966_121966267_qa_1/environment/pull_bucket.py b/tasks/0121_966_121966267_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_966_121966267_qa_1/environment/pull_bucket.py +++ b/tasks/0121_966_121966267_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_966_121966267_qa_1/task.toml b/tasks/0121_966_121966267_qa_1/task.toml index 5996035e513d6f5ab86fe3d0a485f8b261b48a5b..1922dba71cd353830f0f6e72b6ba7624a3f87b1c 100644 --- a/tasks/0121_966_121966267_qa_1/task.toml +++ b/tasks/0121_966_121966267_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_988_121988886_qa_5/environment/bootstrap.sh b/tasks/0121_988_121988886_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_988_121988886_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_988_121988886_qa_5/environment/pull_bucket.py b/tasks/0121_988_121988886_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_988_121988886_qa_5/environment/pull_bucket.py +++ b/tasks/0121_988_121988886_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_988_121988886_qa_5/task.toml b/tasks/0121_988_121988886_qa_5/task.toml index 22217b39f12be5f072faa2ad7da5e047c9d2c95b..4dbdce5570e3bba1796234ece2043a4ad6e44ba5 100644 --- a/tasks/0121_988_121988886_qa_5/task.toml +++ b/tasks/0121_988_121988886_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0121_991_121991314_qa_5/environment/bootstrap.sh b/tasks/0121_991_121991314_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0121_991_121991314_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0121_991_121991314_qa_5/environment/pull_bucket.py b/tasks/0121_991_121991314_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0121_991_121991314_qa_5/environment/pull_bucket.py +++ b/tasks/0121_991_121991314_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0121_991_121991314_qa_5/task.toml b/tasks/0121_991_121991314_qa_5/task.toml index 60a754aadfe514f8e9b6d6d2a3653382b61e74f7..e4298bfb0a9292c2009bf6995ace21c7ca54ccb8 100644 --- a/tasks/0121_991_121991314_qa_5/task.toml +++ b/tasks/0121_991_121991314_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_011_122011050_qa_1/environment/bootstrap.sh b/tasks/0122_011_122011050_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_011_122011050_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_011_122011050_qa_1/environment/pull_bucket.py b/tasks/0122_011_122011050_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_011_122011050_qa_1/environment/pull_bucket.py +++ b/tasks/0122_011_122011050_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_011_122011050_qa_1/task.toml b/tasks/0122_011_122011050_qa_1/task.toml index dd018acca64e054cae644c7ff503f0a0d63db2c9..5bee5eb0897d33ebff40b843138cc29a188d86c7 100644 --- a/tasks/0122_011_122011050_qa_1/task.toml +++ b/tasks/0122_011_122011050_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_011_122011050_qa_3/environment/bootstrap.sh b/tasks/0122_011_122011050_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_011_122011050_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_011_122011050_qa_3/environment/pull_bucket.py b/tasks/0122_011_122011050_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_011_122011050_qa_3/environment/pull_bucket.py +++ b/tasks/0122_011_122011050_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_011_122011050_qa_3/task.toml b/tasks/0122_011_122011050_qa_3/task.toml index 6d4192a938e3e9e547c8f30c9db20dc5ce8d4bd0..75b2a3aa236151c220191adf5b4f1f43f87f29fd 100644 --- a/tasks/0122_011_122011050_qa_3/task.toml +++ b/tasks/0122_011_122011050_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_011_122011050_qa_4/environment/bootstrap.sh b/tasks/0122_011_122011050_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_011_122011050_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_011_122011050_qa_4/environment/pull_bucket.py b/tasks/0122_011_122011050_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_011_122011050_qa_4/environment/pull_bucket.py +++ b/tasks/0122_011_122011050_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_011_122011050_qa_4/task.toml b/tasks/0122_011_122011050_qa_4/task.toml index b878e4e652837746625393fa43497531b0eeb078..e9a0f1b393c107f3ca2db65535b0d2ed2d48a712 100644 --- a/tasks/0122_011_122011050_qa_4/task.toml +++ b/tasks/0122_011_122011050_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_097_122097207_qa_1/environment/bootstrap.sh b/tasks/0122_097_122097207_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_097_122097207_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_097_122097207_qa_1/environment/pull_bucket.py b/tasks/0122_097_122097207_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_097_122097207_qa_1/environment/pull_bucket.py +++ b/tasks/0122_097_122097207_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_097_122097207_qa_1/task.toml b/tasks/0122_097_122097207_qa_1/task.toml index 1c3666fbe6828bb53e79cc043bef26864ad0993f..4c3812679ecb2c5bfae04ce9340303169f360da3 100644 --- a/tasks/0122_097_122097207_qa_1/task.toml +++ b/tasks/0122_097_122097207_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_097_122097207_qa_3/environment/bootstrap.sh b/tasks/0122_097_122097207_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_097_122097207_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_097_122097207_qa_3/environment/pull_bucket.py b/tasks/0122_097_122097207_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_097_122097207_qa_3/environment/pull_bucket.py +++ b/tasks/0122_097_122097207_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_097_122097207_qa_3/task.toml b/tasks/0122_097_122097207_qa_3/task.toml index 9593fe477955fd23c11493c2947ec68e1ae3f582..81cf6d11e15dd7af84e89431622dfafb752918f6 100644 --- a/tasks/0122_097_122097207_qa_3/task.toml +++ b/tasks/0122_097_122097207_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_097_122097207_qa_5/environment/bootstrap.sh b/tasks/0122_097_122097207_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_097_122097207_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_097_122097207_qa_5/environment/pull_bucket.py b/tasks/0122_097_122097207_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_097_122097207_qa_5/environment/pull_bucket.py +++ b/tasks/0122_097_122097207_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_097_122097207_qa_5/task.toml b/tasks/0122_097_122097207_qa_5/task.toml index 4ce3d2a4b00c1792a74403553ec0f768b0bd71d7..7276f72e3951ccba052f85f0ae19b17f9e6979a7 100644 --- a/tasks/0122_097_122097207_qa_5/task.toml +++ b/tasks/0122_097_122097207_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_143_122143760_qa_1/environment/bootstrap.sh b/tasks/0122_143_122143760_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_143_122143760_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_143_122143760_qa_1/environment/pull_bucket.py b/tasks/0122_143_122143760_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_143_122143760_qa_1/environment/pull_bucket.py +++ b/tasks/0122_143_122143760_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_143_122143760_qa_1/task.toml b/tasks/0122_143_122143760_qa_1/task.toml index 3b6217ea50f7805b800114f925f078f6b1bda6c3..52109cf880f2f9c81d53e1758144cf8444a96b59 100644 --- a/tasks/0122_143_122143760_qa_1/task.toml +++ b/tasks/0122_143_122143760_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_335_122335546_qa_1/environment/bootstrap.sh b/tasks/0122_335_122335546_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_335_122335546_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_335_122335546_qa_1/environment/pull_bucket.py b/tasks/0122_335_122335546_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_335_122335546_qa_1/environment/pull_bucket.py +++ b/tasks/0122_335_122335546_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_335_122335546_qa_1/task.toml b/tasks/0122_335_122335546_qa_1/task.toml index bed92780b6d333fb2cb3cbc4797e4b45b86a0cde..52508468e4f392fd19c298d1a644fa2e96f09baa 100644 --- a/tasks/0122_335_122335546_qa_1/task.toml +++ b/tasks/0122_335_122335546_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_356_122356261_qa_1/environment/bootstrap.sh b/tasks/0122_356_122356261_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_356_122356261_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_356_122356261_qa_1/environment/pull_bucket.py b/tasks/0122_356_122356261_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_356_122356261_qa_1/environment/pull_bucket.py +++ b/tasks/0122_356_122356261_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_356_122356261_qa_1/task.toml b/tasks/0122_356_122356261_qa_1/task.toml index 32286daf430492624d25ea4caeb9f42a5cd4a7b0..6909b7158e03d6987f93343a53c0f0afe6064928 100644 --- a/tasks/0122_356_122356261_qa_1/task.toml +++ b/tasks/0122_356_122356261_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_356_122356261_qa_2/environment/bootstrap.sh b/tasks/0122_356_122356261_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_356_122356261_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_356_122356261_qa_2/environment/pull_bucket.py b/tasks/0122_356_122356261_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_356_122356261_qa_2/environment/pull_bucket.py +++ b/tasks/0122_356_122356261_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_356_122356261_qa_2/task.toml b/tasks/0122_356_122356261_qa_2/task.toml index d5240eba5e8a3722978d08cb71ed7288b4032a10..fa1118d05ccf1eb7980c32a2bf8208a434b7a844 100644 --- a/tasks/0122_356_122356261_qa_2/task.toml +++ b/tasks/0122_356_122356261_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_365_122365059_qa_2/environment/bootstrap.sh b/tasks/0122_365_122365059_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_365_122365059_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_365_122365059_qa_2/environment/pull_bucket.py b/tasks/0122_365_122365059_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_365_122365059_qa_2/environment/pull_bucket.py +++ b/tasks/0122_365_122365059_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_365_122365059_qa_2/task.toml b/tasks/0122_365_122365059_qa_2/task.toml index 104b38801b9e8cac3568590da44ce2e63478465e..cfe2bc22388a7ebc836ab8a65350c9f8ecaf0468 100644 --- a/tasks/0122_365_122365059_qa_2/task.toml +++ b/tasks/0122_365_122365059_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_365_122365059_qa_3/environment/bootstrap.sh b/tasks/0122_365_122365059_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_365_122365059_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_365_122365059_qa_3/environment/pull_bucket.py b/tasks/0122_365_122365059_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_365_122365059_qa_3/environment/pull_bucket.py +++ b/tasks/0122_365_122365059_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_365_122365059_qa_3/task.toml b/tasks/0122_365_122365059_qa_3/task.toml index 33d2a3f72124ca08564e31487e9cf172809a72b3..6fb7ef1547631331aa12d9ab8bf40b04214338c2 100644 --- a/tasks/0122_365_122365059_qa_3/task.toml +++ b/tasks/0122_365_122365059_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_365_122365414_qa_2/environment/bootstrap.sh b/tasks/0122_365_122365414_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_365_122365414_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_365_122365414_qa_2/environment/pull_bucket.py b/tasks/0122_365_122365414_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_365_122365414_qa_2/environment/pull_bucket.py +++ b/tasks/0122_365_122365414_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_365_122365414_qa_2/task.toml b/tasks/0122_365_122365414_qa_2/task.toml index 3bd1de8072b957bd04429e4e159d07ee8d1caed2..43afff01681b1cb4f9ac6c2d70b1f7c3e03b57ba 100644 --- a/tasks/0122_365_122365414_qa_2/task.toml +++ b/tasks/0122_365_122365414_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_390_122390551_qa_3/environment/bootstrap.sh b/tasks/0122_390_122390551_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_390_122390551_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_390_122390551_qa_3/environment/pull_bucket.py b/tasks/0122_390_122390551_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_390_122390551_qa_3/environment/pull_bucket.py +++ b/tasks/0122_390_122390551_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_390_122390551_qa_3/task.toml b/tasks/0122_390_122390551_qa_3/task.toml index 12fd02830df2c6204a144eb86c698e3906bd3281..1d8ad58931b4087a676f7e7764d9fa709c175a25 100644 --- a/tasks/0122_390_122390551_qa_3/task.toml +++ b/tasks/0122_390_122390551_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_390_122390551_qa_4/environment/bootstrap.sh b/tasks/0122_390_122390551_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_390_122390551_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_390_122390551_qa_4/environment/pull_bucket.py b/tasks/0122_390_122390551_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_390_122390551_qa_4/environment/pull_bucket.py +++ b/tasks/0122_390_122390551_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_390_122390551_qa_4/task.toml b/tasks/0122_390_122390551_qa_4/task.toml index ba75d9ea60a8d3540f004f33e05029073f2db5d0..c899cc8375af02844b422c37cbd0d1b6a3e9bad9 100644 --- a/tasks/0122_390_122390551_qa_4/task.toml +++ b/tasks/0122_390_122390551_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_394_122394666_qa_1/environment/bootstrap.sh b/tasks/0122_394_122394666_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_394_122394666_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_394_122394666_qa_1/environment/pull_bucket.py b/tasks/0122_394_122394666_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_394_122394666_qa_1/environment/pull_bucket.py +++ b/tasks/0122_394_122394666_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_394_122394666_qa_1/task.toml b/tasks/0122_394_122394666_qa_1/task.toml index 913151ad0968a578defca4da22e07d17ba85dca5..fdba1460cf2a0ceffb9edfe553adead43e604a67 100644 --- a/tasks/0122_394_122394666_qa_1/task.toml +++ b/tasks/0122_394_122394666_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_394_122394666_qa_2/environment/bootstrap.sh b/tasks/0122_394_122394666_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_394_122394666_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_394_122394666_qa_2/environment/pull_bucket.py b/tasks/0122_394_122394666_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_394_122394666_qa_2/environment/pull_bucket.py +++ b/tasks/0122_394_122394666_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_394_122394666_qa_2/task.toml b/tasks/0122_394_122394666_qa_2/task.toml index 573b970d9d567528a4fd8bd2f424b9054fa7c63d..f290c6c9e0d96bf92ed3150a123be054922d7e9d 100644 --- a/tasks/0122_394_122394666_qa_2/task.toml +++ b/tasks/0122_394_122394666_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_454_122454907_qa_1/environment/bootstrap.sh b/tasks/0122_454_122454907_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_454_122454907_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_454_122454907_qa_1/environment/pull_bucket.py b/tasks/0122_454_122454907_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_454_122454907_qa_1/environment/pull_bucket.py +++ b/tasks/0122_454_122454907_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_454_122454907_qa_1/task.toml b/tasks/0122_454_122454907_qa_1/task.toml index 14f77c776352532a9a1ddb07ee2a958456598a1e..3aed034c4aad73b08d233822e954f29f156ef64e 100644 --- a/tasks/0122_454_122454907_qa_1/task.toml +++ b/tasks/0122_454_122454907_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_481_122481302_qa_5/environment/bootstrap.sh b/tasks/0122_481_122481302_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_481_122481302_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_481_122481302_qa_5/environment/pull_bucket.py b/tasks/0122_481_122481302_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_481_122481302_qa_5/environment/pull_bucket.py +++ b/tasks/0122_481_122481302_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_481_122481302_qa_5/task.toml b/tasks/0122_481_122481302_qa_5/task.toml index 02375fe2ea66b15cd2ba913045934d1bc830cd91..c73b49b24c580dbc74bb9767569c161b3263c9a3 100644 --- a/tasks/0122_481_122481302_qa_5/task.toml +++ b/tasks/0122_481_122481302_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_502_122502688_qa_3/environment/bootstrap.sh b/tasks/0122_502_122502688_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_502_122502688_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_502_122502688_qa_3/environment/pull_bucket.py b/tasks/0122_502_122502688_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_502_122502688_qa_3/environment/pull_bucket.py +++ b/tasks/0122_502_122502688_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_502_122502688_qa_3/task.toml b/tasks/0122_502_122502688_qa_3/task.toml index e2a1ed854e5501a13058379255a68e7f6b62403a..d30b008bf15c658e0156bf8a9e4ca4f846617905 100644 --- a/tasks/0122_502_122502688_qa_3/task.toml +++ b/tasks/0122_502_122502688_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_517_122517438_qa_3/environment/bootstrap.sh b/tasks/0122_517_122517438_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_517_122517438_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_517_122517438_qa_3/environment/pull_bucket.py b/tasks/0122_517_122517438_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_517_122517438_qa_3/environment/pull_bucket.py +++ b/tasks/0122_517_122517438_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_517_122517438_qa_3/task.toml b/tasks/0122_517_122517438_qa_3/task.toml index 1b3c691238ef619d4fee8bf256560272fc40b120..95904f26fd5e86ec12d941717b048dab538feb97 100644 --- a/tasks/0122_517_122517438_qa_3/task.toml +++ b/tasks/0122_517_122517438_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_592_122592653_qa_2/environment/bootstrap.sh b/tasks/0122_592_122592653_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_592_122592653_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_592_122592653_qa_2/environment/pull_bucket.py b/tasks/0122_592_122592653_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_592_122592653_qa_2/environment/pull_bucket.py +++ b/tasks/0122_592_122592653_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_592_122592653_qa_2/task.toml b/tasks/0122_592_122592653_qa_2/task.toml index b8b6122c4d2b207842f441df8d018bed367e6e6a..59cadc53519753b34f9abc013dcea9a415e2a068 100644 --- a/tasks/0122_592_122592653_qa_2/task.toml +++ b/tasks/0122_592_122592653_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_604_122604169_qa_2/environment/bootstrap.sh b/tasks/0122_604_122604169_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_604_122604169_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_604_122604169_qa_2/environment/pull_bucket.py b/tasks/0122_604_122604169_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_604_122604169_qa_2/environment/pull_bucket.py +++ b/tasks/0122_604_122604169_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_604_122604169_qa_2/task.toml b/tasks/0122_604_122604169_qa_2/task.toml index 646654430393a4dfdc9ae8904c9165a467f35e84..2a12144809c6bbd14786e35cd70c58c46222d738 100644 --- a/tasks/0122_604_122604169_qa_2/task.toml +++ b/tasks/0122_604_122604169_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_669_122669772_qa_3/environment/bootstrap.sh b/tasks/0122_669_122669772_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_669_122669772_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_669_122669772_qa_3/environment/pull_bucket.py b/tasks/0122_669_122669772_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_669_122669772_qa_3/environment/pull_bucket.py +++ b/tasks/0122_669_122669772_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_669_122669772_qa_3/task.toml b/tasks/0122_669_122669772_qa_3/task.toml index c5cc51cb7eae045f41fe74b05382273563af08a0..1711528e7251cf9bd44814c3124a796fd4da69d9 100644 --- a/tasks/0122_669_122669772_qa_3/task.toml +++ b/tasks/0122_669_122669772_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_715_122715490_qa_1/environment/bootstrap.sh b/tasks/0122_715_122715490_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_715_122715490_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_715_122715490_qa_1/environment/pull_bucket.py b/tasks/0122_715_122715490_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_715_122715490_qa_1/environment/pull_bucket.py +++ b/tasks/0122_715_122715490_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_715_122715490_qa_1/task.toml b/tasks/0122_715_122715490_qa_1/task.toml index 531f17c46e9212871d4b4efbbb371413c5f2fafc..8bc084ccb9b37e56429e81701c82a95918f266d0 100644 --- a/tasks/0122_715_122715490_qa_1/task.toml +++ b/tasks/0122_715_122715490_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_715_122715490_qa_5/environment/bootstrap.sh b/tasks/0122_715_122715490_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_715_122715490_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_715_122715490_qa_5/environment/pull_bucket.py b/tasks/0122_715_122715490_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_715_122715490_qa_5/environment/pull_bucket.py +++ b/tasks/0122_715_122715490_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_715_122715490_qa_5/task.toml b/tasks/0122_715_122715490_qa_5/task.toml index f32d9391f09a45d895359f9f0b1412a24063b70e..8e45ceaef77873a03ba6a5985574db87a8e946e4 100644 --- a/tasks/0122_715_122715490_qa_5/task.toml +++ b/tasks/0122_715_122715490_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_770_122770918_qa_1/environment/bootstrap.sh b/tasks/0122_770_122770918_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_770_122770918_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_770_122770918_qa_1/environment/pull_bucket.py b/tasks/0122_770_122770918_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_770_122770918_qa_1/environment/pull_bucket.py +++ b/tasks/0122_770_122770918_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_770_122770918_qa_1/task.toml b/tasks/0122_770_122770918_qa_1/task.toml index cf211a47c92ca1fd2d6fd154639ab27033a9e487..4d252668086a8d6e63c3669a7b95abefde706515 100644 --- a/tasks/0122_770_122770918_qa_1/task.toml +++ b/tasks/0122_770_122770918_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_770_122770918_qa_4/environment/bootstrap.sh b/tasks/0122_770_122770918_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_770_122770918_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_770_122770918_qa_4/environment/pull_bucket.py b/tasks/0122_770_122770918_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_770_122770918_qa_4/environment/pull_bucket.py +++ b/tasks/0122_770_122770918_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_770_122770918_qa_4/task.toml b/tasks/0122_770_122770918_qa_4/task.toml index 3742e93c91edb2c8c634820995037f381f36f000..7580d868597059325a9b5620212d0cb87e41f9bf 100644 --- a/tasks/0122_770_122770918_qa_4/task.toml +++ b/tasks/0122_770_122770918_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_775_122775678_qa_5/environment/bootstrap.sh b/tasks/0122_775_122775678_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_775_122775678_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_775_122775678_qa_5/environment/pull_bucket.py b/tasks/0122_775_122775678_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_775_122775678_qa_5/environment/pull_bucket.py +++ b/tasks/0122_775_122775678_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_775_122775678_qa_5/task.toml b/tasks/0122_775_122775678_qa_5/task.toml index 91121ddffab47e16d9f10ab39792a3cb695e5973..865af7bcfb709dc89eddc697723595e8ebb42da0 100644 --- a/tasks/0122_775_122775678_qa_5/task.toml +++ b/tasks/0122_775_122775678_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_822_122822376_qa_1/environment/bootstrap.sh b/tasks/0122_822_122822376_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_822_122822376_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_822_122822376_qa_1/environment/pull_bucket.py b/tasks/0122_822_122822376_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_822_122822376_qa_1/environment/pull_bucket.py +++ b/tasks/0122_822_122822376_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_822_122822376_qa_1/task.toml b/tasks/0122_822_122822376_qa_1/task.toml index 6f6730cd28c16a470d5c86df53fa5cbc51bc21ca..21caa520dd293c82e140bef8fe1a9b2dabfb8009 100644 --- a/tasks/0122_822_122822376_qa_1/task.toml +++ b/tasks/0122_822_122822376_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_938_122938999_qa_1/environment/bootstrap.sh b/tasks/0122_938_122938999_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_938_122938999_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_938_122938999_qa_1/environment/pull_bucket.py b/tasks/0122_938_122938999_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_938_122938999_qa_1/environment/pull_bucket.py +++ b/tasks/0122_938_122938999_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_938_122938999_qa_1/task.toml b/tasks/0122_938_122938999_qa_1/task.toml index 86162f6b0ca823870a8621b1b76424369f758610..e9150af83dadca1fc694af6bc41ea824d7cfe430 100644 --- a/tasks/0122_938_122938999_qa_1/task.toml +++ b/tasks/0122_938_122938999_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0122_965_122965866_qa_5/environment/bootstrap.sh b/tasks/0122_965_122965866_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0122_965_122965866_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0122_965_122965866_qa_5/environment/pull_bucket.py b/tasks/0122_965_122965866_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0122_965_122965866_qa_5/environment/pull_bucket.py +++ b/tasks/0122_965_122965866_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0122_965_122965866_qa_5/task.toml b/tasks/0122_965_122965866_qa_5/task.toml index fcf6b8714477324929814c0a8468976edaffd0dc..3fc1ab48b839b3d783f8de257099664268457f7a 100644 --- a/tasks/0122_965_122965866_qa_5/task.toml +++ b/tasks/0122_965_122965866_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_030_123030462_qa_1/environment/bootstrap.sh b/tasks/0123_030_123030462_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_030_123030462_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_030_123030462_qa_1/environment/pull_bucket.py b/tasks/0123_030_123030462_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_030_123030462_qa_1/environment/pull_bucket.py +++ b/tasks/0123_030_123030462_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_030_123030462_qa_1/task.toml b/tasks/0123_030_123030462_qa_1/task.toml index 1dd26f6125ae0606f0aa037b2c18647580bceb69..20b9fdc10b9a4a673e2592143155fdc1ed046cc6 100644 --- a/tasks/0123_030_123030462_qa_1/task.toml +++ b/tasks/0123_030_123030462_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_030_123030462_qa_4/environment/bootstrap.sh b/tasks/0123_030_123030462_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_030_123030462_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_030_123030462_qa_4/environment/pull_bucket.py b/tasks/0123_030_123030462_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_030_123030462_qa_4/environment/pull_bucket.py +++ b/tasks/0123_030_123030462_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_030_123030462_qa_4/task.toml b/tasks/0123_030_123030462_qa_4/task.toml index dd3a2412f183fe53d9f2fa96f63774ce0af57ee9..1cddc8383038a7f6adc85fe731f670601c1a9b66 100644 --- a/tasks/0123_030_123030462_qa_4/task.toml +++ b/tasks/0123_030_123030462_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_042_123042543_qa_1/environment/bootstrap.sh b/tasks/0123_042_123042543_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_042_123042543_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_042_123042543_qa_1/environment/pull_bucket.py b/tasks/0123_042_123042543_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_042_123042543_qa_1/environment/pull_bucket.py +++ b/tasks/0123_042_123042543_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_042_123042543_qa_1/task.toml b/tasks/0123_042_123042543_qa_1/task.toml index 0a4cd395963e509ea21785f0309de1d36cec3f6d..c242048f415f4dc69f676e453ea72b7002c34b7f 100644 --- a/tasks/0123_042_123042543_qa_1/task.toml +++ b/tasks/0123_042_123042543_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_042_123042543_qa_3/environment/bootstrap.sh b/tasks/0123_042_123042543_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_042_123042543_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_042_123042543_qa_3/environment/pull_bucket.py b/tasks/0123_042_123042543_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_042_123042543_qa_3/environment/pull_bucket.py +++ b/tasks/0123_042_123042543_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_042_123042543_qa_3/task.toml b/tasks/0123_042_123042543_qa_3/task.toml index d6182b2c78c106ee203eecf26e77c3bd5dd41051..7675fd382d6b635493ba3409ddabfe7a38012dcc 100644 --- a/tasks/0123_042_123042543_qa_3/task.toml +++ b/tasks/0123_042_123042543_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_169_123169310_qa_3/environment/bootstrap.sh b/tasks/0123_169_123169310_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_169_123169310_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_169_123169310_qa_3/environment/pull_bucket.py b/tasks/0123_169_123169310_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_169_123169310_qa_3/environment/pull_bucket.py +++ b/tasks/0123_169_123169310_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_169_123169310_qa_3/task.toml b/tasks/0123_169_123169310_qa_3/task.toml index 0863a0917b7ff12e0f538f234d5cbdbbb5085d79..35abb83060dbef1b9d04c97e37f97f1049c0e71c 100644 --- a/tasks/0123_169_123169310_qa_3/task.toml +++ b/tasks/0123_169_123169310_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_214_123214023_qa_2/environment/bootstrap.sh b/tasks/0123_214_123214023_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_214_123214023_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_214_123214023_qa_2/environment/pull_bucket.py b/tasks/0123_214_123214023_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_214_123214023_qa_2/environment/pull_bucket.py +++ b/tasks/0123_214_123214023_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_214_123214023_qa_2/task.toml b/tasks/0123_214_123214023_qa_2/task.toml index d72917050916d341617179b2c02e73e6c11023a1..552d5606d7f6f132eb22e9e9bdea3c292c0a4772 100644 --- a/tasks/0123_214_123214023_qa_2/task.toml +++ b/tasks/0123_214_123214023_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_214_123214023_qa_5/environment/bootstrap.sh b/tasks/0123_214_123214023_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_214_123214023_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_214_123214023_qa_5/environment/pull_bucket.py b/tasks/0123_214_123214023_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_214_123214023_qa_5/environment/pull_bucket.py +++ b/tasks/0123_214_123214023_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_214_123214023_qa_5/task.toml b/tasks/0123_214_123214023_qa_5/task.toml index 5eb57fa1b733c5edb165c850eaa48a7ea3010cda..114ddd9b4ad42da7ee804eb41ce205e213670b6d 100644 --- a/tasks/0123_214_123214023_qa_5/task.toml +++ b/tasks/0123_214_123214023_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_217_123217664_qa_1/environment/bootstrap.sh b/tasks/0123_217_123217664_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_217_123217664_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_217_123217664_qa_1/environment/pull_bucket.py b/tasks/0123_217_123217664_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_217_123217664_qa_1/environment/pull_bucket.py +++ b/tasks/0123_217_123217664_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_217_123217664_qa_1/task.toml b/tasks/0123_217_123217664_qa_1/task.toml index 9fd54b13dba4437b77a9b73ec3d75067af7cce0c..3bc449c41e643467a38bdd5a8d4eb99c68d7b6ed 100644 --- a/tasks/0123_217_123217664_qa_1/task.toml +++ b/tasks/0123_217_123217664_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_217_123217664_qa_3/environment/bootstrap.sh b/tasks/0123_217_123217664_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_217_123217664_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_217_123217664_qa_3/environment/pull_bucket.py b/tasks/0123_217_123217664_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_217_123217664_qa_3/environment/pull_bucket.py +++ b/tasks/0123_217_123217664_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_217_123217664_qa_3/task.toml b/tasks/0123_217_123217664_qa_3/task.toml index 040e819ebcd67d10c7a95a3cb23f6911b13cce25..bfb3d9750b2bf63a3c7cf4143bf47e030734777b 100644 --- a/tasks/0123_217_123217664_qa_3/task.toml +++ b/tasks/0123_217_123217664_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_229_123229964_qa_3/environment/bootstrap.sh b/tasks/0123_229_123229964_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_229_123229964_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_229_123229964_qa_3/environment/pull_bucket.py b/tasks/0123_229_123229964_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_229_123229964_qa_3/environment/pull_bucket.py +++ b/tasks/0123_229_123229964_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_229_123229964_qa_3/task.toml b/tasks/0123_229_123229964_qa_3/task.toml index 8ca4754b24a99738e1fc57a28d407315d4926f7f..a5f316dfb64ab023719d2739adb7ab0c0f982e22 100644 --- a/tasks/0123_229_123229964_qa_3/task.toml +++ b/tasks/0123_229_123229964_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_284_123284662_qa_2/environment/bootstrap.sh b/tasks/0123_284_123284662_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_284_123284662_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_284_123284662_qa_2/environment/pull_bucket.py b/tasks/0123_284_123284662_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_284_123284662_qa_2/environment/pull_bucket.py +++ b/tasks/0123_284_123284662_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_284_123284662_qa_2/task.toml b/tasks/0123_284_123284662_qa_2/task.toml index 9c40498eefbbeca243ea7afea476ce32f63089d7..d6d530d3ba0ce7ece2bb2037e087078e23646e47 100644 --- a/tasks/0123_284_123284662_qa_2/task.toml +++ b/tasks/0123_284_123284662_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_343_123343619_qa_2/environment/bootstrap.sh b/tasks/0123_343_123343619_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_343_123343619_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_343_123343619_qa_2/environment/pull_bucket.py b/tasks/0123_343_123343619_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_343_123343619_qa_2/environment/pull_bucket.py +++ b/tasks/0123_343_123343619_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_343_123343619_qa_2/task.toml b/tasks/0123_343_123343619_qa_2/task.toml index 33003919a8d19f8d5fa5d04c99babb3635037b28..c2c0cb15ce36d616622e277ecde4e43e947f7bc4 100644 --- a/tasks/0123_343_123343619_qa_2/task.toml +++ b/tasks/0123_343_123343619_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_397_123397782_qa_1/environment/bootstrap.sh b/tasks/0123_397_123397782_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_397_123397782_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_397_123397782_qa_1/environment/pull_bucket.py b/tasks/0123_397_123397782_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_397_123397782_qa_1/environment/pull_bucket.py +++ b/tasks/0123_397_123397782_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_397_123397782_qa_1/task.toml b/tasks/0123_397_123397782_qa_1/task.toml index ef1506c12abfd8c01f5ca373d8b6e99b16e8bddd..ca3163667b90ea140c27cda3a2a3911b932c76fe 100644 --- a/tasks/0123_397_123397782_qa_1/task.toml +++ b/tasks/0123_397_123397782_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_452_123452071_qa_4/environment/bootstrap.sh b/tasks/0123_452_123452071_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_452_123452071_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_452_123452071_qa_4/environment/pull_bucket.py b/tasks/0123_452_123452071_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_452_123452071_qa_4/environment/pull_bucket.py +++ b/tasks/0123_452_123452071_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_452_123452071_qa_4/task.toml b/tasks/0123_452_123452071_qa_4/task.toml index 36572887a7520f022b6c73a566bb84e52a39d974..722b8b7da78d46b6a4de6db1519e20235518b2e2 100644 --- a/tasks/0123_452_123452071_qa_4/task.toml +++ b/tasks/0123_452_123452071_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_475_123475498_qa_1/environment/bootstrap.sh b/tasks/0123_475_123475498_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_475_123475498_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_475_123475498_qa_1/environment/pull_bucket.py b/tasks/0123_475_123475498_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_475_123475498_qa_1/environment/pull_bucket.py +++ b/tasks/0123_475_123475498_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_475_123475498_qa_1/task.toml b/tasks/0123_475_123475498_qa_1/task.toml index c7f9d16a2fdd1f8d5bddf59dee60c0aed4be61c5..f6ba16450535b0f58d1f2ebf42fcc953325a64e8 100644 --- a/tasks/0123_475_123475498_qa_1/task.toml +++ b/tasks/0123_475_123475498_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_494_123494250_qa_3/environment/bootstrap.sh b/tasks/0123_494_123494250_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_494_123494250_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_494_123494250_qa_3/environment/pull_bucket.py b/tasks/0123_494_123494250_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_494_123494250_qa_3/environment/pull_bucket.py +++ b/tasks/0123_494_123494250_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_494_123494250_qa_3/task.toml b/tasks/0123_494_123494250_qa_3/task.toml index 8f7012e4105fc6e8c444ca7f237d6f045ddb085a..85956363dcf45035a82771eab097e74541bf35cb 100644 --- a/tasks/0123_494_123494250_qa_3/task.toml +++ b/tasks/0123_494_123494250_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_494_123494250_qa_4/environment/bootstrap.sh b/tasks/0123_494_123494250_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_494_123494250_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_494_123494250_qa_4/environment/pull_bucket.py b/tasks/0123_494_123494250_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_494_123494250_qa_4/environment/pull_bucket.py +++ b/tasks/0123_494_123494250_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_494_123494250_qa_4/task.toml b/tasks/0123_494_123494250_qa_4/task.toml index 48c3a7a5838000312b8bcb7b82543207f71da779..6ac532bb51f41696b7fdf120826d9b7aa6309679 100644 --- a/tasks/0123_494_123494250_qa_4/task.toml +++ b/tasks/0123_494_123494250_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_500_123500011_qa_1/environment/bootstrap.sh b/tasks/0123_500_123500011_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_500_123500011_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_500_123500011_qa_1/environment/pull_bucket.py b/tasks/0123_500_123500011_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_500_123500011_qa_1/environment/pull_bucket.py +++ b/tasks/0123_500_123500011_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_500_123500011_qa_1/task.toml b/tasks/0123_500_123500011_qa_1/task.toml index 7e0f9d72cbefa0dc3e63c5ffdbc9cea44ff0ad4f..e4cee9672c320d31997ad156cd20697d3646d1e7 100644 --- a/tasks/0123_500_123500011_qa_1/task.toml +++ b/tasks/0123_500_123500011_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_500_123500011_qa_2/environment/bootstrap.sh b/tasks/0123_500_123500011_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_500_123500011_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_500_123500011_qa_2/environment/pull_bucket.py b/tasks/0123_500_123500011_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_500_123500011_qa_2/environment/pull_bucket.py +++ b/tasks/0123_500_123500011_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_500_123500011_qa_2/task.toml b/tasks/0123_500_123500011_qa_2/task.toml index 71d396e898856c064cf8b65ac4dd99daad0e352f..ef0296e6e5d3f41da327f08366c517d21fc2600a 100644 --- a/tasks/0123_500_123500011_qa_2/task.toml +++ b/tasks/0123_500_123500011_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_500_123500011_qa_3/environment/bootstrap.sh b/tasks/0123_500_123500011_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_500_123500011_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_500_123500011_qa_3/environment/pull_bucket.py b/tasks/0123_500_123500011_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_500_123500011_qa_3/environment/pull_bucket.py +++ b/tasks/0123_500_123500011_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_500_123500011_qa_3/task.toml b/tasks/0123_500_123500011_qa_3/task.toml index db36b625e0877b9fe627043fc1bd22ec473ab5be..ff3f0b1b13fc5001ff650f0324c21054c851f9fe 100644 --- a/tasks/0123_500_123500011_qa_3/task.toml +++ b/tasks/0123_500_123500011_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_500_123500011_qa_5/environment/bootstrap.sh b/tasks/0123_500_123500011_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_500_123500011_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_500_123500011_qa_5/environment/pull_bucket.py b/tasks/0123_500_123500011_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_500_123500011_qa_5/environment/pull_bucket.py +++ b/tasks/0123_500_123500011_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_500_123500011_qa_5/task.toml b/tasks/0123_500_123500011_qa_5/task.toml index fa87f39b629bfae86d907d1529986d461a0cd901..439614ee11462e7936d8674ce71a0597000ff2ca 100644 --- a/tasks/0123_500_123500011_qa_5/task.toml +++ b/tasks/0123_500_123500011_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_517_123517874_qa_3/environment/bootstrap.sh b/tasks/0123_517_123517874_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_517_123517874_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_517_123517874_qa_3/environment/pull_bucket.py b/tasks/0123_517_123517874_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_517_123517874_qa_3/environment/pull_bucket.py +++ b/tasks/0123_517_123517874_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_517_123517874_qa_3/task.toml b/tasks/0123_517_123517874_qa_3/task.toml index e0da37dbc8d5e16f6955bd81b75f28c8a4b243c3..19ece0dfaca3c593877b0fe76dd1c4a830e3aa98 100644 --- a/tasks/0123_517_123517874_qa_3/task.toml +++ b/tasks/0123_517_123517874_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_535_123535058_qa_4/environment/bootstrap.sh b/tasks/0123_535_123535058_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_535_123535058_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_535_123535058_qa_4/environment/pull_bucket.py b/tasks/0123_535_123535058_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_535_123535058_qa_4/environment/pull_bucket.py +++ b/tasks/0123_535_123535058_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_535_123535058_qa_4/task.toml b/tasks/0123_535_123535058_qa_4/task.toml index e1aae1a2c9265d1de151708ff5ac52526e8cc963..fd131fa04a57c9c324bb4ab537311e098bc82d6a 100644 --- a/tasks/0123_535_123535058_qa_4/task.toml +++ b/tasks/0123_535_123535058_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_535_123535058_qa_5/environment/bootstrap.sh b/tasks/0123_535_123535058_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_535_123535058_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_535_123535058_qa_5/environment/pull_bucket.py b/tasks/0123_535_123535058_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_535_123535058_qa_5/environment/pull_bucket.py +++ b/tasks/0123_535_123535058_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_535_123535058_qa_5/task.toml b/tasks/0123_535_123535058_qa_5/task.toml index 50bc3d4c70040c7f2303bb48477deb631db71fac..42a9fd58c437beb1b71ca45ce66e82f65c6c6928 100644 --- a/tasks/0123_535_123535058_qa_5/task.toml +++ b/tasks/0123_535_123535058_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_539_123539357_qa_2/environment/bootstrap.sh b/tasks/0123_539_123539357_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_539_123539357_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_539_123539357_qa_2/environment/pull_bucket.py b/tasks/0123_539_123539357_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_539_123539357_qa_2/environment/pull_bucket.py +++ b/tasks/0123_539_123539357_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_539_123539357_qa_2/task.toml b/tasks/0123_539_123539357_qa_2/task.toml index 147ee88394a849f142a0c0943e419b1adeedbc3a..ba11fd216b459a57d5604eee0a626e64fa1f70f8 100644 --- a/tasks/0123_539_123539357_qa_2/task.toml +++ b/tasks/0123_539_123539357_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_625_123625013_qa_3/environment/bootstrap.sh b/tasks/0123_625_123625013_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_625_123625013_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_625_123625013_qa_3/environment/pull_bucket.py b/tasks/0123_625_123625013_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_625_123625013_qa_3/environment/pull_bucket.py +++ b/tasks/0123_625_123625013_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_625_123625013_qa_3/task.toml b/tasks/0123_625_123625013_qa_3/task.toml index faebe33f77c88bf33f1cae1bbf54dac4574501d8..e250fe65e758f4c18f9444b38034bccfdfdb5e9a 100644 --- a/tasks/0123_625_123625013_qa_3/task.toml +++ b/tasks/0123_625_123625013_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_625_123625013_qa_4/environment/bootstrap.sh b/tasks/0123_625_123625013_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_625_123625013_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_625_123625013_qa_4/environment/pull_bucket.py b/tasks/0123_625_123625013_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_625_123625013_qa_4/environment/pull_bucket.py +++ b/tasks/0123_625_123625013_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_625_123625013_qa_4/task.toml b/tasks/0123_625_123625013_qa_4/task.toml index d65c1c34fc8cc6608a39d026d3f25f27d83211e7..1e5cd5e9c1c7fe487620b51247f5f489b5a3995b 100644 --- a/tasks/0123_625_123625013_qa_4/task.toml +++ b/tasks/0123_625_123625013_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_625_123625013_qa_5/environment/bootstrap.sh b/tasks/0123_625_123625013_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_625_123625013_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_625_123625013_qa_5/environment/pull_bucket.py b/tasks/0123_625_123625013_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_625_123625013_qa_5/environment/pull_bucket.py +++ b/tasks/0123_625_123625013_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_625_123625013_qa_5/task.toml b/tasks/0123_625_123625013_qa_5/task.toml index 0e3ff68fed01ce8074f179240934970c49258cc7..832bf7fd168fe665657180ab1e8aa7d8652cad74 100644 --- a/tasks/0123_625_123625013_qa_5/task.toml +++ b/tasks/0123_625_123625013_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_643_123643083_qa_2/environment/bootstrap.sh b/tasks/0123_643_123643083_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_643_123643083_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_643_123643083_qa_2/environment/pull_bucket.py b/tasks/0123_643_123643083_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_643_123643083_qa_2/environment/pull_bucket.py +++ b/tasks/0123_643_123643083_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_643_123643083_qa_2/task.toml b/tasks/0123_643_123643083_qa_2/task.toml index 73bc0d7ff1f12888d304bdcb733f717be0bc43d1..955b4f5dd16d135a73ed94af160ba9fdb5f5e6c0 100644 --- a/tasks/0123_643_123643083_qa_2/task.toml +++ b/tasks/0123_643_123643083_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_672_123672952_qa_2/environment/bootstrap.sh b/tasks/0123_672_123672952_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_672_123672952_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_672_123672952_qa_2/environment/pull_bucket.py b/tasks/0123_672_123672952_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_672_123672952_qa_2/environment/pull_bucket.py +++ b/tasks/0123_672_123672952_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_672_123672952_qa_2/task.toml b/tasks/0123_672_123672952_qa_2/task.toml index 46d192cc34a8a77a8e7bcb255d5b466b85ccd62b..f97dc9f3fbff7bc8bba9223347fa3719b2dc368a 100644 --- a/tasks/0123_672_123672952_qa_2/task.toml +++ b/tasks/0123_672_123672952_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_676_123676836_qa_5/environment/bootstrap.sh b/tasks/0123_676_123676836_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_676_123676836_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_676_123676836_qa_5/environment/pull_bucket.py b/tasks/0123_676_123676836_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_676_123676836_qa_5/environment/pull_bucket.py +++ b/tasks/0123_676_123676836_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_676_123676836_qa_5/task.toml b/tasks/0123_676_123676836_qa_5/task.toml index d9b34ebff81fb6e08751f0e438a283684a7f267d..f07c901d35a1ec6517f310ebb23f937fa1a6e644 100644 --- a/tasks/0123_676_123676836_qa_5/task.toml +++ b/tasks/0123_676_123676836_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_734_123734284_qa_1/environment/bootstrap.sh b/tasks/0123_734_123734284_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_734_123734284_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_734_123734284_qa_1/environment/pull_bucket.py b/tasks/0123_734_123734284_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_734_123734284_qa_1/environment/pull_bucket.py +++ b/tasks/0123_734_123734284_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_734_123734284_qa_1/task.toml b/tasks/0123_734_123734284_qa_1/task.toml index 59e6059cca6c1abdf544b1b1600d837291a30b8c..68fa2171f7cbb4ddf56309a5f6346f99ed33a3b2 100644 --- a/tasks/0123_734_123734284_qa_1/task.toml +++ b/tasks/0123_734_123734284_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_735_123735039_qa_4/environment/bootstrap.sh b/tasks/0123_735_123735039_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_735_123735039_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_735_123735039_qa_4/environment/pull_bucket.py b/tasks/0123_735_123735039_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_735_123735039_qa_4/environment/pull_bucket.py +++ b/tasks/0123_735_123735039_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_735_123735039_qa_4/task.toml b/tasks/0123_735_123735039_qa_4/task.toml index b24766ff241b36a6d5e8d82c9c97d42ec4d2ebdf..4c2c0af9efc79e05d6fb273046a284352e7989b5 100644 --- a/tasks/0123_735_123735039_qa_4/task.toml +++ b/tasks/0123_735_123735039_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_735_123735039_qa_5/environment/bootstrap.sh b/tasks/0123_735_123735039_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_735_123735039_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_735_123735039_qa_5/environment/pull_bucket.py b/tasks/0123_735_123735039_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_735_123735039_qa_5/environment/pull_bucket.py +++ b/tasks/0123_735_123735039_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_735_123735039_qa_5/task.toml b/tasks/0123_735_123735039_qa_5/task.toml index 74af04dd316b2727cb2baf93d6e375dd3f29b1fd..83d2c27c8f93cc7df56230e09664f45161a2cb51 100644 --- a/tasks/0123_735_123735039_qa_5/task.toml +++ b/tasks/0123_735_123735039_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_785_123785154_qa_3/environment/bootstrap.sh b/tasks/0123_785_123785154_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_785_123785154_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_785_123785154_qa_3/environment/pull_bucket.py b/tasks/0123_785_123785154_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_785_123785154_qa_3/environment/pull_bucket.py +++ b/tasks/0123_785_123785154_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_785_123785154_qa_3/task.toml b/tasks/0123_785_123785154_qa_3/task.toml index e98bc6c16b5af3bb2f257fdac6dca12e4bb02eed..cfc1b8bc7b2b9839dd9d935101404ae5b076da94 100644 --- a/tasks/0123_785_123785154_qa_3/task.toml +++ b/tasks/0123_785_123785154_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_884_123884915_qa_1/environment/bootstrap.sh b/tasks/0123_884_123884915_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_884_123884915_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_884_123884915_qa_1/environment/pull_bucket.py b/tasks/0123_884_123884915_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_884_123884915_qa_1/environment/pull_bucket.py +++ b/tasks/0123_884_123884915_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_884_123884915_qa_1/task.toml b/tasks/0123_884_123884915_qa_1/task.toml index 4f4bb6b5ca3f2511b0511361dc9b7f57198b601f..85913db6cc6a96056a71af08a7fc56a266962aae 100644 --- a/tasks/0123_884_123884915_qa_1/task.toml +++ b/tasks/0123_884_123884915_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_884_123884915_qa_5/environment/bootstrap.sh b/tasks/0123_884_123884915_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_884_123884915_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_884_123884915_qa_5/environment/pull_bucket.py b/tasks/0123_884_123884915_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_884_123884915_qa_5/environment/pull_bucket.py +++ b/tasks/0123_884_123884915_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_884_123884915_qa_5/task.toml b/tasks/0123_884_123884915_qa_5/task.toml index 8f193349623d450fbb60a7af94dc01770cce75e7..d2ceb5cbf08dec13bb93c1f6f9fef1519bb7db75 100644 --- a/tasks/0123_884_123884915_qa_5/task.toml +++ b/tasks/0123_884_123884915_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_993_123993680_qa_1/environment/bootstrap.sh b/tasks/0123_993_123993680_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_993_123993680_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_993_123993680_qa_1/environment/pull_bucket.py b/tasks/0123_993_123993680_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_993_123993680_qa_1/environment/pull_bucket.py +++ b/tasks/0123_993_123993680_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_993_123993680_qa_1/task.toml b/tasks/0123_993_123993680_qa_1/task.toml index 57f8b5143bdd32f42af2402a856a5cdd30634d81..fda65831e687344934d18cae019cc17bb8f8fb9a 100644 --- a/tasks/0123_993_123993680_qa_1/task.toml +++ b/tasks/0123_993_123993680_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0123_993_123993680_qa_2/environment/bootstrap.sh b/tasks/0123_993_123993680_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0123_993_123993680_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0123_993_123993680_qa_2/environment/pull_bucket.py b/tasks/0123_993_123993680_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0123_993_123993680_qa_2/environment/pull_bucket.py +++ b/tasks/0123_993_123993680_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0123_993_123993680_qa_2/task.toml b/tasks/0123_993_123993680_qa_2/task.toml index 5535972d42184a3aaba15dad21d44dacf852098c..eb564926bdf48292d1910462a441bf105a03e44a 100644 --- a/tasks/0123_993_123993680_qa_2/task.toml +++ b/tasks/0123_993_123993680_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_096_124096448_qa_1/environment/bootstrap.sh b/tasks/0124_096_124096448_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_096_124096448_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_096_124096448_qa_1/environment/pull_bucket.py b/tasks/0124_096_124096448_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_096_124096448_qa_1/environment/pull_bucket.py +++ b/tasks/0124_096_124096448_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_096_124096448_qa_1/task.toml b/tasks/0124_096_124096448_qa_1/task.toml index 8583cb6d3672670686a6811b6966fc0a4d34a50e..4bfef4dee1f7c0fe7ca9ad2f7db2c0bb5b1c295c 100644 --- a/tasks/0124_096_124096448_qa_1/task.toml +++ b/tasks/0124_096_124096448_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_179_124179717_qa_1/environment/bootstrap.sh b/tasks/0124_179_124179717_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_179_124179717_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_179_124179717_qa_1/environment/pull_bucket.py b/tasks/0124_179_124179717_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_179_124179717_qa_1/environment/pull_bucket.py +++ b/tasks/0124_179_124179717_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_179_124179717_qa_1/task.toml b/tasks/0124_179_124179717_qa_1/task.toml index 7548e5d37e7350bf24a93c014880e2be332c8801..2fc5f9e64647b1bb482de30c572b3d4a4786ec92 100644 --- a/tasks/0124_179_124179717_qa_1/task.toml +++ b/tasks/0124_179_124179717_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_179_124179717_qa_2/environment/bootstrap.sh b/tasks/0124_179_124179717_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_179_124179717_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_179_124179717_qa_2/environment/pull_bucket.py b/tasks/0124_179_124179717_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_179_124179717_qa_2/environment/pull_bucket.py +++ b/tasks/0124_179_124179717_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_179_124179717_qa_2/task.toml b/tasks/0124_179_124179717_qa_2/task.toml index e1699beeb9e0cee63aae2e51c1128cadf726220c..1cfde862e34ed64e6abd8365c3c21704c1b6736f 100644 --- a/tasks/0124_179_124179717_qa_2/task.toml +++ b/tasks/0124_179_124179717_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_179_124179717_qa_3/environment/bootstrap.sh b/tasks/0124_179_124179717_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_179_124179717_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_179_124179717_qa_3/environment/pull_bucket.py b/tasks/0124_179_124179717_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_179_124179717_qa_3/environment/pull_bucket.py +++ b/tasks/0124_179_124179717_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_179_124179717_qa_3/task.toml b/tasks/0124_179_124179717_qa_3/task.toml index 5bf1a0f46dfe822bf68f8eb60c1df79da0e77248..43a909b8e44380add4b50af28d294170a6433521 100644 --- a/tasks/0124_179_124179717_qa_3/task.toml +++ b/tasks/0124_179_124179717_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_179_124179717_qa_4/environment/bootstrap.sh b/tasks/0124_179_124179717_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_179_124179717_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_179_124179717_qa_4/environment/pull_bucket.py b/tasks/0124_179_124179717_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_179_124179717_qa_4/environment/pull_bucket.py +++ b/tasks/0124_179_124179717_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_179_124179717_qa_4/task.toml b/tasks/0124_179_124179717_qa_4/task.toml index 3eef5afd37cdcc6b52d6dd111c1a8a2097d7f42d..154a966932265d27c3c22527783f88a3f847e8c2 100644 --- a/tasks/0124_179_124179717_qa_4/task.toml +++ b/tasks/0124_179_124179717_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_195_124195561_qa_1/environment/bootstrap.sh b/tasks/0124_195_124195561_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_195_124195561_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_195_124195561_qa_1/environment/pull_bucket.py b/tasks/0124_195_124195561_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_195_124195561_qa_1/environment/pull_bucket.py +++ b/tasks/0124_195_124195561_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_195_124195561_qa_1/task.toml b/tasks/0124_195_124195561_qa_1/task.toml index 601f9f55c39971dc74b7224234d0e390abbc9358..c45bdf461e4ef85b251bc3da0cbb4d34aebdc93f 100644 --- a/tasks/0124_195_124195561_qa_1/task.toml +++ b/tasks/0124_195_124195561_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_231_124231950_qa_3/environment/bootstrap.sh b/tasks/0124_231_124231950_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_231_124231950_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_231_124231950_qa_3/environment/pull_bucket.py b/tasks/0124_231_124231950_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_231_124231950_qa_3/environment/pull_bucket.py +++ b/tasks/0124_231_124231950_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_231_124231950_qa_3/task.toml b/tasks/0124_231_124231950_qa_3/task.toml index e3ffa3d6f1fd0ff61ea2a78ce6fa67524aa96ac5..ac207830314036f81b29dc6d75c3bfba4b2302b1 100644 --- a/tasks/0124_231_124231950_qa_3/task.toml +++ b/tasks/0124_231_124231950_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_259_124259674_qa_1/environment/bootstrap.sh b/tasks/0124_259_124259674_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_259_124259674_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_259_124259674_qa_1/environment/pull_bucket.py b/tasks/0124_259_124259674_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_259_124259674_qa_1/environment/pull_bucket.py +++ b/tasks/0124_259_124259674_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_259_124259674_qa_1/task.toml b/tasks/0124_259_124259674_qa_1/task.toml index 158c84531835e993095d049008ef3c2d7b531250..ba8d85d4718bfb8d4918c007a541eae428b0dd2c 100644 --- a/tasks/0124_259_124259674_qa_1/task.toml +++ b/tasks/0124_259_124259674_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_259_124259674_qa_3/environment/bootstrap.sh b/tasks/0124_259_124259674_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_259_124259674_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_259_124259674_qa_3/environment/pull_bucket.py b/tasks/0124_259_124259674_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_259_124259674_qa_3/environment/pull_bucket.py +++ b/tasks/0124_259_124259674_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_259_124259674_qa_3/task.toml b/tasks/0124_259_124259674_qa_3/task.toml index f1386ae7c68546eb2ab8652304b2ab1da6e7461d..3ea7a6bf69cb4177f88978c1666df92e968d2e10 100644 --- a/tasks/0124_259_124259674_qa_3/task.toml +++ b/tasks/0124_259_124259674_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_269_124269009_qa_3/environment/bootstrap.sh b/tasks/0124_269_124269009_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_269_124269009_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_269_124269009_qa_3/environment/pull_bucket.py b/tasks/0124_269_124269009_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_269_124269009_qa_3/environment/pull_bucket.py +++ b/tasks/0124_269_124269009_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_269_124269009_qa_3/task.toml b/tasks/0124_269_124269009_qa_3/task.toml index 4ecbd76467839ca254725ac97393b9ae41ef0199..705bfa9d20ef63d2860b399e8aeab3aef01460ff 100644 --- a/tasks/0124_269_124269009_qa_3/task.toml +++ b/tasks/0124_269_124269009_qa_3/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_309_124309485_qa_5/environment/bootstrap.sh b/tasks/0124_309_124309485_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_309_124309485_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_309_124309485_qa_5/environment/pull_bucket.py b/tasks/0124_309_124309485_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_309_124309485_qa_5/environment/pull_bucket.py +++ b/tasks/0124_309_124309485_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_309_124309485_qa_5/task.toml b/tasks/0124_309_124309485_qa_5/task.toml index 0c8df751d5f921b5e7bf40b7f40874ffc40174e8..8e9e8999988f4f2df78b889c9b426c24961c9a3a 100644 --- a/tasks/0124_309_124309485_qa_5/task.toml +++ b/tasks/0124_309_124309485_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_334_124334340_qa_1/environment/bootstrap.sh b/tasks/0124_334_124334340_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_334_124334340_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_334_124334340_qa_1/environment/pull_bucket.py b/tasks/0124_334_124334340_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_334_124334340_qa_1/environment/pull_bucket.py +++ b/tasks/0124_334_124334340_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_334_124334340_qa_1/task.toml b/tasks/0124_334_124334340_qa_1/task.toml index 80ab1019081ac22d6ad5d1557977e8750a0e4404..ec65072ef8c6401eb1876b6c5b76481850302d3a 100644 --- a/tasks/0124_334_124334340_qa_1/task.toml +++ b/tasks/0124_334_124334340_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_334_124334340_qa_4/environment/bootstrap.sh b/tasks/0124_334_124334340_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_334_124334340_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_334_124334340_qa_4/environment/pull_bucket.py b/tasks/0124_334_124334340_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_334_124334340_qa_4/environment/pull_bucket.py +++ b/tasks/0124_334_124334340_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_334_124334340_qa_4/task.toml b/tasks/0124_334_124334340_qa_4/task.toml index e6be0c26da662142abc51f21aefc834cc72d4fc3..39755e927118e77dd9cb525ba10835b669d25a76 100644 --- a/tasks/0124_334_124334340_qa_4/task.toml +++ b/tasks/0124_334_124334340_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_358_124358327_qa_3/environment/bootstrap.sh b/tasks/0124_358_124358327_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_358_124358327_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_358_124358327_qa_3/environment/pull_bucket.py b/tasks/0124_358_124358327_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_358_124358327_qa_3/environment/pull_bucket.py +++ b/tasks/0124_358_124358327_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_358_124358327_qa_3/task.toml b/tasks/0124_358_124358327_qa_3/task.toml index bf51000e219a9f6224106f004451d46dc1b53e6d..4d8fc029a331aa4c14474494f91c267972f194e2 100644 --- a/tasks/0124_358_124358327_qa_3/task.toml +++ b/tasks/0124_358_124358327_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_384_124384181_qa_1/environment/bootstrap.sh b/tasks/0124_384_124384181_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_384_124384181_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_384_124384181_qa_1/environment/pull_bucket.py b/tasks/0124_384_124384181_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_384_124384181_qa_1/environment/pull_bucket.py +++ b/tasks/0124_384_124384181_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_384_124384181_qa_1/task.toml b/tasks/0124_384_124384181_qa_1/task.toml index 556a0830415a08a055ff4c83736c04abe01c9cb4..9a865fd2aac1daf5320e9dd00262c584ba26290c 100644 --- a/tasks/0124_384_124384181_qa_1/task.toml +++ b/tasks/0124_384_124384181_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_384_124384181_qa_3/environment/bootstrap.sh b/tasks/0124_384_124384181_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_384_124384181_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_384_124384181_qa_3/environment/pull_bucket.py b/tasks/0124_384_124384181_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_384_124384181_qa_3/environment/pull_bucket.py +++ b/tasks/0124_384_124384181_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_384_124384181_qa_3/task.toml b/tasks/0124_384_124384181_qa_3/task.toml index f40ca15567d1377930ffe5f6bd5a69a05102bbcc..82892cc0a0d3e2110517b51936bd0f547cb04f8f 100644 --- a/tasks/0124_384_124384181_qa_3/task.toml +++ b/tasks/0124_384_124384181_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_418_124418283_qa_2/environment/bootstrap.sh b/tasks/0124_418_124418283_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_418_124418283_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_418_124418283_qa_2/environment/pull_bucket.py b/tasks/0124_418_124418283_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_418_124418283_qa_2/environment/pull_bucket.py +++ b/tasks/0124_418_124418283_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_418_124418283_qa_2/task.toml b/tasks/0124_418_124418283_qa_2/task.toml index 1e3ee7ddd3e926f3202a1013f8bc7a908b5cc683..71971c1b66d99437c4522ae2d418ebabf996b369 100644 --- a/tasks/0124_418_124418283_qa_2/task.toml +++ b/tasks/0124_418_124418283_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_418_124418283_qa_5/environment/bootstrap.sh b/tasks/0124_418_124418283_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_418_124418283_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_418_124418283_qa_5/environment/pull_bucket.py b/tasks/0124_418_124418283_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_418_124418283_qa_5/environment/pull_bucket.py +++ b/tasks/0124_418_124418283_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_418_124418283_qa_5/task.toml b/tasks/0124_418_124418283_qa_5/task.toml index 26b17745218b3a1d3af4e82389caccc715a2b4db..081cccb8e4ac570852da65354193c3cd82a694ef 100644 --- a/tasks/0124_418_124418283_qa_5/task.toml +++ b/tasks/0124_418_124418283_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_488_124488738_qa_1/environment/bootstrap.sh b/tasks/0124_488_124488738_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_488_124488738_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_488_124488738_qa_1/environment/pull_bucket.py b/tasks/0124_488_124488738_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_488_124488738_qa_1/environment/pull_bucket.py +++ b/tasks/0124_488_124488738_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_488_124488738_qa_1/task.toml b/tasks/0124_488_124488738_qa_1/task.toml index 296efcfe4dec7f15469f64f43e88017c53605569..0e7d7e93b0fe6a0e8c63ad08c9a49354cd4af7df 100644 --- a/tasks/0124_488_124488738_qa_1/task.toml +++ b/tasks/0124_488_124488738_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_563_124563125_qa_5/environment/bootstrap.sh b/tasks/0124_563_124563125_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_563_124563125_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_563_124563125_qa_5/environment/pull_bucket.py b/tasks/0124_563_124563125_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_563_124563125_qa_5/environment/pull_bucket.py +++ b/tasks/0124_563_124563125_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_563_124563125_qa_5/task.toml b/tasks/0124_563_124563125_qa_5/task.toml index 767069108b7870c175812ff5b1212471bad9c92e..6f904e3d3b1447cc6049dcde7c3916b785c3370c 100644 --- a/tasks/0124_563_124563125_qa_5/task.toml +++ b/tasks/0124_563_124563125_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_606_124606600_qa_2/environment/bootstrap.sh b/tasks/0124_606_124606600_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_606_124606600_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_606_124606600_qa_2/environment/pull_bucket.py b/tasks/0124_606_124606600_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_606_124606600_qa_2/environment/pull_bucket.py +++ b/tasks/0124_606_124606600_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_606_124606600_qa_2/task.toml b/tasks/0124_606_124606600_qa_2/task.toml index f07d9ed8defd06667a995077bf4cf4f32f5d9587..f1b309f956fb66036dbf1975fe3d70e7cfa3c289 100644 --- a/tasks/0124_606_124606600_qa_2/task.toml +++ b/tasks/0124_606_124606600_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_606_124606600_qa_3/environment/bootstrap.sh b/tasks/0124_606_124606600_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_606_124606600_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_606_124606600_qa_3/environment/pull_bucket.py b/tasks/0124_606_124606600_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_606_124606600_qa_3/environment/pull_bucket.py +++ b/tasks/0124_606_124606600_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_606_124606600_qa_3/task.toml b/tasks/0124_606_124606600_qa_3/task.toml index f2b833588a568df7bc77db4b70d84fec55d154f1..5f413ec08f4b5dc3761d761be24671047507276f 100644 --- a/tasks/0124_606_124606600_qa_3/task.toml +++ b/tasks/0124_606_124606600_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_615_124615899_qa_1/environment/bootstrap.sh b/tasks/0124_615_124615899_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_615_124615899_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_615_124615899_qa_1/environment/pull_bucket.py b/tasks/0124_615_124615899_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_615_124615899_qa_1/environment/pull_bucket.py +++ b/tasks/0124_615_124615899_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_615_124615899_qa_1/task.toml b/tasks/0124_615_124615899_qa_1/task.toml index d19db3d6e423fcbf9d7b46567735794b0c283bbd..4f41070cca4a339bb880821dfcbe131fa6e97826 100644 --- a/tasks/0124_615_124615899_qa_1/task.toml +++ b/tasks/0124_615_124615899_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_615_124615899_qa_5/environment/bootstrap.sh b/tasks/0124_615_124615899_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_615_124615899_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_615_124615899_qa_5/environment/pull_bucket.py b/tasks/0124_615_124615899_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_615_124615899_qa_5/environment/pull_bucket.py +++ b/tasks/0124_615_124615899_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_615_124615899_qa_5/task.toml b/tasks/0124_615_124615899_qa_5/task.toml index 6eb54a6fd864231f514fb96aa8fe8cda62c50f0e..d6d3aaf244894a19107a4a4695d72e71f8fbe973 100644 --- a/tasks/0124_615_124615899_qa_5/task.toml +++ b/tasks/0124_615_124615899_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_651_124651158_qa_1/environment/bootstrap.sh b/tasks/0124_651_124651158_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_651_124651158_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_651_124651158_qa_1/environment/pull_bucket.py b/tasks/0124_651_124651158_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_651_124651158_qa_1/environment/pull_bucket.py +++ b/tasks/0124_651_124651158_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_651_124651158_qa_1/task.toml b/tasks/0124_651_124651158_qa_1/task.toml index 8fa5b9689711ce7ff962688ef1dd19b638bae686..313e4b7abbe709fd62e86836536854dab47c49df 100644 --- a/tasks/0124_651_124651158_qa_1/task.toml +++ b/tasks/0124_651_124651158_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_739_124739657_qa_1/environment/bootstrap.sh b/tasks/0124_739_124739657_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_739_124739657_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_739_124739657_qa_1/environment/pull_bucket.py b/tasks/0124_739_124739657_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_739_124739657_qa_1/environment/pull_bucket.py +++ b/tasks/0124_739_124739657_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_739_124739657_qa_1/task.toml b/tasks/0124_739_124739657_qa_1/task.toml index 8985fa2a0baabfe3f2085950b45f8eb0ae11f5ea..410eda63bd632c747b12cd64f9217d0c3dffb8e9 100644 --- a/tasks/0124_739_124739657_qa_1/task.toml +++ b/tasks/0124_739_124739657_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_919_124919449_qa_1/environment/bootstrap.sh b/tasks/0124_919_124919449_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_919_124919449_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_919_124919449_qa_1/environment/pull_bucket.py b/tasks/0124_919_124919449_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_919_124919449_qa_1/environment/pull_bucket.py +++ b/tasks/0124_919_124919449_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_919_124919449_qa_1/task.toml b/tasks/0124_919_124919449_qa_1/task.toml index bdd484fc9e3d93e4878aaa24b10f770078071a6e..7d0fc12d1e5032c574cfd559c14da918e03c36e3 100644 --- a/tasks/0124_919_124919449_qa_1/task.toml +++ b/tasks/0124_919_124919449_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_947_124947396_qa_4/environment/bootstrap.sh b/tasks/0124_947_124947396_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_947_124947396_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_947_124947396_qa_4/environment/pull_bucket.py b/tasks/0124_947_124947396_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_947_124947396_qa_4/environment/pull_bucket.py +++ b/tasks/0124_947_124947396_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_947_124947396_qa_4/task.toml b/tasks/0124_947_124947396_qa_4/task.toml index 7bbec4dfdb5004a9b3965b928fd77dbdb304d47f..469c840363616c957ca66eec1fbcdb468f484f12 100644 --- a/tasks/0124_947_124947396_qa_4/task.toml +++ b/tasks/0124_947_124947396_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_965_124965722_qa_1/environment/bootstrap.sh b/tasks/0124_965_124965722_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_965_124965722_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_965_124965722_qa_1/environment/pull_bucket.py b/tasks/0124_965_124965722_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_965_124965722_qa_1/environment/pull_bucket.py +++ b/tasks/0124_965_124965722_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_965_124965722_qa_1/task.toml b/tasks/0124_965_124965722_qa_1/task.toml index ba440764a42d0ee347f686359acf0e79957ee1d6..7553364f3e042ef065642bc5b235e127a59af15b 100644 --- a/tasks/0124_965_124965722_qa_1/task.toml +++ b/tasks/0124_965_124965722_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_965_124965722_qa_2/environment/bootstrap.sh b/tasks/0124_965_124965722_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_965_124965722_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_965_124965722_qa_2/environment/pull_bucket.py b/tasks/0124_965_124965722_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_965_124965722_qa_2/environment/pull_bucket.py +++ b/tasks/0124_965_124965722_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_965_124965722_qa_2/task.toml b/tasks/0124_965_124965722_qa_2/task.toml index 050237bf4efa2fc5baa0214cd88563eac0663ee1..dd7ea1f41201e435e7b2de10246fa57ec8e16d11 100644 --- a/tasks/0124_965_124965722_qa_2/task.toml +++ b/tasks/0124_965_124965722_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_966_124966489_qa_1/environment/bootstrap.sh b/tasks/0124_966_124966489_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_966_124966489_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_966_124966489_qa_1/environment/pull_bucket.py b/tasks/0124_966_124966489_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_966_124966489_qa_1/environment/pull_bucket.py +++ b/tasks/0124_966_124966489_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_966_124966489_qa_1/task.toml b/tasks/0124_966_124966489_qa_1/task.toml index 4dce0e48156427f03bcd0b0934d590ab20d0cc51..b2d6c92f1da18415fdeaea75e70008b898200af7 100644 --- a/tasks/0124_966_124966489_qa_1/task.toml +++ b/tasks/0124_966_124966489_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_966_124966489_qa_5/environment/bootstrap.sh b/tasks/0124_966_124966489_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_966_124966489_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_966_124966489_qa_5/environment/pull_bucket.py b/tasks/0124_966_124966489_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_966_124966489_qa_5/environment/pull_bucket.py +++ b/tasks/0124_966_124966489_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_966_124966489_qa_5/task.toml b/tasks/0124_966_124966489_qa_5/task.toml index 520d9ec93e0d6cc8304e90e31b22c7b3086b0115..1b49ac7cab561d1fb9a7be17dc6d4de75a10cbab 100644 --- a/tasks/0124_966_124966489_qa_5/task.toml +++ b/tasks/0124_966_124966489_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0124_973_124973460_qa_5/environment/bootstrap.sh b/tasks/0124_973_124973460_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0124_973_124973460_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0124_973_124973460_qa_5/environment/pull_bucket.py b/tasks/0124_973_124973460_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0124_973_124973460_qa_5/environment/pull_bucket.py +++ b/tasks/0124_973_124973460_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0124_973_124973460_qa_5/task.toml b/tasks/0124_973_124973460_qa_5/task.toml index cee59880c1b811a80f86dcb3322471a06bd2da30..8bd72f034ebe1b6dfa1112d778caa8f353155db7 100644 --- a/tasks/0124_973_124973460_qa_5/task.toml +++ b/tasks/0124_973_124973460_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_028_125028860_qa_5/environment/bootstrap.sh b/tasks/0125_028_125028860_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_028_125028860_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_028_125028860_qa_5/environment/pull_bucket.py b/tasks/0125_028_125028860_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_028_125028860_qa_5/environment/pull_bucket.py +++ b/tasks/0125_028_125028860_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_028_125028860_qa_5/task.toml b/tasks/0125_028_125028860_qa_5/task.toml index 140d57d0398e8ec78d56c9505f15605121946c2e..397d6b6e5a8000d28f466df0bdf83cf276575281 100644 --- a/tasks/0125_028_125028860_qa_5/task.toml +++ b/tasks/0125_028_125028860_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_030_125030755_qa_2/environment/bootstrap.sh b/tasks/0125_030_125030755_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_030_125030755_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_030_125030755_qa_2/environment/pull_bucket.py b/tasks/0125_030_125030755_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_030_125030755_qa_2/environment/pull_bucket.py +++ b/tasks/0125_030_125030755_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_030_125030755_qa_2/task.toml b/tasks/0125_030_125030755_qa_2/task.toml index 40cb38e5f810b216c639f49436ec3d6c6ffaf834..117b31ee505e217bd27438e1892d1630a569b7e2 100644 --- a/tasks/0125_030_125030755_qa_2/task.toml +++ b/tasks/0125_030_125030755_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_045_125045351_qa_1/environment/bootstrap.sh b/tasks/0125_045_125045351_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_045_125045351_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_045_125045351_qa_1/environment/pull_bucket.py b/tasks/0125_045_125045351_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_045_125045351_qa_1/environment/pull_bucket.py +++ b/tasks/0125_045_125045351_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_045_125045351_qa_1/task.toml b/tasks/0125_045_125045351_qa_1/task.toml index da9a781ccb7572193a6abfdbb009249b283d5214..ff55708e331380054fd1584c15dc27fc745163c1 100644 --- a/tasks/0125_045_125045351_qa_1/task.toml +++ b/tasks/0125_045_125045351_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_045_125045351_qa_4/environment/bootstrap.sh b/tasks/0125_045_125045351_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_045_125045351_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_045_125045351_qa_4/environment/pull_bucket.py b/tasks/0125_045_125045351_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_045_125045351_qa_4/environment/pull_bucket.py +++ b/tasks/0125_045_125045351_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_045_125045351_qa_4/task.toml b/tasks/0125_045_125045351_qa_4/task.toml index 8410966ddfd7135f2290d55ede8c4d1d5662dd45..5c5ba871bc65ffa8cbcaca3c50fa09af1e47c5fc 100644 --- a/tasks/0125_045_125045351_qa_4/task.toml +++ b/tasks/0125_045_125045351_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_045_125045351_qa_5/environment/bootstrap.sh b/tasks/0125_045_125045351_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_045_125045351_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_045_125045351_qa_5/environment/pull_bucket.py b/tasks/0125_045_125045351_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_045_125045351_qa_5/environment/pull_bucket.py +++ b/tasks/0125_045_125045351_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_045_125045351_qa_5/task.toml b/tasks/0125_045_125045351_qa_5/task.toml index 7574a865a685d0d38d585f5d3c66f239d4f3ffd5..d22ac5afa2eaf92f6399d357fca28a0ab74e8324 100644 --- a/tasks/0125_045_125045351_qa_5/task.toml +++ b/tasks/0125_045_125045351_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_115_125115132_qa_1/environment/bootstrap.sh b/tasks/0125_115_125115132_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_115_125115132_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_115_125115132_qa_1/environment/pull_bucket.py b/tasks/0125_115_125115132_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_115_125115132_qa_1/environment/pull_bucket.py +++ b/tasks/0125_115_125115132_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_115_125115132_qa_1/task.toml b/tasks/0125_115_125115132_qa_1/task.toml index e009f29f28942995a4938dc59a6fe522dbfb8af1..b2cd9b9f7bd3f9fe89960359a13cf0a0ee971f2a 100644 --- a/tasks/0125_115_125115132_qa_1/task.toml +++ b/tasks/0125_115_125115132_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_124_125124726_qa_1/environment/bootstrap.sh b/tasks/0125_124_125124726_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_124_125124726_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_124_125124726_qa_1/environment/pull_bucket.py b/tasks/0125_124_125124726_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_124_125124726_qa_1/environment/pull_bucket.py +++ b/tasks/0125_124_125124726_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_124_125124726_qa_1/task.toml b/tasks/0125_124_125124726_qa_1/task.toml index 34dcfe8daf63a938860b920fe2342be0030f2f06..16ea4a69d68331ed09bc3cf30cd9ff3138c6f46f 100644 --- a/tasks/0125_124_125124726_qa_1/task.toml +++ b/tasks/0125_124_125124726_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_140_125140765_qa_1/environment/bootstrap.sh b/tasks/0125_140_125140765_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_140_125140765_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_140_125140765_qa_1/environment/pull_bucket.py b/tasks/0125_140_125140765_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_140_125140765_qa_1/environment/pull_bucket.py +++ b/tasks/0125_140_125140765_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_140_125140765_qa_1/task.toml b/tasks/0125_140_125140765_qa_1/task.toml index 00be30eba0f15db02aecb8115167366f83c5b211..82e6c628b6611489748723c3853d112db4711f68 100644 --- a/tasks/0125_140_125140765_qa_1/task.toml +++ b/tasks/0125_140_125140765_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_188_125188137_qa_1/environment/bootstrap.sh b/tasks/0125_188_125188137_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_188_125188137_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_188_125188137_qa_1/environment/pull_bucket.py b/tasks/0125_188_125188137_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_188_125188137_qa_1/environment/pull_bucket.py +++ b/tasks/0125_188_125188137_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_188_125188137_qa_1/task.toml b/tasks/0125_188_125188137_qa_1/task.toml index fbb91633c3c12934c079723c213f1986b616bcd3..2f1046c5c62e6c967878ad5b5fcc36b053163e18 100644 --- a/tasks/0125_188_125188137_qa_1/task.toml +++ b/tasks/0125_188_125188137_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_200_125200118_qa_3/environment/bootstrap.sh b/tasks/0125_200_125200118_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_200_125200118_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_200_125200118_qa_3/environment/pull_bucket.py b/tasks/0125_200_125200118_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_200_125200118_qa_3/environment/pull_bucket.py +++ b/tasks/0125_200_125200118_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_200_125200118_qa_3/task.toml b/tasks/0125_200_125200118_qa_3/task.toml index b7d0d7fc8b848c031c193d45f4c3ce9da1f5a549..272447580a4c148b5eeb4e20b3da06a9b4400f54 100644 --- a/tasks/0125_200_125200118_qa_3/task.toml +++ b/tasks/0125_200_125200118_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_200_125200118_qa_4/environment/bootstrap.sh b/tasks/0125_200_125200118_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_200_125200118_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_200_125200118_qa_4/environment/pull_bucket.py b/tasks/0125_200_125200118_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_200_125200118_qa_4/environment/pull_bucket.py +++ b/tasks/0125_200_125200118_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_200_125200118_qa_4/task.toml b/tasks/0125_200_125200118_qa_4/task.toml index fd1370f850fcddabdf6f7ae30bf531ee8632d314..ea23ffe90f81cda4b8c4cc9675ef425d10d0924f 100644 --- a/tasks/0125_200_125200118_qa_4/task.toml +++ b/tasks/0125_200_125200118_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_252_125252436_qa_3/environment/bootstrap.sh b/tasks/0125_252_125252436_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_252_125252436_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_252_125252436_qa_3/environment/pull_bucket.py b/tasks/0125_252_125252436_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_252_125252436_qa_3/environment/pull_bucket.py +++ b/tasks/0125_252_125252436_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_252_125252436_qa_3/task.toml b/tasks/0125_252_125252436_qa_3/task.toml index 3ea0f3bba6d5f5299043513e8e66ad049419d0b5..7f0989d961cb007fdde1dd95ce3a12ff907983ce 100644 --- a/tasks/0125_252_125252436_qa_3/task.toml +++ b/tasks/0125_252_125252436_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_283_125283115_qa_4/environment/bootstrap.sh b/tasks/0125_283_125283115_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_283_125283115_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_283_125283115_qa_4/environment/pull_bucket.py b/tasks/0125_283_125283115_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_283_125283115_qa_4/environment/pull_bucket.py +++ b/tasks/0125_283_125283115_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_283_125283115_qa_4/task.toml b/tasks/0125_283_125283115_qa_4/task.toml index 8f61d37efae7fdbfa510c8b73106e545166fd137..7e6e83dd1daddcfea4a49fe0727bbd6f5b980f3c 100644 --- a/tasks/0125_283_125283115_qa_4/task.toml +++ b/tasks/0125_283_125283115_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_377_125377376_qa_5/environment/bootstrap.sh b/tasks/0125_377_125377376_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_377_125377376_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_377_125377376_qa_5/environment/pull_bucket.py b/tasks/0125_377_125377376_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_377_125377376_qa_5/environment/pull_bucket.py +++ b/tasks/0125_377_125377376_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_377_125377376_qa_5/task.toml b/tasks/0125_377_125377376_qa_5/task.toml index 14dada73f4c09c6986557a56dd3ff25a6d0c4b7d..5ff43d2d9e3d8f0f238ac2e7a7366c16a433b84a 100644 --- a/tasks/0125_377_125377376_qa_5/task.toml +++ b/tasks/0125_377_125377376_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_379_125379106_qa_1/environment/bootstrap.sh b/tasks/0125_379_125379106_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_379_125379106_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_379_125379106_qa_1/environment/pull_bucket.py b/tasks/0125_379_125379106_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_379_125379106_qa_1/environment/pull_bucket.py +++ b/tasks/0125_379_125379106_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_379_125379106_qa_1/task.toml b/tasks/0125_379_125379106_qa_1/task.toml index 663d32fdaaa7da4048ffadbe027f4c09168453b5..3f74a4f47b2814cc8b8678b6a84a1da4c7e1c77e 100644 --- a/tasks/0125_379_125379106_qa_1/task.toml +++ b/tasks/0125_379_125379106_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_379_125379106_qa_4/environment/bootstrap.sh b/tasks/0125_379_125379106_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_379_125379106_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_379_125379106_qa_4/environment/pull_bucket.py b/tasks/0125_379_125379106_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_379_125379106_qa_4/environment/pull_bucket.py +++ b/tasks/0125_379_125379106_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_379_125379106_qa_4/task.toml b/tasks/0125_379_125379106_qa_4/task.toml index cd927e924152b3e5922c27913a34cb41907725f5..d00d767978caa212d1e8f0f7093c5ad01a8e99d5 100644 --- a/tasks/0125_379_125379106_qa_4/task.toml +++ b/tasks/0125_379_125379106_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_390_125390674_qa_1/environment/bootstrap.sh b/tasks/0125_390_125390674_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_390_125390674_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_390_125390674_qa_1/environment/pull_bucket.py b/tasks/0125_390_125390674_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_390_125390674_qa_1/environment/pull_bucket.py +++ b/tasks/0125_390_125390674_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_390_125390674_qa_1/task.toml b/tasks/0125_390_125390674_qa_1/task.toml index aa58caa304399cce406cd7b7a6e3ece6671f5049..c182c8181d061a5bc52786e925e53e7f48a9c35b 100644 --- a/tasks/0125_390_125390674_qa_1/task.toml +++ b/tasks/0125_390_125390674_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_427_125427363_qa_1/environment/bootstrap.sh b/tasks/0125_427_125427363_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_427_125427363_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_427_125427363_qa_1/environment/pull_bucket.py b/tasks/0125_427_125427363_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_427_125427363_qa_1/environment/pull_bucket.py +++ b/tasks/0125_427_125427363_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_427_125427363_qa_1/task.toml b/tasks/0125_427_125427363_qa_1/task.toml index bc086d3c8b8eb45533b6c303a86fd8aa279ff332..97da2d87f32601bb878cac9634d74636cdd58062 100644 --- a/tasks/0125_427_125427363_qa_1/task.toml +++ b/tasks/0125_427_125427363_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_527_125527676_qa_3/environment/bootstrap.sh b/tasks/0125_527_125527676_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_527_125527676_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_527_125527676_qa_3/environment/pull_bucket.py b/tasks/0125_527_125527676_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_527_125527676_qa_3/environment/pull_bucket.py +++ b/tasks/0125_527_125527676_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_527_125527676_qa_3/task.toml b/tasks/0125_527_125527676_qa_3/task.toml index 5af4bc94406911b9babfcc005def6faf0d61edfb..ebbd4522d1c6f592fd35c66473356b57735e09d9 100644 --- a/tasks/0125_527_125527676_qa_3/task.toml +++ b/tasks/0125_527_125527676_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_537_125537786_qa_2/environment/bootstrap.sh b/tasks/0125_537_125537786_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_537_125537786_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_537_125537786_qa_2/environment/pull_bucket.py b/tasks/0125_537_125537786_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_537_125537786_qa_2/environment/pull_bucket.py +++ b/tasks/0125_537_125537786_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_537_125537786_qa_2/task.toml b/tasks/0125_537_125537786_qa_2/task.toml index 4734861bdc4c31f2cfeece06ab57c50806b3cb2d..50eba92288cb49bf63bd544ca24c609558b31ff0 100644 --- a/tasks/0125_537_125537786_qa_2/task.toml +++ b/tasks/0125_537_125537786_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_537_125537786_qa_3/environment/bootstrap.sh b/tasks/0125_537_125537786_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_537_125537786_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_537_125537786_qa_3/environment/pull_bucket.py b/tasks/0125_537_125537786_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_537_125537786_qa_3/environment/pull_bucket.py +++ b/tasks/0125_537_125537786_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_537_125537786_qa_3/task.toml b/tasks/0125_537_125537786_qa_3/task.toml index 2480f44cd6c6845413a68c32d0acd6c3531177d9..f67c92735ed77831e8d4fdf5ff027b70a04f7a66 100644 --- a/tasks/0125_537_125537786_qa_3/task.toml +++ b/tasks/0125_537_125537786_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_537_125537786_qa_4/environment/bootstrap.sh b/tasks/0125_537_125537786_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_537_125537786_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_537_125537786_qa_4/environment/pull_bucket.py b/tasks/0125_537_125537786_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_537_125537786_qa_4/environment/pull_bucket.py +++ b/tasks/0125_537_125537786_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_537_125537786_qa_4/task.toml b/tasks/0125_537_125537786_qa_4/task.toml index 2931878cc17cbb263dc812c2f4f6f45209c05c23..0ea7688e2f42606a3452cd4d0914e78d6f230c69 100644 --- a/tasks/0125_537_125537786_qa_4/task.toml +++ b/tasks/0125_537_125537786_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_554_125554588_qa_1/environment/bootstrap.sh b/tasks/0125_554_125554588_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_554_125554588_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_554_125554588_qa_1/environment/pull_bucket.py b/tasks/0125_554_125554588_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_554_125554588_qa_1/environment/pull_bucket.py +++ b/tasks/0125_554_125554588_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_554_125554588_qa_1/task.toml b/tasks/0125_554_125554588_qa_1/task.toml index 7be1cda0b1faddb61371b40ea83d2079e3119c41..0b0e1379eba04d24c145a10b45cf1ed823b72b3a 100644 --- a/tasks/0125_554_125554588_qa_1/task.toml +++ b/tasks/0125_554_125554588_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_570_125570065_qa_1/environment/bootstrap.sh b/tasks/0125_570_125570065_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_570_125570065_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_570_125570065_qa_1/environment/pull_bucket.py b/tasks/0125_570_125570065_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_570_125570065_qa_1/environment/pull_bucket.py +++ b/tasks/0125_570_125570065_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_570_125570065_qa_1/task.toml b/tasks/0125_570_125570065_qa_1/task.toml index a0ae242f49bb3b15f4dccf933ccfb1ac62c15b25..2c3ef6c038e7c720507f08f91e8ad3fc9b862c6c 100644 --- a/tasks/0125_570_125570065_qa_1/task.toml +++ b/tasks/0125_570_125570065_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_581_125581362_qa_5/environment/bootstrap.sh b/tasks/0125_581_125581362_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_581_125581362_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_581_125581362_qa_5/environment/pull_bucket.py b/tasks/0125_581_125581362_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_581_125581362_qa_5/environment/pull_bucket.py +++ b/tasks/0125_581_125581362_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_581_125581362_qa_5/task.toml b/tasks/0125_581_125581362_qa_5/task.toml index 5045790c1adb7ed1eeefc57688590ac4d28a2c82..37d5f130701dede7e3b4aad72aaffbe24f3beebe 100644 --- a/tasks/0125_581_125581362_qa_5/task.toml +++ b/tasks/0125_581_125581362_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_603_125603788_qa_2/environment/bootstrap.sh b/tasks/0125_603_125603788_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_603_125603788_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_603_125603788_qa_2/environment/pull_bucket.py b/tasks/0125_603_125603788_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_603_125603788_qa_2/environment/pull_bucket.py +++ b/tasks/0125_603_125603788_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_603_125603788_qa_2/task.toml b/tasks/0125_603_125603788_qa_2/task.toml index ef18e7721f90cfcf2a2c0dcd7d2d0382abc35764..b4e9cae7fd88c79e141319add7f9e28ab1e5fe79 100644 --- a/tasks/0125_603_125603788_qa_2/task.toml +++ b/tasks/0125_603_125603788_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_603_125603788_qa_3/environment/bootstrap.sh b/tasks/0125_603_125603788_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_603_125603788_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_603_125603788_qa_3/environment/pull_bucket.py b/tasks/0125_603_125603788_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_603_125603788_qa_3/environment/pull_bucket.py +++ b/tasks/0125_603_125603788_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_603_125603788_qa_3/task.toml b/tasks/0125_603_125603788_qa_3/task.toml index 5a48b2b182a5aa8a7b784b420fa1e0ae1967d41a..b9e8a6addf13cd93d3dc3e12c91e850d7fd0853e 100644 --- a/tasks/0125_603_125603788_qa_3/task.toml +++ b/tasks/0125_603_125603788_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_624_125624875_qa_1/environment/bootstrap.sh b/tasks/0125_624_125624875_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_624_125624875_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_624_125624875_qa_1/environment/pull_bucket.py b/tasks/0125_624_125624875_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_624_125624875_qa_1/environment/pull_bucket.py +++ b/tasks/0125_624_125624875_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_624_125624875_qa_1/task.toml b/tasks/0125_624_125624875_qa_1/task.toml index 57af02a31baffccfac76113955eb7ef351b7683f..7d5ab3dc40bf4e8b4e37311737ffbb786db835a6 100644 --- a/tasks/0125_624_125624875_qa_1/task.toml +++ b/tasks/0125_624_125624875_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_624_125624875_qa_2/environment/bootstrap.sh b/tasks/0125_624_125624875_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_624_125624875_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_624_125624875_qa_2/environment/pull_bucket.py b/tasks/0125_624_125624875_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_624_125624875_qa_2/environment/pull_bucket.py +++ b/tasks/0125_624_125624875_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_624_125624875_qa_2/task.toml b/tasks/0125_624_125624875_qa_2/task.toml index 7931dedd53575f05d229c9f00e4eeee5c4f0b4a0..056625b60dc1c6fb56f8a5ca667f310a43a126e3 100644 --- a/tasks/0125_624_125624875_qa_2/task.toml +++ b/tasks/0125_624_125624875_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_624_125624875_qa_4/environment/bootstrap.sh b/tasks/0125_624_125624875_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_624_125624875_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_624_125624875_qa_4/environment/pull_bucket.py b/tasks/0125_624_125624875_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_624_125624875_qa_4/environment/pull_bucket.py +++ b/tasks/0125_624_125624875_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_624_125624875_qa_4/task.toml b/tasks/0125_624_125624875_qa_4/task.toml index db0af5cae15f16488726b7b807ca492e3082edbe..432cf84b3ffb8bc472a768728042106d8c1863af 100644 --- a/tasks/0125_624_125624875_qa_4/task.toml +++ b/tasks/0125_624_125624875_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_711_125711051_qa_2/environment/bootstrap.sh b/tasks/0125_711_125711051_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_711_125711051_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_711_125711051_qa_2/environment/pull_bucket.py b/tasks/0125_711_125711051_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_711_125711051_qa_2/environment/pull_bucket.py +++ b/tasks/0125_711_125711051_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_711_125711051_qa_2/task.toml b/tasks/0125_711_125711051_qa_2/task.toml index 60af447ea94e742ea0d486bc2203c88e6d9784a5..64567f74a2753319ab1ee53dc1f4da502928a7f7 100644 --- a/tasks/0125_711_125711051_qa_2/task.toml +++ b/tasks/0125_711_125711051_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_711_125711051_qa_3/environment/bootstrap.sh b/tasks/0125_711_125711051_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_711_125711051_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_711_125711051_qa_3/environment/pull_bucket.py b/tasks/0125_711_125711051_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_711_125711051_qa_3/environment/pull_bucket.py +++ b/tasks/0125_711_125711051_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_711_125711051_qa_3/task.toml b/tasks/0125_711_125711051_qa_3/task.toml index 66e89c9bbd624d0b297a2e286ad7cef62a9e8236..9c93e55bdc489afc94d3c3d437310cde6d7076cd 100644 --- a/tasks/0125_711_125711051_qa_3/task.toml +++ b/tasks/0125_711_125711051_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_941_125941524_qa_1/environment/bootstrap.sh b/tasks/0125_941_125941524_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_941_125941524_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_941_125941524_qa_1/environment/pull_bucket.py b/tasks/0125_941_125941524_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_941_125941524_qa_1/environment/pull_bucket.py +++ b/tasks/0125_941_125941524_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_941_125941524_qa_1/task.toml b/tasks/0125_941_125941524_qa_1/task.toml index 53ef7067661af2c1312f8772508474141f900e35..4d3263adf562779a3e8924584eff35fa7d503ea2 100644 --- a/tasks/0125_941_125941524_qa_1/task.toml +++ b/tasks/0125_941_125941524_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0125_976_125976958_qa_4/environment/bootstrap.sh b/tasks/0125_976_125976958_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0125_976_125976958_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0125_976_125976958_qa_4/environment/pull_bucket.py b/tasks/0125_976_125976958_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0125_976_125976958_qa_4/environment/pull_bucket.py +++ b/tasks/0125_976_125976958_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0125_976_125976958_qa_4/task.toml b/tasks/0125_976_125976958_qa_4/task.toml index 5004ea87f865a4663e29766836bb42e75a135e40..7093f77eaddb52653b14bdfb0ae9c3c365b9e8a4 100644 --- a/tasks/0125_976_125976958_qa_4/task.toml +++ b/tasks/0125_976_125976958_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_018_126018138_qa_2/environment/bootstrap.sh b/tasks/0126_018_126018138_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_018_126018138_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_018_126018138_qa_2/environment/pull_bucket.py b/tasks/0126_018_126018138_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_018_126018138_qa_2/environment/pull_bucket.py +++ b/tasks/0126_018_126018138_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_018_126018138_qa_2/task.toml b/tasks/0126_018_126018138_qa_2/task.toml index d0158eeb48b87a1d0167a608450210b15fc7319d..ad4ebc59ed511b1f4c647e6984227a9785170662 100644 --- a/tasks/0126_018_126018138_qa_2/task.toml +++ b/tasks/0126_018_126018138_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_019_126019687_qa_3/environment/bootstrap.sh b/tasks/0126_019_126019687_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_019_126019687_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_019_126019687_qa_3/environment/pull_bucket.py b/tasks/0126_019_126019687_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_019_126019687_qa_3/environment/pull_bucket.py +++ b/tasks/0126_019_126019687_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_019_126019687_qa_3/task.toml b/tasks/0126_019_126019687_qa_3/task.toml index d7a2e63ef14d8efa53b7e33ea93e6ba2dffc63e6..2ff846d19dfbecf51a4b92acb544b71a82567ed3 100644 --- a/tasks/0126_019_126019687_qa_3/task.toml +++ b/tasks/0126_019_126019687_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_031_126031360_qa_1/environment/bootstrap.sh b/tasks/0126_031_126031360_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_031_126031360_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_031_126031360_qa_1/environment/pull_bucket.py b/tasks/0126_031_126031360_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_031_126031360_qa_1/environment/pull_bucket.py +++ b/tasks/0126_031_126031360_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_031_126031360_qa_1/task.toml b/tasks/0126_031_126031360_qa_1/task.toml index 84a8299bfe49e572e2c91948382ef5eea8119a4f..bfce6faee6c4e24b52b807ff8962d4e06c72c7fc 100644 --- a/tasks/0126_031_126031360_qa_1/task.toml +++ b/tasks/0126_031_126031360_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_066_126066478_qa_1/environment/bootstrap.sh b/tasks/0126_066_126066478_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_066_126066478_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_066_126066478_qa_1/environment/pull_bucket.py b/tasks/0126_066_126066478_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_066_126066478_qa_1/environment/pull_bucket.py +++ b/tasks/0126_066_126066478_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_066_126066478_qa_1/task.toml b/tasks/0126_066_126066478_qa_1/task.toml index 4336fb98c785052b62deca2f569b4300d2a167e8..dcd0e2b59e6d12b3b0c09e2f2f28874120b60cfa 100644 --- a/tasks/0126_066_126066478_qa_1/task.toml +++ b/tasks/0126_066_126066478_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_066_126066478_qa_5/environment/bootstrap.sh b/tasks/0126_066_126066478_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_066_126066478_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_066_126066478_qa_5/environment/pull_bucket.py b/tasks/0126_066_126066478_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_066_126066478_qa_5/environment/pull_bucket.py +++ b/tasks/0126_066_126066478_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_066_126066478_qa_5/task.toml b/tasks/0126_066_126066478_qa_5/task.toml index eebe8c2075ce9b5972f17783498c95c00f56dcb8..a35f0e5e042d79de6372f32c244c5481da773db4 100644 --- a/tasks/0126_066_126066478_qa_5/task.toml +++ b/tasks/0126_066_126066478_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_142_126142729_qa_1/environment/bootstrap.sh b/tasks/0126_142_126142729_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_142_126142729_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_142_126142729_qa_1/environment/pull_bucket.py b/tasks/0126_142_126142729_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_142_126142729_qa_1/environment/pull_bucket.py +++ b/tasks/0126_142_126142729_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_142_126142729_qa_1/task.toml b/tasks/0126_142_126142729_qa_1/task.toml index a6a696d5dbb8dfeb2fe981d8ca74e7d7b5060386..a02ce8ae060458290363a1ff471787900c9d94a1 100644 --- a/tasks/0126_142_126142729_qa_1/task.toml +++ b/tasks/0126_142_126142729_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_180_126180239_qa_1/environment/bootstrap.sh b/tasks/0126_180_126180239_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_180_126180239_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_180_126180239_qa_1/environment/pull_bucket.py b/tasks/0126_180_126180239_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_180_126180239_qa_1/environment/pull_bucket.py +++ b/tasks/0126_180_126180239_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_180_126180239_qa_1/task.toml b/tasks/0126_180_126180239_qa_1/task.toml index 186c28ba6166f4f37c0cec2b849d80b80db2fdb9..5bed1e3fe75a4d9063b45f270291813246115a47 100644 --- a/tasks/0126_180_126180239_qa_1/task.toml +++ b/tasks/0126_180_126180239_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_180_126180239_qa_2/environment/bootstrap.sh b/tasks/0126_180_126180239_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_180_126180239_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_180_126180239_qa_2/environment/pull_bucket.py b/tasks/0126_180_126180239_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_180_126180239_qa_2/environment/pull_bucket.py +++ b/tasks/0126_180_126180239_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_180_126180239_qa_2/task.toml b/tasks/0126_180_126180239_qa_2/task.toml index d6f24adf45b9d606b38a1036a987ec3ad8313341..ac7a488240fcb5d6817c5809d381d4afecb02c09 100644 --- a/tasks/0126_180_126180239_qa_2/task.toml +++ b/tasks/0126_180_126180239_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_259_126259861_qa_2/environment/bootstrap.sh b/tasks/0126_259_126259861_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_259_126259861_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_259_126259861_qa_2/environment/pull_bucket.py b/tasks/0126_259_126259861_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_259_126259861_qa_2/environment/pull_bucket.py +++ b/tasks/0126_259_126259861_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_259_126259861_qa_2/task.toml b/tasks/0126_259_126259861_qa_2/task.toml index 90ef4b783fc16d4f800e59735d3a3a930bd398d4..c51736c2bfec59566b1e3ba1372d332a3a6bf872 100644 --- a/tasks/0126_259_126259861_qa_2/task.toml +++ b/tasks/0126_259_126259861_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_339_126339086_qa_5/environment/bootstrap.sh b/tasks/0126_339_126339086_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_339_126339086_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_339_126339086_qa_5/environment/pull_bucket.py b/tasks/0126_339_126339086_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_339_126339086_qa_5/environment/pull_bucket.py +++ b/tasks/0126_339_126339086_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_339_126339086_qa_5/task.toml b/tasks/0126_339_126339086_qa_5/task.toml index c8b9e895812f4a1d79d12021adfe594fd7a5b290..10d3e3f364e4d38ec9d24f50b3888f62025c2a8f 100644 --- a/tasks/0126_339_126339086_qa_5/task.toml +++ b/tasks/0126_339_126339086_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_584_126584044_qa_3/environment/bootstrap.sh b/tasks/0126_584_126584044_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_584_126584044_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_584_126584044_qa_3/environment/pull_bucket.py b/tasks/0126_584_126584044_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_584_126584044_qa_3/environment/pull_bucket.py +++ b/tasks/0126_584_126584044_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_584_126584044_qa_3/task.toml b/tasks/0126_584_126584044_qa_3/task.toml index 09e2d7f62ba0e9078216130ca03e1e1a77057977..32b61bad7aaf919b9e61566d513a5f87b9860bcb 100644 --- a/tasks/0126_584_126584044_qa_3/task.toml +++ b/tasks/0126_584_126584044_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_687_126687596_qa_4/environment/bootstrap.sh b/tasks/0126_687_126687596_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_687_126687596_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_687_126687596_qa_4/environment/pull_bucket.py b/tasks/0126_687_126687596_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_687_126687596_qa_4/environment/pull_bucket.py +++ b/tasks/0126_687_126687596_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_687_126687596_qa_4/task.toml b/tasks/0126_687_126687596_qa_4/task.toml index 5e9d1de534a9c5dd169f726fb8394ca5c5311975..3ef6d99bf9408e0f3d2bd9cbf48a771b40820f66 100644 --- a/tasks/0126_687_126687596_qa_4/task.toml +++ b/tasks/0126_687_126687596_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_706_126706065_qa_1/environment/bootstrap.sh b/tasks/0126_706_126706065_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_706_126706065_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_706_126706065_qa_1/environment/pull_bucket.py b/tasks/0126_706_126706065_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_706_126706065_qa_1/environment/pull_bucket.py +++ b/tasks/0126_706_126706065_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_706_126706065_qa_1/task.toml b/tasks/0126_706_126706065_qa_1/task.toml index 4adaaa83e3e0c99700aae1f8271d3b0deea5f2d3..cb4852e7e72953dbccacf0effc7ddd0d17a871f8 100644 --- a/tasks/0126_706_126706065_qa_1/task.toml +++ b/tasks/0126_706_126706065_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_706_126706065_qa_3/environment/bootstrap.sh b/tasks/0126_706_126706065_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_706_126706065_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_706_126706065_qa_3/environment/pull_bucket.py b/tasks/0126_706_126706065_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_706_126706065_qa_3/environment/pull_bucket.py +++ b/tasks/0126_706_126706065_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_706_126706065_qa_3/task.toml b/tasks/0126_706_126706065_qa_3/task.toml index ecfa2f5d9640b097cc0474b6b78ca8a9a4152581..8c0e33dffac24d47c81f0a27ae26cdc595e7300a 100644 --- a/tasks/0126_706_126706065_qa_3/task.toml +++ b/tasks/0126_706_126706065_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_746_126746817_qa_1/environment/bootstrap.sh b/tasks/0126_746_126746817_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_746_126746817_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_746_126746817_qa_1/environment/pull_bucket.py b/tasks/0126_746_126746817_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_746_126746817_qa_1/environment/pull_bucket.py +++ b/tasks/0126_746_126746817_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_746_126746817_qa_1/task.toml b/tasks/0126_746_126746817_qa_1/task.toml index c7f942a372faa7d803b47695de11e4bd3c0d3c7b..4af6e6f8deed88de5c8c4979c82885bd9b5e47e6 100644 --- a/tasks/0126_746_126746817_qa_1/task.toml +++ b/tasks/0126_746_126746817_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_747_126747437_qa_2/environment/bootstrap.sh b/tasks/0126_747_126747437_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_747_126747437_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_747_126747437_qa_2/environment/pull_bucket.py b/tasks/0126_747_126747437_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_747_126747437_qa_2/environment/pull_bucket.py +++ b/tasks/0126_747_126747437_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_747_126747437_qa_2/task.toml b/tasks/0126_747_126747437_qa_2/task.toml index 1165cad3b9004f5b4003f2635d40e4ff2e57940d..b70a7f0f08710f22909ed2843edb86261972da38 100644 --- a/tasks/0126_747_126747437_qa_2/task.toml +++ b/tasks/0126_747_126747437_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_841_126841685_qa_1/environment/bootstrap.sh b/tasks/0126_841_126841685_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_841_126841685_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_841_126841685_qa_1/environment/pull_bucket.py b/tasks/0126_841_126841685_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_841_126841685_qa_1/environment/pull_bucket.py +++ b/tasks/0126_841_126841685_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_841_126841685_qa_1/task.toml b/tasks/0126_841_126841685_qa_1/task.toml index 0561e8506312ffcfb3ee73de2eb6c286983330cd..4a25cc046276a22b713ce5330d96d9625038b71a 100644 --- a/tasks/0126_841_126841685_qa_1/task.toml +++ b/tasks/0126_841_126841685_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_841_126841685_qa_2/environment/bootstrap.sh b/tasks/0126_841_126841685_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_841_126841685_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_841_126841685_qa_2/environment/pull_bucket.py b/tasks/0126_841_126841685_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_841_126841685_qa_2/environment/pull_bucket.py +++ b/tasks/0126_841_126841685_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_841_126841685_qa_2/task.toml b/tasks/0126_841_126841685_qa_2/task.toml index efb502e82229b9406997b84522c367067f68f3f7..275e8e1576777784da49f90a81d9ae844952d135 100644 --- a/tasks/0126_841_126841685_qa_2/task.toml +++ b/tasks/0126_841_126841685_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_841_126841685_qa_4/environment/bootstrap.sh b/tasks/0126_841_126841685_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_841_126841685_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_841_126841685_qa_4/environment/pull_bucket.py b/tasks/0126_841_126841685_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_841_126841685_qa_4/environment/pull_bucket.py +++ b/tasks/0126_841_126841685_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_841_126841685_qa_4/task.toml b/tasks/0126_841_126841685_qa_4/task.toml index 0c29242dcc68b68e9b59634e4663a7dd9cd23a2a..d58e548012b358d088e8ba7138cacb6dfef0c18d 100644 --- a/tasks/0126_841_126841685_qa_4/task.toml +++ b/tasks/0126_841_126841685_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_954_126954425_qa_1/environment/bootstrap.sh b/tasks/0126_954_126954425_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_954_126954425_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_954_126954425_qa_1/environment/pull_bucket.py b/tasks/0126_954_126954425_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_954_126954425_qa_1/environment/pull_bucket.py +++ b/tasks/0126_954_126954425_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_954_126954425_qa_1/task.toml b/tasks/0126_954_126954425_qa_1/task.toml index 58014664a5e3e010a329ad2c38d3f4c5335bc66d..bb71e9e64e613f6e0c41df3c0b1df994130379c7 100644 --- a/tasks/0126_954_126954425_qa_1/task.toml +++ b/tasks/0126_954_126954425_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_954_126954425_qa_3/environment/bootstrap.sh b/tasks/0126_954_126954425_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_954_126954425_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_954_126954425_qa_3/environment/pull_bucket.py b/tasks/0126_954_126954425_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_954_126954425_qa_3/environment/pull_bucket.py +++ b/tasks/0126_954_126954425_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_954_126954425_qa_3/task.toml b/tasks/0126_954_126954425_qa_3/task.toml index 8b619c7c5b409d3f4323da3e23dfd998180c66ee..1b00a21b9992251962dbe97256f6825ded02e2f3 100644 --- a/tasks/0126_954_126954425_qa_3/task.toml +++ b/tasks/0126_954_126954425_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_994_126994091_qa_1/environment/bootstrap.sh b/tasks/0126_994_126994091_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_994_126994091_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_994_126994091_qa_1/environment/pull_bucket.py b/tasks/0126_994_126994091_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_994_126994091_qa_1/environment/pull_bucket.py +++ b/tasks/0126_994_126994091_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_994_126994091_qa_1/task.toml b/tasks/0126_994_126994091_qa_1/task.toml index cc3d0e96248edc58f235d154ab102fa6e1840a8c..817c3cefcddd8c63f73ebe7e350c47087909cfc4 100644 --- a/tasks/0126_994_126994091_qa_1/task.toml +++ b/tasks/0126_994_126994091_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0126_994_126994091_qa_5/environment/bootstrap.sh b/tasks/0126_994_126994091_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0126_994_126994091_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0126_994_126994091_qa_5/environment/pull_bucket.py b/tasks/0126_994_126994091_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0126_994_126994091_qa_5/environment/pull_bucket.py +++ b/tasks/0126_994_126994091_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0126_994_126994091_qa_5/task.toml b/tasks/0126_994_126994091_qa_5/task.toml index aa9d1ca0a5d2e0345edf088060bf825bef0fe866..6cc96d26967c0ce334a5ea9d09be9c836ee7fe2b 100644 --- a/tasks/0126_994_126994091_qa_5/task.toml +++ b/tasks/0126_994_126994091_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_099_127099750_qa_5/environment/bootstrap.sh b/tasks/0127_099_127099750_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_099_127099750_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_099_127099750_qa_5/environment/pull_bucket.py b/tasks/0127_099_127099750_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_099_127099750_qa_5/environment/pull_bucket.py +++ b/tasks/0127_099_127099750_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_099_127099750_qa_5/task.toml b/tasks/0127_099_127099750_qa_5/task.toml index 810788a98eff93212e629f5e42ea7192e0038eb0..3165539c62e9d89b8dd603257a52cfa558a900a1 100644 --- a/tasks/0127_099_127099750_qa_5/task.toml +++ b/tasks/0127_099_127099750_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_137_127137875_qa_4/environment/bootstrap.sh b/tasks/0127_137_127137875_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_137_127137875_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_137_127137875_qa_4/environment/pull_bucket.py b/tasks/0127_137_127137875_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_137_127137875_qa_4/environment/pull_bucket.py +++ b/tasks/0127_137_127137875_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_137_127137875_qa_4/task.toml b/tasks/0127_137_127137875_qa_4/task.toml index b3da1271c0f56648db9efb61e50f6ec8de76372c..17596f2e7f56e1decdc348f326ea70fcdb66ed78 100644 --- a/tasks/0127_137_127137875_qa_4/task.toml +++ b/tasks/0127_137_127137875_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_268_127268138_qa_1/environment/bootstrap.sh b/tasks/0127_268_127268138_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_268_127268138_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_268_127268138_qa_1/environment/pull_bucket.py b/tasks/0127_268_127268138_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_268_127268138_qa_1/environment/pull_bucket.py +++ b/tasks/0127_268_127268138_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_268_127268138_qa_1/task.toml b/tasks/0127_268_127268138_qa_1/task.toml index 1b3090774631d1b621def6a7db7ee444c0f25dab..2024658b69121954263341cccaa91807a62eeae1 100644 --- a/tasks/0127_268_127268138_qa_1/task.toml +++ b/tasks/0127_268_127268138_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_275_127275270_qa_1/environment/bootstrap.sh b/tasks/0127_275_127275270_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_275_127275270_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_275_127275270_qa_1/environment/pull_bucket.py b/tasks/0127_275_127275270_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_275_127275270_qa_1/environment/pull_bucket.py +++ b/tasks/0127_275_127275270_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_275_127275270_qa_1/task.toml b/tasks/0127_275_127275270_qa_1/task.toml index b2533a01ecaa92999c74d20cd670e33cd5495208..13d2328e459e7e04c9c41171a86997671cc964a1 100644 --- a/tasks/0127_275_127275270_qa_1/task.toml +++ b/tasks/0127_275_127275270_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_275_127275270_qa_5/environment/bootstrap.sh b/tasks/0127_275_127275270_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_275_127275270_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_275_127275270_qa_5/environment/pull_bucket.py b/tasks/0127_275_127275270_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_275_127275270_qa_5/environment/pull_bucket.py +++ b/tasks/0127_275_127275270_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_275_127275270_qa_5/task.toml b/tasks/0127_275_127275270_qa_5/task.toml index 5c840a3a6c5f8cc0d7e1c93e8125a1acff314ceb..e82301a571fac114424f6241350d8eb9a39cd40e 100644 --- a/tasks/0127_275_127275270_qa_5/task.toml +++ b/tasks/0127_275_127275270_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_323_127323479_qa_1/environment/bootstrap.sh b/tasks/0127_323_127323479_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_323_127323479_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_323_127323479_qa_1/environment/pull_bucket.py b/tasks/0127_323_127323479_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_323_127323479_qa_1/environment/pull_bucket.py +++ b/tasks/0127_323_127323479_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_323_127323479_qa_1/task.toml b/tasks/0127_323_127323479_qa_1/task.toml index 56bd65d9e65b14e99368d51473b90c747ef5e8ad..8827083e94b9a00ce6f4ed9a6ec4875cfcd4d424 100644 --- a/tasks/0127_323_127323479_qa_1/task.toml +++ b/tasks/0127_323_127323479_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_323_127323479_qa_2/environment/bootstrap.sh b/tasks/0127_323_127323479_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_323_127323479_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_323_127323479_qa_2/environment/pull_bucket.py b/tasks/0127_323_127323479_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_323_127323479_qa_2/environment/pull_bucket.py +++ b/tasks/0127_323_127323479_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_323_127323479_qa_2/task.toml b/tasks/0127_323_127323479_qa_2/task.toml index 1712a852cf395e2fd0ed1cb607b3e16b36225554..faeeb50cba2fdc43d9d9e7fc125e53bcfb7be608 100644 --- a/tasks/0127_323_127323479_qa_2/task.toml +++ b/tasks/0127_323_127323479_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_323_127323479_qa_3/environment/bootstrap.sh b/tasks/0127_323_127323479_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_323_127323479_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_323_127323479_qa_3/environment/pull_bucket.py b/tasks/0127_323_127323479_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_323_127323479_qa_3/environment/pull_bucket.py +++ b/tasks/0127_323_127323479_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_323_127323479_qa_3/task.toml b/tasks/0127_323_127323479_qa_3/task.toml index bb8b206ed60058040dab0872931eda65ab42983b..5d12f7a544847729a3256c180d22245935326069 100644 --- a/tasks/0127_323_127323479_qa_3/task.toml +++ b/tasks/0127_323_127323479_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_323_127323479_qa_5/environment/bootstrap.sh b/tasks/0127_323_127323479_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_323_127323479_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_323_127323479_qa_5/environment/pull_bucket.py b/tasks/0127_323_127323479_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_323_127323479_qa_5/environment/pull_bucket.py +++ b/tasks/0127_323_127323479_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_323_127323479_qa_5/task.toml b/tasks/0127_323_127323479_qa_5/task.toml index 3c53a120b653a276807e11e798b0e8bac9005a3a..c1bce292420a7b5552aaecde13f3a8524949b713 100644 --- a/tasks/0127_323_127323479_qa_5/task.toml +++ b/tasks/0127_323_127323479_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_374_127374855_qa_4/environment/bootstrap.sh b/tasks/0127_374_127374855_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_374_127374855_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_374_127374855_qa_4/environment/pull_bucket.py b/tasks/0127_374_127374855_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_374_127374855_qa_4/environment/pull_bucket.py +++ b/tasks/0127_374_127374855_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_374_127374855_qa_4/task.toml b/tasks/0127_374_127374855_qa_4/task.toml index 736a8223dc24d53b1d4151f78d31aae4cade07aa..5e71273329af1a5882660a8779d6b59eee7bbfdf 100644 --- a/tasks/0127_374_127374855_qa_4/task.toml +++ b/tasks/0127_374_127374855_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_385_127385378_qa_2/environment/bootstrap.sh b/tasks/0127_385_127385378_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_385_127385378_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_385_127385378_qa_2/environment/pull_bucket.py b/tasks/0127_385_127385378_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_385_127385378_qa_2/environment/pull_bucket.py +++ b/tasks/0127_385_127385378_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_385_127385378_qa_2/task.toml b/tasks/0127_385_127385378_qa_2/task.toml index 2536c4a0af8ef3ffa2c0ed15f1721d5801b8590b..59c2d9d5a921dbadedb75b663b35010282d77182 100644 --- a/tasks/0127_385_127385378_qa_2/task.toml +++ b/tasks/0127_385_127385378_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_467_127467979_qa_1/environment/bootstrap.sh b/tasks/0127_467_127467979_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_467_127467979_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_467_127467979_qa_1/environment/pull_bucket.py b/tasks/0127_467_127467979_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_467_127467979_qa_1/environment/pull_bucket.py +++ b/tasks/0127_467_127467979_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_467_127467979_qa_1/task.toml b/tasks/0127_467_127467979_qa_1/task.toml index 1ff7072774a13d0bedb82ad3b06bc3ad4a30ad66..74342807d2b7b560aa99cc15b093e93e87663b73 100644 --- a/tasks/0127_467_127467979_qa_1/task.toml +++ b/tasks/0127_467_127467979_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_467_127467979_qa_4/environment/bootstrap.sh b/tasks/0127_467_127467979_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_467_127467979_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_467_127467979_qa_4/environment/pull_bucket.py b/tasks/0127_467_127467979_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_467_127467979_qa_4/environment/pull_bucket.py +++ b/tasks/0127_467_127467979_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_467_127467979_qa_4/task.toml b/tasks/0127_467_127467979_qa_4/task.toml index 367092e749fe6bc4aa67bb99d834921780975b0d..9bd850447bc9d75d8666c4ad0d6fc3d95f393e2c 100644 --- a/tasks/0127_467_127467979_qa_4/task.toml +++ b/tasks/0127_467_127467979_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_499_127499735_qa_5/environment/bootstrap.sh b/tasks/0127_499_127499735_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_499_127499735_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_499_127499735_qa_5/environment/pull_bucket.py b/tasks/0127_499_127499735_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_499_127499735_qa_5/environment/pull_bucket.py +++ b/tasks/0127_499_127499735_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_499_127499735_qa_5/task.toml b/tasks/0127_499_127499735_qa_5/task.toml index 64bb4705d02853998f1e503329c382885cc77c5e..3a72f1d5a427017d8d7a562299e557d55a421e6f 100644 --- a/tasks/0127_499_127499735_qa_5/task.toml +++ b/tasks/0127_499_127499735_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_501_127501399_qa_2/environment/bootstrap.sh b/tasks/0127_501_127501399_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_501_127501399_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_501_127501399_qa_2/environment/pull_bucket.py b/tasks/0127_501_127501399_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_501_127501399_qa_2/environment/pull_bucket.py +++ b/tasks/0127_501_127501399_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_501_127501399_qa_2/task.toml b/tasks/0127_501_127501399_qa_2/task.toml index 776b5db7cd7df0c6ded7ff714ece90f5a88a0f75..3f3b769ed84310cf2a4db9c6036b5a2cc5ccab63 100644 --- a/tasks/0127_501_127501399_qa_2/task.toml +++ b/tasks/0127_501_127501399_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_501_127501399_qa_3/environment/bootstrap.sh b/tasks/0127_501_127501399_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_501_127501399_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_501_127501399_qa_3/environment/pull_bucket.py b/tasks/0127_501_127501399_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_501_127501399_qa_3/environment/pull_bucket.py +++ b/tasks/0127_501_127501399_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_501_127501399_qa_3/task.toml b/tasks/0127_501_127501399_qa_3/task.toml index 5ca497eb847936b2b0970f8fe4ce2a16f87f8de6..074551932bc0d6b221dca82747a0bc5ebeb7b46d 100644 --- a/tasks/0127_501_127501399_qa_3/task.toml +++ b/tasks/0127_501_127501399_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_535_127535783_qa_4/environment/bootstrap.sh b/tasks/0127_535_127535783_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_535_127535783_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_535_127535783_qa_4/environment/pull_bucket.py b/tasks/0127_535_127535783_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_535_127535783_qa_4/environment/pull_bucket.py +++ b/tasks/0127_535_127535783_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_535_127535783_qa_4/task.toml b/tasks/0127_535_127535783_qa_4/task.toml index 7d1030181758f0a745fd2aa1f7a931912bdea99e..626dad7171b9b48db33b761b9fa229b31fa44b7e 100644 --- a/tasks/0127_535_127535783_qa_4/task.toml +++ b/tasks/0127_535_127535783_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_585_127585527_qa_4/environment/bootstrap.sh b/tasks/0127_585_127585527_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_585_127585527_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_585_127585527_qa_4/environment/pull_bucket.py b/tasks/0127_585_127585527_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_585_127585527_qa_4/environment/pull_bucket.py +++ b/tasks/0127_585_127585527_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_585_127585527_qa_4/task.toml b/tasks/0127_585_127585527_qa_4/task.toml index 268af8ce730806116bf68c3fc7878d5cfef3c38f..d3dd4ac5a013c90d11c82d44b64f4a7ef95c3085 100644 --- a/tasks/0127_585_127585527_qa_4/task.toml +++ b/tasks/0127_585_127585527_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_699_127699013_qa_1/environment/bootstrap.sh b/tasks/0127_699_127699013_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_699_127699013_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_699_127699013_qa_1/environment/pull_bucket.py b/tasks/0127_699_127699013_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_699_127699013_qa_1/environment/pull_bucket.py +++ b/tasks/0127_699_127699013_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_699_127699013_qa_1/task.toml b/tasks/0127_699_127699013_qa_1/task.toml index 10f4eebc177a78bfd19ba1668ede28801b39e046..680784bac137a6f5e698ef662f73db96276827cd 100644 --- a/tasks/0127_699_127699013_qa_1/task.toml +++ b/tasks/0127_699_127699013_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_699_127699013_qa_2/environment/bootstrap.sh b/tasks/0127_699_127699013_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_699_127699013_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_699_127699013_qa_2/environment/pull_bucket.py b/tasks/0127_699_127699013_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_699_127699013_qa_2/environment/pull_bucket.py +++ b/tasks/0127_699_127699013_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_699_127699013_qa_2/task.toml b/tasks/0127_699_127699013_qa_2/task.toml index 322d36e2e3139dd9d7bd87720975cfa46d3b675d..7e2e99c679e0d0a87edb0e9cc3b9e7d59e4da59b 100644 --- a/tasks/0127_699_127699013_qa_2/task.toml +++ b/tasks/0127_699_127699013_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_768_127768301_qa_3/environment/bootstrap.sh b/tasks/0127_768_127768301_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_768_127768301_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_768_127768301_qa_3/environment/pull_bucket.py b/tasks/0127_768_127768301_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_768_127768301_qa_3/environment/pull_bucket.py +++ b/tasks/0127_768_127768301_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_768_127768301_qa_3/task.toml b/tasks/0127_768_127768301_qa_3/task.toml index 9f59a6058e2e3be3c42bede37815f5120ba59080..3d2da4da77ac0270197aede3d05e88795a4e924b 100644 --- a/tasks/0127_768_127768301_qa_3/task.toml +++ b/tasks/0127_768_127768301_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_775_127775252_qa_3/environment/bootstrap.sh b/tasks/0127_775_127775252_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_775_127775252_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_775_127775252_qa_3/environment/pull_bucket.py b/tasks/0127_775_127775252_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_775_127775252_qa_3/environment/pull_bucket.py +++ b/tasks/0127_775_127775252_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_775_127775252_qa_3/task.toml b/tasks/0127_775_127775252_qa_3/task.toml index 47902148e2bd81431da88e8bc59ddac5239b848a..90a2654bc0dc77a51fa653663393945ff4ee0064 100644 --- a/tasks/0127_775_127775252_qa_3/task.toml +++ b/tasks/0127_775_127775252_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_775_127775252_qa_4/environment/bootstrap.sh b/tasks/0127_775_127775252_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_775_127775252_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_775_127775252_qa_4/environment/pull_bucket.py b/tasks/0127_775_127775252_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_775_127775252_qa_4/environment/pull_bucket.py +++ b/tasks/0127_775_127775252_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_775_127775252_qa_4/task.toml b/tasks/0127_775_127775252_qa_4/task.toml index e4aa5941b4e1d09b503d98700f1d58dd62c97b80..c1fb7b3794a22991a8c02e92b2ebb1f799557070 100644 --- a/tasks/0127_775_127775252_qa_4/task.toml +++ b/tasks/0127_775_127775252_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_821_127821175_qa_1/environment/bootstrap.sh b/tasks/0127_821_127821175_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_821_127821175_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_821_127821175_qa_1/environment/pull_bucket.py b/tasks/0127_821_127821175_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_821_127821175_qa_1/environment/pull_bucket.py +++ b/tasks/0127_821_127821175_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_821_127821175_qa_1/task.toml b/tasks/0127_821_127821175_qa_1/task.toml index 6d5bd11766ed2f751f752a3ef540cc12c4b1ab6c..6e1d7cf8622bf63e24f70ab5b00873265441fdb1 100644 --- a/tasks/0127_821_127821175_qa_1/task.toml +++ b/tasks/0127_821_127821175_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_821_127821175_qa_4/environment/bootstrap.sh b/tasks/0127_821_127821175_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_821_127821175_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_821_127821175_qa_4/environment/pull_bucket.py b/tasks/0127_821_127821175_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_821_127821175_qa_4/environment/pull_bucket.py +++ b/tasks/0127_821_127821175_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_821_127821175_qa_4/task.toml b/tasks/0127_821_127821175_qa_4/task.toml index 97d1aa7fed7374258adc69b30da9c0fb50bc9631..c0c2fee357a4711c2150286e0a3b57ee51f6caaa 100644 --- a/tasks/0127_821_127821175_qa_4/task.toml +++ b/tasks/0127_821_127821175_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_846_127846412_qa_2/environment/bootstrap.sh b/tasks/0127_846_127846412_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_846_127846412_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_846_127846412_qa_2/environment/pull_bucket.py b/tasks/0127_846_127846412_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_846_127846412_qa_2/environment/pull_bucket.py +++ b/tasks/0127_846_127846412_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_846_127846412_qa_2/task.toml b/tasks/0127_846_127846412_qa_2/task.toml index b41e1a4a1579aa570e66c7cdba7a294fea682667..34f11a60ea15ec3cf621a7d41fd827dfee94c711 100644 --- a/tasks/0127_846_127846412_qa_2/task.toml +++ b/tasks/0127_846_127846412_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0127_857_127857440_qa_4/environment/bootstrap.sh b/tasks/0127_857_127857440_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0127_857_127857440_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0127_857_127857440_qa_4/environment/pull_bucket.py b/tasks/0127_857_127857440_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0127_857_127857440_qa_4/environment/pull_bucket.py +++ b/tasks/0127_857_127857440_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0127_857_127857440_qa_4/task.toml b/tasks/0127_857_127857440_qa_4/task.toml index 469afdc3d3e59b00ff234b12205cda3a29ac8d00..5adde7716ab90ca739cd1c28d7dc20902ddb4802 100644 --- a/tasks/0127_857_127857440_qa_4/task.toml +++ b/tasks/0127_857_127857440_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_054_128054394_qa_2/environment/bootstrap.sh b/tasks/0128_054_128054394_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_054_128054394_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_054_128054394_qa_2/environment/pull_bucket.py b/tasks/0128_054_128054394_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_054_128054394_qa_2/environment/pull_bucket.py +++ b/tasks/0128_054_128054394_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_054_128054394_qa_2/task.toml b/tasks/0128_054_128054394_qa_2/task.toml index eb8e164351d3abe166608f70599c63d26a7fa764..f73054b9285392faf63d588b7da39ba937b5c1ce 100644 --- a/tasks/0128_054_128054394_qa_2/task.toml +++ b/tasks/0128_054_128054394_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_054_128054394_qa_3/environment/bootstrap.sh b/tasks/0128_054_128054394_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_054_128054394_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_054_128054394_qa_3/environment/pull_bucket.py b/tasks/0128_054_128054394_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_054_128054394_qa_3/environment/pull_bucket.py +++ b/tasks/0128_054_128054394_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_054_128054394_qa_3/task.toml b/tasks/0128_054_128054394_qa_3/task.toml index 507958ccee4ec74e5ad565710136cec1f4f23878..87fd9fe97bdf31de817adbb7c0542c81a9397de5 100644 --- a/tasks/0128_054_128054394_qa_3/task.toml +++ b/tasks/0128_054_128054394_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_083_128083387_qa_3/environment/bootstrap.sh b/tasks/0128_083_128083387_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_083_128083387_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_083_128083387_qa_3/environment/pull_bucket.py b/tasks/0128_083_128083387_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_083_128083387_qa_3/environment/pull_bucket.py +++ b/tasks/0128_083_128083387_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_083_128083387_qa_3/task.toml b/tasks/0128_083_128083387_qa_3/task.toml index e061aa3e60ce55b14b87ccb520aeb5ba57e1c7ba..15b9fdbe9430aef27b0f07da0da73d4d54a09986 100644 --- a/tasks/0128_083_128083387_qa_3/task.toml +++ b/tasks/0128_083_128083387_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_173_128173004_qa_2/environment/bootstrap.sh b/tasks/0128_173_128173004_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_173_128173004_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_173_128173004_qa_2/environment/pull_bucket.py b/tasks/0128_173_128173004_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_173_128173004_qa_2/environment/pull_bucket.py +++ b/tasks/0128_173_128173004_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_173_128173004_qa_2/task.toml b/tasks/0128_173_128173004_qa_2/task.toml index 6ba39bb5eb180f53ee2dcbe0238faddf93b93600..ab642db9869f6389c11bfd7a7348dd8863e0b7a0 100644 --- a/tasks/0128_173_128173004_qa_2/task.toml +++ b/tasks/0128_173_128173004_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_245_128245432_qa_2/environment/bootstrap.sh b/tasks/0128_245_128245432_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_245_128245432_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_245_128245432_qa_2/environment/pull_bucket.py b/tasks/0128_245_128245432_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_245_128245432_qa_2/environment/pull_bucket.py +++ b/tasks/0128_245_128245432_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_245_128245432_qa_2/task.toml b/tasks/0128_245_128245432_qa_2/task.toml index a23ca9afe6ad00e73a1f534e9572a00c41afd008..99172dbb60ca67351ffb3beee06aa8be9bd8a2f3 100644 --- a/tasks/0128_245_128245432_qa_2/task.toml +++ b/tasks/0128_245_128245432_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_372_128372155_qa_4/environment/bootstrap.sh b/tasks/0128_372_128372155_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_372_128372155_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_372_128372155_qa_4/environment/pull_bucket.py b/tasks/0128_372_128372155_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_372_128372155_qa_4/environment/pull_bucket.py +++ b/tasks/0128_372_128372155_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_372_128372155_qa_4/task.toml b/tasks/0128_372_128372155_qa_4/task.toml index 31976c35197937f965849a5a0d884e309ebb4303..42282ff73301f42ad9aac0ad438ee9b419c87dca 100644 --- a/tasks/0128_372_128372155_qa_4/task.toml +++ b/tasks/0128_372_128372155_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_396_128396066_qa_1/environment/bootstrap.sh b/tasks/0128_396_128396066_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_396_128396066_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_396_128396066_qa_1/environment/pull_bucket.py b/tasks/0128_396_128396066_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_396_128396066_qa_1/environment/pull_bucket.py +++ b/tasks/0128_396_128396066_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_396_128396066_qa_1/task.toml b/tasks/0128_396_128396066_qa_1/task.toml index 0d5deda4b09d26f470805a5966d767fd087c438d..e77155586a47d9991fcd216a4798900de141c347 100644 --- a/tasks/0128_396_128396066_qa_1/task.toml +++ b/tasks/0128_396_128396066_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_435_128435180_qa_1/environment/bootstrap.sh b/tasks/0128_435_128435180_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_435_128435180_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_435_128435180_qa_1/environment/pull_bucket.py b/tasks/0128_435_128435180_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_435_128435180_qa_1/environment/pull_bucket.py +++ b/tasks/0128_435_128435180_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_435_128435180_qa_1/task.toml b/tasks/0128_435_128435180_qa_1/task.toml index c7860f4cb7efd97aabff1521c43b689880dd919f..a96bed2cadc135962d9425d3caf1bce1b58deeb5 100644 --- a/tasks/0128_435_128435180_qa_1/task.toml +++ b/tasks/0128_435_128435180_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_435_128435180_qa_3/environment/bootstrap.sh b/tasks/0128_435_128435180_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_435_128435180_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_435_128435180_qa_3/environment/pull_bucket.py b/tasks/0128_435_128435180_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_435_128435180_qa_3/environment/pull_bucket.py +++ b/tasks/0128_435_128435180_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_435_128435180_qa_3/task.toml b/tasks/0128_435_128435180_qa_3/task.toml index ed64d0f8cedc623aa8f6bc67cbe625b4f89cf86d..4e5248c0ee961bbde090510abf34e55ff1e7ffa4 100644 --- a/tasks/0128_435_128435180_qa_3/task.toml +++ b/tasks/0128_435_128435180_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_446_128446383_qa_3/environment/bootstrap.sh b/tasks/0128_446_128446383_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_446_128446383_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_446_128446383_qa_3/environment/pull_bucket.py b/tasks/0128_446_128446383_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_446_128446383_qa_3/environment/pull_bucket.py +++ b/tasks/0128_446_128446383_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_446_128446383_qa_3/task.toml b/tasks/0128_446_128446383_qa_3/task.toml index 0245d2bee90c12128ba5ad730a079de879d29107..cf0bb5af04ea291717f78aef2ef1396860d3c5db 100644 --- a/tasks/0128_446_128446383_qa_3/task.toml +++ b/tasks/0128_446_128446383_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_467_128467242_qa_1/environment/bootstrap.sh b/tasks/0128_467_128467242_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_467_128467242_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_467_128467242_qa_1/environment/pull_bucket.py b/tasks/0128_467_128467242_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_467_128467242_qa_1/environment/pull_bucket.py +++ b/tasks/0128_467_128467242_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_467_128467242_qa_1/task.toml b/tasks/0128_467_128467242_qa_1/task.toml index 5ec7d87127e1cc60591921488911ae4e85c6569b..e6e42c5ff5ce79f0c474b87fb339af256f284656 100644 --- a/tasks/0128_467_128467242_qa_1/task.toml +++ b/tasks/0128_467_128467242_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_467_128467242_qa_5/environment/bootstrap.sh b/tasks/0128_467_128467242_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_467_128467242_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_467_128467242_qa_5/environment/pull_bucket.py b/tasks/0128_467_128467242_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_467_128467242_qa_5/environment/pull_bucket.py +++ b/tasks/0128_467_128467242_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_467_128467242_qa_5/task.toml b/tasks/0128_467_128467242_qa_5/task.toml index 12fbc17ed374aa485ad9d9532280663d77f4d20b..b2450479259518c450887a917ac558459852969d 100644 --- a/tasks/0128_467_128467242_qa_5/task.toml +++ b/tasks/0128_467_128467242_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_485_128485352_qa_1/environment/bootstrap.sh b/tasks/0128_485_128485352_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_485_128485352_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_485_128485352_qa_1/environment/pull_bucket.py b/tasks/0128_485_128485352_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_485_128485352_qa_1/environment/pull_bucket.py +++ b/tasks/0128_485_128485352_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_485_128485352_qa_1/task.toml b/tasks/0128_485_128485352_qa_1/task.toml index d6eb8aa744282bb304e48fd86cf588a66ee0ff00..7810aa6ef9ef76f368b59cbbdd74e5f372c19d06 100644 --- a/tasks/0128_485_128485352_qa_1/task.toml +++ b/tasks/0128_485_128485352_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_538_128538835_qa_1/environment/bootstrap.sh b/tasks/0128_538_128538835_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_538_128538835_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_538_128538835_qa_1/environment/pull_bucket.py b/tasks/0128_538_128538835_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_538_128538835_qa_1/environment/pull_bucket.py +++ b/tasks/0128_538_128538835_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_538_128538835_qa_1/task.toml b/tasks/0128_538_128538835_qa_1/task.toml index 7c214f83b9f433fc60ac3197018b20b3624091e8..1522244b9cd3b6a453e52e5e541b7904dcbde195 100644 --- a/tasks/0128_538_128538835_qa_1/task.toml +++ b/tasks/0128_538_128538835_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_538_128538835_qa_5/environment/bootstrap.sh b/tasks/0128_538_128538835_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_538_128538835_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_538_128538835_qa_5/environment/pull_bucket.py b/tasks/0128_538_128538835_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_538_128538835_qa_5/environment/pull_bucket.py +++ b/tasks/0128_538_128538835_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_538_128538835_qa_5/task.toml b/tasks/0128_538_128538835_qa_5/task.toml index b8f151d4c297cb074a5dce5db3c04e752a7e0de2..2acdfcd6d634fd37130a7f1a47576211b9596baa 100644 --- a/tasks/0128_538_128538835_qa_5/task.toml +++ b/tasks/0128_538_128538835_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_624_128624067_qa_1/environment/bootstrap.sh b/tasks/0128_624_128624067_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_624_128624067_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_624_128624067_qa_1/environment/pull_bucket.py b/tasks/0128_624_128624067_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_624_128624067_qa_1/environment/pull_bucket.py +++ b/tasks/0128_624_128624067_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_624_128624067_qa_1/task.toml b/tasks/0128_624_128624067_qa_1/task.toml index 1ee9c71b83f1bbacd87d5b5ff952bfb3dfb5e495..f6c39da9cbb7a8aecec62da5adab0f46d3ebd68a 100644 --- a/tasks/0128_624_128624067_qa_1/task.toml +++ b/tasks/0128_624_128624067_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_624_128624067_qa_3/environment/bootstrap.sh b/tasks/0128_624_128624067_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_624_128624067_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_624_128624067_qa_3/environment/pull_bucket.py b/tasks/0128_624_128624067_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_624_128624067_qa_3/environment/pull_bucket.py +++ b/tasks/0128_624_128624067_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_624_128624067_qa_3/task.toml b/tasks/0128_624_128624067_qa_3/task.toml index 64096b1fcb1766a6c8e8b92312ac040c081413eb..3a749da9337808fe052b9295d73180912c7dd0c5 100644 --- a/tasks/0128_624_128624067_qa_3/task.toml +++ b/tasks/0128_624_128624067_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_655_128655611_qa_4/environment/bootstrap.sh b/tasks/0128_655_128655611_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_655_128655611_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_655_128655611_qa_4/environment/pull_bucket.py b/tasks/0128_655_128655611_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_655_128655611_qa_4/environment/pull_bucket.py +++ b/tasks/0128_655_128655611_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_655_128655611_qa_4/task.toml b/tasks/0128_655_128655611_qa_4/task.toml index cf7098b64261506358841d411afe29cd5cfbb4e0..dc4f8c3762134c26a6f3c5cd5f985cc92a98791b 100644 --- a/tasks/0128_655_128655611_qa_4/task.toml +++ b/tasks/0128_655_128655611_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_659_128659556_qa_1/environment/bootstrap.sh b/tasks/0128_659_128659556_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_659_128659556_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_659_128659556_qa_1/environment/pull_bucket.py b/tasks/0128_659_128659556_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_659_128659556_qa_1/environment/pull_bucket.py +++ b/tasks/0128_659_128659556_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_659_128659556_qa_1/task.toml b/tasks/0128_659_128659556_qa_1/task.toml index ad1afe46809d73db3e45c113936df1df838bb123..bf6026efdde4d2cd9fc286dcff56dbc2f2d964ba 100644 --- a/tasks/0128_659_128659556_qa_1/task.toml +++ b/tasks/0128_659_128659556_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_659_128659556_qa_3/environment/bootstrap.sh b/tasks/0128_659_128659556_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_659_128659556_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_659_128659556_qa_3/environment/pull_bucket.py b/tasks/0128_659_128659556_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_659_128659556_qa_3/environment/pull_bucket.py +++ b/tasks/0128_659_128659556_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_659_128659556_qa_3/task.toml b/tasks/0128_659_128659556_qa_3/task.toml index b929c231fd830e9a0762d6447339e3ba8d7f021b..8eb53bf5e710b777e64f4ce447fc9961e6da2946 100644 --- a/tasks/0128_659_128659556_qa_3/task.toml +++ b/tasks/0128_659_128659556_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_674_128674427_qa_5/environment/bootstrap.sh b/tasks/0128_674_128674427_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_674_128674427_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_674_128674427_qa_5/environment/pull_bucket.py b/tasks/0128_674_128674427_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_674_128674427_qa_5/environment/pull_bucket.py +++ b/tasks/0128_674_128674427_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_674_128674427_qa_5/task.toml b/tasks/0128_674_128674427_qa_5/task.toml index 2ec6954585b5902c30c0c9b288f1b1f65725bce3..6eca71007948627302874affdffffa203222719a 100644 --- a/tasks/0128_674_128674427_qa_5/task.toml +++ b/tasks/0128_674_128674427_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_693_128693147_qa_4/environment/bootstrap.sh b/tasks/0128_693_128693147_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_693_128693147_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_693_128693147_qa_4/environment/pull_bucket.py b/tasks/0128_693_128693147_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_693_128693147_qa_4/environment/pull_bucket.py +++ b/tasks/0128_693_128693147_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_693_128693147_qa_4/task.toml b/tasks/0128_693_128693147_qa_4/task.toml index 7ec41b740831e9e053e8782a271fb1c5273ea407..e55528799b7f728444e58d7844d9e00a5ea2a2fd 100644 --- a/tasks/0128_693_128693147_qa_4/task.toml +++ b/tasks/0128_693_128693147_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_750_128750159_qa_2/environment/bootstrap.sh b/tasks/0128_750_128750159_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_750_128750159_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_750_128750159_qa_2/environment/pull_bucket.py b/tasks/0128_750_128750159_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_750_128750159_qa_2/environment/pull_bucket.py +++ b/tasks/0128_750_128750159_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_750_128750159_qa_2/task.toml b/tasks/0128_750_128750159_qa_2/task.toml index a6f298889be952de75d76c05dfed967105557008..8c671ac5ad1cf03bc6214a533bc8e716494405b4 100644 --- a/tasks/0128_750_128750159_qa_2/task.toml +++ b/tasks/0128_750_128750159_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_750_128750159_qa_3/environment/bootstrap.sh b/tasks/0128_750_128750159_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_750_128750159_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_750_128750159_qa_3/environment/pull_bucket.py b/tasks/0128_750_128750159_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_750_128750159_qa_3/environment/pull_bucket.py +++ b/tasks/0128_750_128750159_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_750_128750159_qa_3/task.toml b/tasks/0128_750_128750159_qa_3/task.toml index 13ac3b0f500e1f45bf10d935cf0b1d46b94254d9..39868ce6898c70f1a0694af558a18c86f372d6c9 100644 --- a/tasks/0128_750_128750159_qa_3/task.toml +++ b/tasks/0128_750_128750159_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_778_128778053_qa_1/environment/bootstrap.sh b/tasks/0128_778_128778053_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_778_128778053_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_778_128778053_qa_1/environment/pull_bucket.py b/tasks/0128_778_128778053_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_778_128778053_qa_1/environment/pull_bucket.py +++ b/tasks/0128_778_128778053_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_778_128778053_qa_1/task.toml b/tasks/0128_778_128778053_qa_1/task.toml index 00165f0923cd17a5e6ef11e606d301d6b81a2e60..8782164882515dd2a2d3c0e29e30ef5724f71545 100644 --- a/tasks/0128_778_128778053_qa_1/task.toml +++ b/tasks/0128_778_128778053_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_784_128784919_qa_5/environment/bootstrap.sh b/tasks/0128_784_128784919_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_784_128784919_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_784_128784919_qa_5/environment/pull_bucket.py b/tasks/0128_784_128784919_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_784_128784919_qa_5/environment/pull_bucket.py +++ b/tasks/0128_784_128784919_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_784_128784919_qa_5/task.toml b/tasks/0128_784_128784919_qa_5/task.toml index 5f717d0f85f9556b5489b32617715e944c1f4e42..07357959bd156eea2f54691b60f64e40a40b6736 100644 --- a/tasks/0128_784_128784919_qa_5/task.toml +++ b/tasks/0128_784_128784919_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_884_128884819_qa_1/environment/bootstrap.sh b/tasks/0128_884_128884819_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_884_128884819_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_884_128884819_qa_1/environment/pull_bucket.py b/tasks/0128_884_128884819_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_884_128884819_qa_1/environment/pull_bucket.py +++ b/tasks/0128_884_128884819_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_884_128884819_qa_1/task.toml b/tasks/0128_884_128884819_qa_1/task.toml index 5267262e0f2928175150f4b14fad7f695c7a9073..642e84194130d7f067199c6359604354eb284cca 100644 --- a/tasks/0128_884_128884819_qa_1/task.toml +++ b/tasks/0128_884_128884819_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_929_128929154_qa_1/environment/bootstrap.sh b/tasks/0128_929_128929154_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_929_128929154_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_929_128929154_qa_1/environment/pull_bucket.py b/tasks/0128_929_128929154_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_929_128929154_qa_1/environment/pull_bucket.py +++ b/tasks/0128_929_128929154_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_929_128929154_qa_1/task.toml b/tasks/0128_929_128929154_qa_1/task.toml index 8157d2199f4f8f13643f66f8b7352a309c0e5499..0437e5b40b5180067355b76c27e33ef3aab15fde 100644 --- a/tasks/0128_929_128929154_qa_1/task.toml +++ b/tasks/0128_929_128929154_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_943_128943364_qa_5/environment/bootstrap.sh b/tasks/0128_943_128943364_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_943_128943364_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_943_128943364_qa_5/environment/pull_bucket.py b/tasks/0128_943_128943364_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_943_128943364_qa_5/environment/pull_bucket.py +++ b/tasks/0128_943_128943364_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_943_128943364_qa_5/task.toml b/tasks/0128_943_128943364_qa_5/task.toml index 5220ad09a53702390c3b23970b673d2cec126c71..42450a4c0bfc53427a528dddb9df72e468eeb183 100644 --- a/tasks/0128_943_128943364_qa_5/task.toml +++ b/tasks/0128_943_128943364_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_945_128945855_qa_3/environment/bootstrap.sh b/tasks/0128_945_128945855_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_945_128945855_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_945_128945855_qa_3/environment/pull_bucket.py b/tasks/0128_945_128945855_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_945_128945855_qa_3/environment/pull_bucket.py +++ b/tasks/0128_945_128945855_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_945_128945855_qa_3/task.toml b/tasks/0128_945_128945855_qa_3/task.toml index b547d995175be2471d571661564718431b5f1715..31659e1b37aa389a7956af91bbeec5c9063cbcb0 100644 --- a/tasks/0128_945_128945855_qa_3/task.toml +++ b/tasks/0128_945_128945855_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_954_128954233_qa_1/environment/bootstrap.sh b/tasks/0128_954_128954233_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_954_128954233_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_954_128954233_qa_1/environment/pull_bucket.py b/tasks/0128_954_128954233_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_954_128954233_qa_1/environment/pull_bucket.py +++ b/tasks/0128_954_128954233_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_954_128954233_qa_1/task.toml b/tasks/0128_954_128954233_qa_1/task.toml index 0c9661d74bab9d8e405985fd43aef47e9f86351b..3bfa72c7a5ffa56e8147967eefe7f599f9dd296a 100644 --- a/tasks/0128_954_128954233_qa_1/task.toml +++ b/tasks/0128_954_128954233_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_954_128954233_qa_2/environment/bootstrap.sh b/tasks/0128_954_128954233_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_954_128954233_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_954_128954233_qa_2/environment/pull_bucket.py b/tasks/0128_954_128954233_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_954_128954233_qa_2/environment/pull_bucket.py +++ b/tasks/0128_954_128954233_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_954_128954233_qa_2/task.toml b/tasks/0128_954_128954233_qa_2/task.toml index 0f7e5cef1ab00debb5de8705833fdaecf5d4e3b4..a29ed1f0e3ae0264c2b66f42e25b9c34b2747ffd 100644 --- a/tasks/0128_954_128954233_qa_2/task.toml +++ b/tasks/0128_954_128954233_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_996_128996845_qa_3/environment/bootstrap.sh b/tasks/0128_996_128996845_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_996_128996845_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_996_128996845_qa_3/environment/pull_bucket.py b/tasks/0128_996_128996845_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_996_128996845_qa_3/environment/pull_bucket.py +++ b/tasks/0128_996_128996845_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_996_128996845_qa_3/task.toml b/tasks/0128_996_128996845_qa_3/task.toml index b41dbe9addcb027929dbc9d9a1889a30853062bd..d9b58ed024023009deeb3831572f2206623f6e15 100644 --- a/tasks/0128_996_128996845_qa_3/task.toml +++ b/tasks/0128_996_128996845_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_998_128998188_qa_2/environment/bootstrap.sh b/tasks/0128_998_128998188_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_998_128998188_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_998_128998188_qa_2/environment/pull_bucket.py b/tasks/0128_998_128998188_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_998_128998188_qa_2/environment/pull_bucket.py +++ b/tasks/0128_998_128998188_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_998_128998188_qa_2/task.toml b/tasks/0128_998_128998188_qa_2/task.toml index 7bd7a393eac7834d415a05221d2567a891ba01dc..f679c91b09c0e6b325bc25f4f40194cf0c37362d 100644 --- a/tasks/0128_998_128998188_qa_2/task.toml +++ b/tasks/0128_998_128998188_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0128_998_128998647_qa_1/environment/bootstrap.sh b/tasks/0128_998_128998647_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0128_998_128998647_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0128_998_128998647_qa_1/environment/pull_bucket.py b/tasks/0128_998_128998647_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0128_998_128998647_qa_1/environment/pull_bucket.py +++ b/tasks/0128_998_128998647_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0128_998_128998647_qa_1/task.toml b/tasks/0128_998_128998647_qa_1/task.toml index fffb8438e7a510ae04d4708a123721d27e92dfb5..92f77071e6100c2cbc5a67a9c65a8d90b59cc77a 100644 --- a/tasks/0128_998_128998647_qa_1/task.toml +++ b/tasks/0128_998_128998647_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_008_129008932_qa_4/environment/bootstrap.sh b/tasks/0129_008_129008932_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_008_129008932_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_008_129008932_qa_4/environment/pull_bucket.py b/tasks/0129_008_129008932_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_008_129008932_qa_4/environment/pull_bucket.py +++ b/tasks/0129_008_129008932_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_008_129008932_qa_4/task.toml b/tasks/0129_008_129008932_qa_4/task.toml index 4fb7b1ce6da15fc2844887a67e6c40d0f55dba4d..0bb4962fa637a6708a62c706f045251cbc2890b4 100644 --- a/tasks/0129_008_129008932_qa_4/task.toml +++ b/tasks/0129_008_129008932_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_057_129057549_qa_1/environment/bootstrap.sh b/tasks/0129_057_129057549_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_057_129057549_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_057_129057549_qa_1/environment/pull_bucket.py b/tasks/0129_057_129057549_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_057_129057549_qa_1/environment/pull_bucket.py +++ b/tasks/0129_057_129057549_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_057_129057549_qa_1/task.toml b/tasks/0129_057_129057549_qa_1/task.toml index 971f348367cd4ff8cd706017e5364f6123f3557c..173b6f610e0f591da3d24b61a75a880a8b2d4485 100644 --- a/tasks/0129_057_129057549_qa_1/task.toml +++ b/tasks/0129_057_129057549_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_062_129062292_qa_3/environment/bootstrap.sh b/tasks/0129_062_129062292_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_062_129062292_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_062_129062292_qa_3/environment/pull_bucket.py b/tasks/0129_062_129062292_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_062_129062292_qa_3/environment/pull_bucket.py +++ b/tasks/0129_062_129062292_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_062_129062292_qa_3/task.toml b/tasks/0129_062_129062292_qa_3/task.toml index 56b782aa7a16bdf34571abd6aa27424c8bb9c212..049902f79b6ce1cee7a27d673082bdec10e508d0 100644 --- a/tasks/0129_062_129062292_qa_3/task.toml +++ b/tasks/0129_062_129062292_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_062_129062292_qa_5/environment/bootstrap.sh b/tasks/0129_062_129062292_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_062_129062292_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_062_129062292_qa_5/environment/pull_bucket.py b/tasks/0129_062_129062292_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_062_129062292_qa_5/environment/pull_bucket.py +++ b/tasks/0129_062_129062292_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_062_129062292_qa_5/task.toml b/tasks/0129_062_129062292_qa_5/task.toml index e2cf65ef6940d252d73bffd4f66ce390baa01272..882c60cfc60552bcf151214fc5856c1ad38a887a 100644 --- a/tasks/0129_062_129062292_qa_5/task.toml +++ b/tasks/0129_062_129062292_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_065_129065933_qa_2/environment/bootstrap.sh b/tasks/0129_065_129065933_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_065_129065933_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_065_129065933_qa_2/environment/pull_bucket.py b/tasks/0129_065_129065933_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_065_129065933_qa_2/environment/pull_bucket.py +++ b/tasks/0129_065_129065933_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_065_129065933_qa_2/task.toml b/tasks/0129_065_129065933_qa_2/task.toml index 0fcccf77416b4acf4ce2d7f8ec9ebd2828b43d24..7e2ddf7af4c4e28b3c637c6793098309568c35da 100644 --- a/tasks/0129_065_129065933_qa_2/task.toml +++ b/tasks/0129_065_129065933_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_071_129071705_qa_4/environment/bootstrap.sh b/tasks/0129_071_129071705_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_071_129071705_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_071_129071705_qa_4/environment/pull_bucket.py b/tasks/0129_071_129071705_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_071_129071705_qa_4/environment/pull_bucket.py +++ b/tasks/0129_071_129071705_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_071_129071705_qa_4/task.toml b/tasks/0129_071_129071705_qa_4/task.toml index f61c752d50f9480e50d8782f934692009a6b624d..185f993e58f563da2d8fc394fcd1d8090cdc6088 100644 --- a/tasks/0129_071_129071705_qa_4/task.toml +++ b/tasks/0129_071_129071705_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_078_129078719_qa_2/environment/bootstrap.sh b/tasks/0129_078_129078719_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_078_129078719_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_078_129078719_qa_2/environment/pull_bucket.py b/tasks/0129_078_129078719_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_078_129078719_qa_2/environment/pull_bucket.py +++ b/tasks/0129_078_129078719_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_078_129078719_qa_2/task.toml b/tasks/0129_078_129078719_qa_2/task.toml index cc510fef76484df5bf3dcbe02a0ea342da1820d2..0f054b313bb8583d06ee491411302edfe5e0f6da 100644 --- a/tasks/0129_078_129078719_qa_2/task.toml +++ b/tasks/0129_078_129078719_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_078_129078719_qa_3/environment/bootstrap.sh b/tasks/0129_078_129078719_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_078_129078719_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_078_129078719_qa_3/environment/pull_bucket.py b/tasks/0129_078_129078719_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_078_129078719_qa_3/environment/pull_bucket.py +++ b/tasks/0129_078_129078719_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_078_129078719_qa_3/task.toml b/tasks/0129_078_129078719_qa_3/task.toml index 0b60092ff1e37f6daf7e3d1141d14bc6ddb605dc..79da7c2bdb8425fc0711c038d106dbee8c7b1141 100644 --- a/tasks/0129_078_129078719_qa_3/task.toml +++ b/tasks/0129_078_129078719_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_144_129144397_qa_1/environment/bootstrap.sh b/tasks/0129_144_129144397_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_144_129144397_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_144_129144397_qa_1/environment/pull_bucket.py b/tasks/0129_144_129144397_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_144_129144397_qa_1/environment/pull_bucket.py +++ b/tasks/0129_144_129144397_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_144_129144397_qa_1/task.toml b/tasks/0129_144_129144397_qa_1/task.toml index 3d092446296ba143b3beea5c4a7a3ad14f35ec77..933e5a2befe88c57d376d061f2d2c40646e6b00c 100644 --- a/tasks/0129_144_129144397_qa_1/task.toml +++ b/tasks/0129_144_129144397_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_144_129144397_qa_2/environment/bootstrap.sh b/tasks/0129_144_129144397_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_144_129144397_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_144_129144397_qa_2/environment/pull_bucket.py b/tasks/0129_144_129144397_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_144_129144397_qa_2/environment/pull_bucket.py +++ b/tasks/0129_144_129144397_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_144_129144397_qa_2/task.toml b/tasks/0129_144_129144397_qa_2/task.toml index 2fafc3f176c84619412e98cdb4d245ac758fde4e..0d8c49e79898cffbb92e6a15cadb9675c6228bbc 100644 --- a/tasks/0129_144_129144397_qa_2/task.toml +++ b/tasks/0129_144_129144397_qa_2/task.toml @@ -29,11 +29,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_144_129144397_qa_4/environment/bootstrap.sh b/tasks/0129_144_129144397_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_144_129144397_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_144_129144397_qa_4/environment/pull_bucket.py b/tasks/0129_144_129144397_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_144_129144397_qa_4/environment/pull_bucket.py +++ b/tasks/0129_144_129144397_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_144_129144397_qa_4/task.toml b/tasks/0129_144_129144397_qa_4/task.toml index 4020ce88705d8c8a273d13f6fb9769cdf282b4cb..2f7d4d2fbab233522fe341cbdf53302d2735f9ee 100644 --- a/tasks/0129_144_129144397_qa_4/task.toml +++ b/tasks/0129_144_129144397_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_208_129208819_qa_2/environment/bootstrap.sh b/tasks/0129_208_129208819_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_208_129208819_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_208_129208819_qa_2/environment/pull_bucket.py b/tasks/0129_208_129208819_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_208_129208819_qa_2/environment/pull_bucket.py +++ b/tasks/0129_208_129208819_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_208_129208819_qa_2/task.toml b/tasks/0129_208_129208819_qa_2/task.toml index 92565b1dc169b04c06866e79bb0cc1fd6e738a31..153daee59cf577ac01f56dde99520158423b2ca2 100644 --- a/tasks/0129_208_129208819_qa_2/task.toml +++ b/tasks/0129_208_129208819_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_211_129211866_qa_3/environment/bootstrap.sh b/tasks/0129_211_129211866_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_211_129211866_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_211_129211866_qa_3/environment/pull_bucket.py b/tasks/0129_211_129211866_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_211_129211866_qa_3/environment/pull_bucket.py +++ b/tasks/0129_211_129211866_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_211_129211866_qa_3/task.toml b/tasks/0129_211_129211866_qa_3/task.toml index 9a8d873f551e77e17917714cbdedf29e790bef6b..4e3ccb09d0ab3e6bc2060501f3ad026469dca7ce 100644 --- a/tasks/0129_211_129211866_qa_3/task.toml +++ b/tasks/0129_211_129211866_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_395_129395519_qa_2/environment/bootstrap.sh b/tasks/0129_395_129395519_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_395_129395519_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_395_129395519_qa_2/environment/pull_bucket.py b/tasks/0129_395_129395519_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_395_129395519_qa_2/environment/pull_bucket.py +++ b/tasks/0129_395_129395519_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_395_129395519_qa_2/task.toml b/tasks/0129_395_129395519_qa_2/task.toml index a2857ba599a89c87815697b9b1741ff56d1bea17..9e8b49c604e21d76c0856d35514e2fc8b8dc730d 100644 --- a/tasks/0129_395_129395519_qa_2/task.toml +++ b/tasks/0129_395_129395519_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_421_129421075_qa_4/environment/bootstrap.sh b/tasks/0129_421_129421075_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_421_129421075_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_421_129421075_qa_4/environment/pull_bucket.py b/tasks/0129_421_129421075_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_421_129421075_qa_4/environment/pull_bucket.py +++ b/tasks/0129_421_129421075_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_421_129421075_qa_4/task.toml b/tasks/0129_421_129421075_qa_4/task.toml index 8b4f24c0ac0d5e06464e98d5717ff9904e38e059..16136cd8123c7686edcef063aa3117fa74170493 100644 --- a/tasks/0129_421_129421075_qa_4/task.toml +++ b/tasks/0129_421_129421075_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_603_129603179_qa_3/environment/bootstrap.sh b/tasks/0129_603_129603179_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_603_129603179_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_603_129603179_qa_3/environment/pull_bucket.py b/tasks/0129_603_129603179_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_603_129603179_qa_3/environment/pull_bucket.py +++ b/tasks/0129_603_129603179_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_603_129603179_qa_3/task.toml b/tasks/0129_603_129603179_qa_3/task.toml index c301b115d2150870e5eb1de0da70df313f4231ab..f028d70ab3cbdf8d1da4ab1e21ead443de4fb454 100644 --- a/tasks/0129_603_129603179_qa_3/task.toml +++ b/tasks/0129_603_129603179_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_784_129784913_qa_2/environment/bootstrap.sh b/tasks/0129_784_129784913_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_784_129784913_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_784_129784913_qa_2/environment/pull_bucket.py b/tasks/0129_784_129784913_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_784_129784913_qa_2/environment/pull_bucket.py +++ b/tasks/0129_784_129784913_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_784_129784913_qa_2/task.toml b/tasks/0129_784_129784913_qa_2/task.toml index 7bf7bf0b112c3a46f86d9fb3fcf6cf18fb723e4d..09bc698d41b7692b56667a23e4cf74610de42e01 100644 --- a/tasks/0129_784_129784913_qa_2/task.toml +++ b/tasks/0129_784_129784913_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_784_129784913_qa_3/environment/bootstrap.sh b/tasks/0129_784_129784913_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_784_129784913_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_784_129784913_qa_3/environment/pull_bucket.py b/tasks/0129_784_129784913_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_784_129784913_qa_3/environment/pull_bucket.py +++ b/tasks/0129_784_129784913_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_784_129784913_qa_3/task.toml b/tasks/0129_784_129784913_qa_3/task.toml index 66a1eedf90ad1fdcf028b27211344c17f40ab7fb..08a9a8ac3f5076b169c27a134b8deb58975c4d45 100644 --- a/tasks/0129_784_129784913_qa_3/task.toml +++ b/tasks/0129_784_129784913_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0129_786_129786687_qa_5/environment/bootstrap.sh b/tasks/0129_786_129786687_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0129_786_129786687_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0129_786_129786687_qa_5/environment/pull_bucket.py b/tasks/0129_786_129786687_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0129_786_129786687_qa_5/environment/pull_bucket.py +++ b/tasks/0129_786_129786687_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0129_786_129786687_qa_5/task.toml b/tasks/0129_786_129786687_qa_5/task.toml index 5b3ffd0d6ce00af7fc0f63c15c0334a0fe667bca..611ed25a52716696e9ae3de4782a7393cc486901 100644 --- a/tasks/0129_786_129786687_qa_5/task.toml +++ b/tasks/0129_786_129786687_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_032_130032784_qa_1/environment/bootstrap.sh b/tasks/0130_032_130032784_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_032_130032784_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_032_130032784_qa_1/environment/pull_bucket.py b/tasks/0130_032_130032784_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_032_130032784_qa_1/environment/pull_bucket.py +++ b/tasks/0130_032_130032784_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_032_130032784_qa_1/task.toml b/tasks/0130_032_130032784_qa_1/task.toml index da52c49f97b905e3fadcaf9a7e41e98531a57e06..cd4a950be6f94531a3328c8315b536a9dce841f5 100644 --- a/tasks/0130_032_130032784_qa_1/task.toml +++ b/tasks/0130_032_130032784_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_032_130032784_qa_2/environment/bootstrap.sh b/tasks/0130_032_130032784_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_032_130032784_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_032_130032784_qa_2/environment/pull_bucket.py b/tasks/0130_032_130032784_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_032_130032784_qa_2/environment/pull_bucket.py +++ b/tasks/0130_032_130032784_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_032_130032784_qa_2/task.toml b/tasks/0130_032_130032784_qa_2/task.toml index 1e4f568fdb217ac85c98b03b8d6ee8ed3089987d..2be4664b9c664e81c6fc14d15b6002f8aacdbe6c 100644 --- a/tasks/0130_032_130032784_qa_2/task.toml +++ b/tasks/0130_032_130032784_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_032_130032784_qa_4/environment/bootstrap.sh b/tasks/0130_032_130032784_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_032_130032784_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_032_130032784_qa_4/environment/pull_bucket.py b/tasks/0130_032_130032784_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_032_130032784_qa_4/environment/pull_bucket.py +++ b/tasks/0130_032_130032784_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_032_130032784_qa_4/task.toml b/tasks/0130_032_130032784_qa_4/task.toml index 9bb5607a91f8dc4e9fa0c1da333ad2e89e159bcc..18b777763ee929bd1ada6a6b58c316321f9a27ad 100644 --- a/tasks/0130_032_130032784_qa_4/task.toml +++ b/tasks/0130_032_130032784_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_119_130119508_qa_4/environment/bootstrap.sh b/tasks/0130_119_130119508_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_119_130119508_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_119_130119508_qa_4/environment/pull_bucket.py b/tasks/0130_119_130119508_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_119_130119508_qa_4/environment/pull_bucket.py +++ b/tasks/0130_119_130119508_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_119_130119508_qa_4/task.toml b/tasks/0130_119_130119508_qa_4/task.toml index 2cbc8edc34c28adc2826bfac1d03543187203a61..a5c54dbe5a0ed2fa93f040b252d722849e1ca810 100644 --- a/tasks/0130_119_130119508_qa_4/task.toml +++ b/tasks/0130_119_130119508_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_208_130208676_qa_1/environment/bootstrap.sh b/tasks/0130_208_130208676_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_208_130208676_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_208_130208676_qa_1/environment/pull_bucket.py b/tasks/0130_208_130208676_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_208_130208676_qa_1/environment/pull_bucket.py +++ b/tasks/0130_208_130208676_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_208_130208676_qa_1/task.toml b/tasks/0130_208_130208676_qa_1/task.toml index a987b96d49c38d60f1e9b01f92ebd3337b4cd29e..5784e4523423b47aee240baa8c456311f0f138ff 100644 --- a/tasks/0130_208_130208676_qa_1/task.toml +++ b/tasks/0130_208_130208676_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_208_130208676_qa_4/environment/bootstrap.sh b/tasks/0130_208_130208676_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_208_130208676_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_208_130208676_qa_4/environment/pull_bucket.py b/tasks/0130_208_130208676_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_208_130208676_qa_4/environment/pull_bucket.py +++ b/tasks/0130_208_130208676_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_208_130208676_qa_4/task.toml b/tasks/0130_208_130208676_qa_4/task.toml index cffb251b6c38046a8ba035b90a33a25d293278c9..b3289a8a003b827345e71176cacbb8f25d05c251 100644 --- a/tasks/0130_208_130208676_qa_4/task.toml +++ b/tasks/0130_208_130208676_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_213_130213131_qa_3/environment/bootstrap.sh b/tasks/0130_213_130213131_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_213_130213131_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_213_130213131_qa_3/environment/pull_bucket.py b/tasks/0130_213_130213131_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_213_130213131_qa_3/environment/pull_bucket.py +++ b/tasks/0130_213_130213131_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_213_130213131_qa_3/task.toml b/tasks/0130_213_130213131_qa_3/task.toml index 1147ba3732065212a8e973542606065149e63391..82c8a8ad608798ed8a6052ae8c646faf0d0566d6 100644 --- a/tasks/0130_213_130213131_qa_3/task.toml +++ b/tasks/0130_213_130213131_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_285_130285411_qa_1/environment/bootstrap.sh b/tasks/0130_285_130285411_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_285_130285411_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_285_130285411_qa_1/environment/pull_bucket.py b/tasks/0130_285_130285411_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_285_130285411_qa_1/environment/pull_bucket.py +++ b/tasks/0130_285_130285411_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_285_130285411_qa_1/task.toml b/tasks/0130_285_130285411_qa_1/task.toml index d878d10d413bac47d6dd2369803280b6ca2fe61a..19d4fef96ad673ea352895a184744c368314b49d 100644 --- a/tasks/0130_285_130285411_qa_1/task.toml +++ b/tasks/0130_285_130285411_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_285_130285411_qa_4/environment/bootstrap.sh b/tasks/0130_285_130285411_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_285_130285411_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_285_130285411_qa_4/environment/pull_bucket.py b/tasks/0130_285_130285411_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_285_130285411_qa_4/environment/pull_bucket.py +++ b/tasks/0130_285_130285411_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_285_130285411_qa_4/task.toml b/tasks/0130_285_130285411_qa_4/task.toml index 7b9a5451c9f72f71a544541c0c72bf05a2be27e6..47c6ee2402b617f46b367185daf81d98df5e2c98 100644 --- a/tasks/0130_285_130285411_qa_4/task.toml +++ b/tasks/0130_285_130285411_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_334_130334137_qa_2/environment/bootstrap.sh b/tasks/0130_334_130334137_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_334_130334137_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_334_130334137_qa_2/environment/pull_bucket.py b/tasks/0130_334_130334137_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_334_130334137_qa_2/environment/pull_bucket.py +++ b/tasks/0130_334_130334137_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_334_130334137_qa_2/task.toml b/tasks/0130_334_130334137_qa_2/task.toml index 5d66fe4fede10380e3601a15471ceef8f1fb74ab..d58ecfeebf5cf4093e1889b10d6e0b62c1cd436b 100644 --- a/tasks/0130_334_130334137_qa_2/task.toml +++ b/tasks/0130_334_130334137_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_334_130334137_qa_3/environment/bootstrap.sh b/tasks/0130_334_130334137_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_334_130334137_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_334_130334137_qa_3/environment/pull_bucket.py b/tasks/0130_334_130334137_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_334_130334137_qa_3/environment/pull_bucket.py +++ b/tasks/0130_334_130334137_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_334_130334137_qa_3/task.toml b/tasks/0130_334_130334137_qa_3/task.toml index b7862f2b73a48415f709e5b57272cdecb641045c..49320aba1104f21978c4a5b6bdf7ff22582ed8ac 100644 --- a/tasks/0130_334_130334137_qa_3/task.toml +++ b/tasks/0130_334_130334137_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_347_130347840_qa_4/environment/bootstrap.sh b/tasks/0130_347_130347840_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_347_130347840_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_347_130347840_qa_4/environment/pull_bucket.py b/tasks/0130_347_130347840_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_347_130347840_qa_4/environment/pull_bucket.py +++ b/tasks/0130_347_130347840_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_347_130347840_qa_4/task.toml b/tasks/0130_347_130347840_qa_4/task.toml index 0e07cd5ee3ccac8826c48d5852a3d32e3815bb83..140f1ff5042d909dae7ad6540e74d158ff823973 100644 --- a/tasks/0130_347_130347840_qa_4/task.toml +++ b/tasks/0130_347_130347840_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_588_130588060_qa_1/environment/bootstrap.sh b/tasks/0130_588_130588060_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_588_130588060_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_588_130588060_qa_1/environment/pull_bucket.py b/tasks/0130_588_130588060_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_588_130588060_qa_1/environment/pull_bucket.py +++ b/tasks/0130_588_130588060_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_588_130588060_qa_1/task.toml b/tasks/0130_588_130588060_qa_1/task.toml index 75e991d67d66f4742649f6d9d27c586c547ce194..983549b76b51f74661bed76dd96fb44b6d31deb5 100644 --- a/tasks/0130_588_130588060_qa_1/task.toml +++ b/tasks/0130_588_130588060_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_615_130615633_qa_1/environment/bootstrap.sh b/tasks/0130_615_130615633_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_615_130615633_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_615_130615633_qa_1/environment/pull_bucket.py b/tasks/0130_615_130615633_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_615_130615633_qa_1/environment/pull_bucket.py +++ b/tasks/0130_615_130615633_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_615_130615633_qa_1/task.toml b/tasks/0130_615_130615633_qa_1/task.toml index 064abe8a0a0a70baee6bc8257f80113d0c4fa4da..1e2c72a3078409f3478a782ac6f0e8a67c071537 100644 --- a/tasks/0130_615_130615633_qa_1/task.toml +++ b/tasks/0130_615_130615633_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_615_130615633_qa_4/environment/bootstrap.sh b/tasks/0130_615_130615633_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_615_130615633_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_615_130615633_qa_4/environment/pull_bucket.py b/tasks/0130_615_130615633_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_615_130615633_qa_4/environment/pull_bucket.py +++ b/tasks/0130_615_130615633_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_615_130615633_qa_4/task.toml b/tasks/0130_615_130615633_qa_4/task.toml index 34e970fb16b12bc03bbd7e9862a3e14e072d6f76..bde3a56d4e6528165b2b23469e96ea4df07f5fdc 100644 --- a/tasks/0130_615_130615633_qa_4/task.toml +++ b/tasks/0130_615_130615633_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_710_130710766_qa_2/environment/bootstrap.sh b/tasks/0130_710_130710766_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_710_130710766_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_710_130710766_qa_2/environment/pull_bucket.py b/tasks/0130_710_130710766_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_710_130710766_qa_2/environment/pull_bucket.py +++ b/tasks/0130_710_130710766_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_710_130710766_qa_2/task.toml b/tasks/0130_710_130710766_qa_2/task.toml index 1908b913a749cdc84c4f43bb7f4088d1dfc59b58..9a90a1e8cdd31957606ef29810688bd794034892 100644 --- a/tasks/0130_710_130710766_qa_2/task.toml +++ b/tasks/0130_710_130710766_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_713_130713633_qa_5/environment/bootstrap.sh b/tasks/0130_713_130713633_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_713_130713633_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_713_130713633_qa_5/environment/pull_bucket.py b/tasks/0130_713_130713633_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_713_130713633_qa_5/environment/pull_bucket.py +++ b/tasks/0130_713_130713633_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_713_130713633_qa_5/task.toml b/tasks/0130_713_130713633_qa_5/task.toml index 1632431f099a87644d4d257838d97d0af749a93e..4fdecb26c914ea78b1227156393ec61b9b31d00c 100644 --- a/tasks/0130_713_130713633_qa_5/task.toml +++ b/tasks/0130_713_130713633_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_740_130740848_qa_1/environment/bootstrap.sh b/tasks/0130_740_130740848_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_740_130740848_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_740_130740848_qa_1/environment/pull_bucket.py b/tasks/0130_740_130740848_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_740_130740848_qa_1/environment/pull_bucket.py +++ b/tasks/0130_740_130740848_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_740_130740848_qa_1/task.toml b/tasks/0130_740_130740848_qa_1/task.toml index 90b9ccd62cb848505ebb59e4f83b7a5e50c3af27..48f8f7bf3c5c533e5ed4417d9cc1bf02a0bfcc1b 100644 --- a/tasks/0130_740_130740848_qa_1/task.toml +++ b/tasks/0130_740_130740848_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_751_130751962_qa_1/environment/bootstrap.sh b/tasks/0130_751_130751962_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_751_130751962_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_751_130751962_qa_1/environment/pull_bucket.py b/tasks/0130_751_130751962_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_751_130751962_qa_1/environment/pull_bucket.py +++ b/tasks/0130_751_130751962_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_751_130751962_qa_1/task.toml b/tasks/0130_751_130751962_qa_1/task.toml index c8af4b5a50dc2a1ed63c86523cf416f97b13a849..335cf19ce2d86c37450e2ce680638a4da69be294 100644 --- a/tasks/0130_751_130751962_qa_1/task.toml +++ b/tasks/0130_751_130751962_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_870_130870201_qa_1/environment/bootstrap.sh b/tasks/0130_870_130870201_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_870_130870201_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_870_130870201_qa_1/environment/pull_bucket.py b/tasks/0130_870_130870201_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_870_130870201_qa_1/environment/pull_bucket.py +++ b/tasks/0130_870_130870201_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_870_130870201_qa_1/task.toml b/tasks/0130_870_130870201_qa_1/task.toml index a953d95eb653ddca3ec04b7bcff61d6d5069ee95..9d5bf23b130a98d58e89967ceaf5b64fe92f4248 100644 --- a/tasks/0130_870_130870201_qa_1/task.toml +++ b/tasks/0130_870_130870201_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_890_130890369_qa_2/environment/bootstrap.sh b/tasks/0130_890_130890369_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_890_130890369_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_890_130890369_qa_2/environment/pull_bucket.py b/tasks/0130_890_130890369_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_890_130890369_qa_2/environment/pull_bucket.py +++ b/tasks/0130_890_130890369_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_890_130890369_qa_2/task.toml b/tasks/0130_890_130890369_qa_2/task.toml index e7f575636c2ed55f228ab531a9cd07783f56aa54..d6906f915777d7c126b91ca81123f03b3e662303 100644 --- a/tasks/0130_890_130890369_qa_2/task.toml +++ b/tasks/0130_890_130890369_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_890_130890369_qa_4/environment/bootstrap.sh b/tasks/0130_890_130890369_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_890_130890369_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_890_130890369_qa_4/environment/pull_bucket.py b/tasks/0130_890_130890369_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_890_130890369_qa_4/environment/pull_bucket.py +++ b/tasks/0130_890_130890369_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_890_130890369_qa_4/task.toml b/tasks/0130_890_130890369_qa_4/task.toml index b257ece5b8df81bf7cb73c87daa8e2a6005bb5a4..ed985885017db1c7fc95c979aa185ff74807b852 100644 --- a/tasks/0130_890_130890369_qa_4/task.toml +++ b/tasks/0130_890_130890369_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0130_998_130998781_qa_1/environment/bootstrap.sh b/tasks/0130_998_130998781_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0130_998_130998781_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0130_998_130998781_qa_1/environment/pull_bucket.py b/tasks/0130_998_130998781_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0130_998_130998781_qa_1/environment/pull_bucket.py +++ b/tasks/0130_998_130998781_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0130_998_130998781_qa_1/task.toml b/tasks/0130_998_130998781_qa_1/task.toml index d668c4ebb58ec62e1f68fb4b3b2600ae9dcca8a8..045ae65d2a46db81889e7daab4cda15535e430db 100644 --- a/tasks/0130_998_130998781_qa_1/task.toml +++ b/tasks/0130_998_130998781_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_072_131072256_qa_1/environment/bootstrap.sh b/tasks/0131_072_131072256_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_072_131072256_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_072_131072256_qa_1/environment/pull_bucket.py b/tasks/0131_072_131072256_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_072_131072256_qa_1/environment/pull_bucket.py +++ b/tasks/0131_072_131072256_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_072_131072256_qa_1/task.toml b/tasks/0131_072_131072256_qa_1/task.toml index 9d0fb760764ecee07dddaf7b47d2618e09ef6711..70960fa69992f9f6634540f5b82858449afcdc5e 100644 --- a/tasks/0131_072_131072256_qa_1/task.toml +++ b/tasks/0131_072_131072256_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_072_131072256_qa_3/environment/bootstrap.sh b/tasks/0131_072_131072256_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_072_131072256_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_072_131072256_qa_3/environment/pull_bucket.py b/tasks/0131_072_131072256_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_072_131072256_qa_3/environment/pull_bucket.py +++ b/tasks/0131_072_131072256_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_072_131072256_qa_3/task.toml b/tasks/0131_072_131072256_qa_3/task.toml index 46a685759d629bd68cb0d66fdfef3d4fd1d7b6ac..1a7bc659ad3f4bdeaec5608179b32d0bc90420dc 100644 --- a/tasks/0131_072_131072256_qa_3/task.toml +++ b/tasks/0131_072_131072256_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_224_131224079_qa_3/environment/bootstrap.sh b/tasks/0131_224_131224079_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_224_131224079_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_224_131224079_qa_3/environment/pull_bucket.py b/tasks/0131_224_131224079_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_224_131224079_qa_3/environment/pull_bucket.py +++ b/tasks/0131_224_131224079_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_224_131224079_qa_3/task.toml b/tasks/0131_224_131224079_qa_3/task.toml index 2ce42f02cbfaceb995c7172183feca1c35fd91bf..892634c56742052011702fdc45d06ada05e72cf5 100644 --- a/tasks/0131_224_131224079_qa_3/task.toml +++ b/tasks/0131_224_131224079_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_249_131249802_qa_5/environment/bootstrap.sh b/tasks/0131_249_131249802_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_249_131249802_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_249_131249802_qa_5/environment/pull_bucket.py b/tasks/0131_249_131249802_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_249_131249802_qa_5/environment/pull_bucket.py +++ b/tasks/0131_249_131249802_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_249_131249802_qa_5/task.toml b/tasks/0131_249_131249802_qa_5/task.toml index 0f6bd11fa8f4f1d3c0eb07d139e38326992393c5..3b4cda841de6ad7a645e70cbffc5743314c16f4e 100644 --- a/tasks/0131_249_131249802_qa_5/task.toml +++ b/tasks/0131_249_131249802_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_258_131258497_qa_4/environment/bootstrap.sh b/tasks/0131_258_131258497_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_258_131258497_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_258_131258497_qa_4/environment/pull_bucket.py b/tasks/0131_258_131258497_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_258_131258497_qa_4/environment/pull_bucket.py +++ b/tasks/0131_258_131258497_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_258_131258497_qa_4/task.toml b/tasks/0131_258_131258497_qa_4/task.toml index 59cdc0a3c249db0edc50bdb5b213ef9fe91d8c35..71d05bf799604d9d7c8e67bd28d954613685a4ff 100644 --- a/tasks/0131_258_131258497_qa_4/task.toml +++ b/tasks/0131_258_131258497_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_341_131341778_qa_5/environment/bootstrap.sh b/tasks/0131_341_131341778_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_341_131341778_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_341_131341778_qa_5/environment/pull_bucket.py b/tasks/0131_341_131341778_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_341_131341778_qa_5/environment/pull_bucket.py +++ b/tasks/0131_341_131341778_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_341_131341778_qa_5/task.toml b/tasks/0131_341_131341778_qa_5/task.toml index d9e5c9f23e07a363ace164150523c8d708291457..763c9b24e76ca43d4f5b593d228d3bebd8f0e274 100644 --- a/tasks/0131_341_131341778_qa_5/task.toml +++ b/tasks/0131_341_131341778_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_433_131433565_qa_1/environment/bootstrap.sh b/tasks/0131_433_131433565_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_433_131433565_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_433_131433565_qa_1/environment/pull_bucket.py b/tasks/0131_433_131433565_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_433_131433565_qa_1/environment/pull_bucket.py +++ b/tasks/0131_433_131433565_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_433_131433565_qa_1/task.toml b/tasks/0131_433_131433565_qa_1/task.toml index 061f8f726bac969a2fa04a3038318aeb911d1106..b30eef3f6649c6e0341a283bac50276e1ebfaaa9 100644 --- a/tasks/0131_433_131433565_qa_1/task.toml +++ b/tasks/0131_433_131433565_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_433_131433565_qa_4/environment/bootstrap.sh b/tasks/0131_433_131433565_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_433_131433565_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_433_131433565_qa_4/environment/pull_bucket.py b/tasks/0131_433_131433565_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_433_131433565_qa_4/environment/pull_bucket.py +++ b/tasks/0131_433_131433565_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_433_131433565_qa_4/task.toml b/tasks/0131_433_131433565_qa_4/task.toml index 07dbcd5546d976254d5523913dce179037fde6d2..e8160ecd895d25ccaff505e6e46d888d84a7f61d 100644 --- a/tasks/0131_433_131433565_qa_4/task.toml +++ b/tasks/0131_433_131433565_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_438_131438357_qa_4/environment/bootstrap.sh b/tasks/0131_438_131438357_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_438_131438357_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_438_131438357_qa_4/environment/pull_bucket.py b/tasks/0131_438_131438357_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_438_131438357_qa_4/environment/pull_bucket.py +++ b/tasks/0131_438_131438357_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_438_131438357_qa_4/task.toml b/tasks/0131_438_131438357_qa_4/task.toml index 7fe97396c1edbe914c16edc652bbf2f5095be544..442bec25a27524760c98b0d7d731b1d74e0a0df7 100644 --- a/tasks/0131_438_131438357_qa_4/task.toml +++ b/tasks/0131_438_131438357_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_454_131454088_qa_4/environment/bootstrap.sh b/tasks/0131_454_131454088_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_454_131454088_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_454_131454088_qa_4/environment/pull_bucket.py b/tasks/0131_454_131454088_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_454_131454088_qa_4/environment/pull_bucket.py +++ b/tasks/0131_454_131454088_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_454_131454088_qa_4/task.toml b/tasks/0131_454_131454088_qa_4/task.toml index b6c2c00d57d284eeed1d37ad71d51b5a8faf5615..61dfa367be7def7051a6a5af138797ad21228a8a 100644 --- a/tasks/0131_454_131454088_qa_4/task.toml +++ b/tasks/0131_454_131454088_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_454_131454088_qa_5/environment/bootstrap.sh b/tasks/0131_454_131454088_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_454_131454088_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_454_131454088_qa_5/environment/pull_bucket.py b/tasks/0131_454_131454088_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_454_131454088_qa_5/environment/pull_bucket.py +++ b/tasks/0131_454_131454088_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_454_131454088_qa_5/task.toml b/tasks/0131_454_131454088_qa_5/task.toml index e9dc847ec6c74e17d6203a077cb3554d53ef3bcb..2656659fe4434873c21175da43ebff87d97bb0e1 100644 --- a/tasks/0131_454_131454088_qa_5/task.toml +++ b/tasks/0131_454_131454088_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_458_131458182_qa_5/environment/bootstrap.sh b/tasks/0131_458_131458182_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_458_131458182_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_458_131458182_qa_5/environment/pull_bucket.py b/tasks/0131_458_131458182_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_458_131458182_qa_5/environment/pull_bucket.py +++ b/tasks/0131_458_131458182_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_458_131458182_qa_5/task.toml b/tasks/0131_458_131458182_qa_5/task.toml index 7fc181a227019312e7d7c86dd93cdfa425560000..80a291012472110ffe5cc9c8e3d13768b8b709ce 100644 --- a/tasks/0131_458_131458182_qa_5/task.toml +++ b/tasks/0131_458_131458182_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_552_131552856_qa_4/environment/bootstrap.sh b/tasks/0131_552_131552856_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_552_131552856_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_552_131552856_qa_4/environment/pull_bucket.py b/tasks/0131_552_131552856_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_552_131552856_qa_4/environment/pull_bucket.py +++ b/tasks/0131_552_131552856_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_552_131552856_qa_4/task.toml b/tasks/0131_552_131552856_qa_4/task.toml index c07547b1de3c87ac2a6402a9009d5fd8717cca7e..b4a4d76e22c520b1068559fee2dca63c4442d4f9 100644 --- a/tasks/0131_552_131552856_qa_4/task.toml +++ b/tasks/0131_552_131552856_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_609_131609730_qa_1/environment/bootstrap.sh b/tasks/0131_609_131609730_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_609_131609730_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_609_131609730_qa_1/environment/pull_bucket.py b/tasks/0131_609_131609730_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_609_131609730_qa_1/environment/pull_bucket.py +++ b/tasks/0131_609_131609730_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_609_131609730_qa_1/task.toml b/tasks/0131_609_131609730_qa_1/task.toml index a2e973c480be500987e3fd5886fa9641a22d2a0e..cfd46dece742489c9146d3974652ac3a12b954e0 100644 --- a/tasks/0131_609_131609730_qa_1/task.toml +++ b/tasks/0131_609_131609730_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_609_131609730_qa_3/environment/bootstrap.sh b/tasks/0131_609_131609730_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_609_131609730_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_609_131609730_qa_3/environment/pull_bucket.py b/tasks/0131_609_131609730_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_609_131609730_qa_3/environment/pull_bucket.py +++ b/tasks/0131_609_131609730_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_609_131609730_qa_3/task.toml b/tasks/0131_609_131609730_qa_3/task.toml index ef907d4aba3c0e32f5c2f223971231a5de2d3d25..b941517b029287ed53eaae34f9d1099612bb4d37 100644 --- a/tasks/0131_609_131609730_qa_3/task.toml +++ b/tasks/0131_609_131609730_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_609_131609730_qa_5/environment/bootstrap.sh b/tasks/0131_609_131609730_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_609_131609730_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_609_131609730_qa_5/environment/pull_bucket.py b/tasks/0131_609_131609730_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_609_131609730_qa_5/environment/pull_bucket.py +++ b/tasks/0131_609_131609730_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_609_131609730_qa_5/task.toml b/tasks/0131_609_131609730_qa_5/task.toml index 1c3bf44cc7ddb5a7d20c1d037304121b7c264028..191388d150a42aa4cdbb988b41b92d1ec3d70e7d 100644 --- a/tasks/0131_609_131609730_qa_5/task.toml +++ b/tasks/0131_609_131609730_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_622_131622026_qa_3/environment/bootstrap.sh b/tasks/0131_622_131622026_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_622_131622026_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_622_131622026_qa_3/environment/pull_bucket.py b/tasks/0131_622_131622026_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_622_131622026_qa_3/environment/pull_bucket.py +++ b/tasks/0131_622_131622026_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_622_131622026_qa_3/task.toml b/tasks/0131_622_131622026_qa_3/task.toml index b3a26e519a50f058ae1c813f38ac5756f8ca2d52..83ce1a582a4dd409ced68f186392f33f0d0b155d 100644 --- a/tasks/0131_622_131622026_qa_3/task.toml +++ b/tasks/0131_622_131622026_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_624_131624769_qa_1/environment/bootstrap.sh b/tasks/0131_624_131624769_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_624_131624769_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_624_131624769_qa_1/environment/pull_bucket.py b/tasks/0131_624_131624769_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_624_131624769_qa_1/environment/pull_bucket.py +++ b/tasks/0131_624_131624769_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_624_131624769_qa_1/task.toml b/tasks/0131_624_131624769_qa_1/task.toml index d84bd95a093a7daae437a3c82582ea6f5369b764..6d539dcbd62b9e3ce2729a4af9045694add7ee9c 100644 --- a/tasks/0131_624_131624769_qa_1/task.toml +++ b/tasks/0131_624_131624769_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_667_131667789_qa_4/environment/bootstrap.sh b/tasks/0131_667_131667789_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_667_131667789_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_667_131667789_qa_4/environment/pull_bucket.py b/tasks/0131_667_131667789_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_667_131667789_qa_4/environment/pull_bucket.py +++ b/tasks/0131_667_131667789_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_667_131667789_qa_4/task.toml b/tasks/0131_667_131667789_qa_4/task.toml index 0a2e6b5424b7ec4df99afe4cb5c5c142bc20ee0a..2c546d45610036252334c91e19430c716cfd021f 100644 --- a/tasks/0131_667_131667789_qa_4/task.toml +++ b/tasks/0131_667_131667789_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_731_131731169_qa_5/environment/bootstrap.sh b/tasks/0131_731_131731169_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_731_131731169_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_731_131731169_qa_5/environment/pull_bucket.py b/tasks/0131_731_131731169_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_731_131731169_qa_5/environment/pull_bucket.py +++ b/tasks/0131_731_131731169_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_731_131731169_qa_5/task.toml b/tasks/0131_731_131731169_qa_5/task.toml index 1cf0159eae8053963fe41bb76ecd3359ebe62d02..bb378c311d430c784323a2033848a746417d49b2 100644 --- a/tasks/0131_731_131731169_qa_5/task.toml +++ b/tasks/0131_731_131731169_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_767_131767840_qa_1/environment/bootstrap.sh b/tasks/0131_767_131767840_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_767_131767840_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_767_131767840_qa_1/environment/pull_bucket.py b/tasks/0131_767_131767840_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_767_131767840_qa_1/environment/pull_bucket.py +++ b/tasks/0131_767_131767840_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_767_131767840_qa_1/task.toml b/tasks/0131_767_131767840_qa_1/task.toml index 53e6cbce1344ed30d5aeb49d222031b9c930118c..0cfb5c16a6dd2d14d569ef8536580c07a0313b2c 100644 --- a/tasks/0131_767_131767840_qa_1/task.toml +++ b/tasks/0131_767_131767840_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_767_131767840_qa_5/environment/bootstrap.sh b/tasks/0131_767_131767840_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_767_131767840_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_767_131767840_qa_5/environment/pull_bucket.py b/tasks/0131_767_131767840_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_767_131767840_qa_5/environment/pull_bucket.py +++ b/tasks/0131_767_131767840_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_767_131767840_qa_5/task.toml b/tasks/0131_767_131767840_qa_5/task.toml index 385cf31610de10e6d8b78bed4a7e999a09d8b810..a3cb381cba0c749ba9fa11c1a57422f622559745 100644 --- a/tasks/0131_767_131767840_qa_5/task.toml +++ b/tasks/0131_767_131767840_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_881_131881806_qa_2/environment/bootstrap.sh b/tasks/0131_881_131881806_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_881_131881806_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_881_131881806_qa_2/environment/pull_bucket.py b/tasks/0131_881_131881806_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_881_131881806_qa_2/environment/pull_bucket.py +++ b/tasks/0131_881_131881806_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_881_131881806_qa_2/task.toml b/tasks/0131_881_131881806_qa_2/task.toml index 6af3f907aed748eb1c5d7fe3a37c6b2105412d85..bf743f2c2ffd6bcd190c194f1edda2d21648ef02 100644 --- a/tasks/0131_881_131881806_qa_2/task.toml +++ b/tasks/0131_881_131881806_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0131_881_131881806_qa_4/environment/bootstrap.sh b/tasks/0131_881_131881806_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0131_881_131881806_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0131_881_131881806_qa_4/environment/pull_bucket.py b/tasks/0131_881_131881806_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0131_881_131881806_qa_4/environment/pull_bucket.py +++ b/tasks/0131_881_131881806_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0131_881_131881806_qa_4/task.toml b/tasks/0131_881_131881806_qa_4/task.toml index 4aeb97c81ca16d982cc3ceda8ae8b67ef342804a..2bad0b936b87b0d07b7d566fb78727d1c7fb22a9 100644 --- a/tasks/0131_881_131881806_qa_4/task.toml +++ b/tasks/0131_881_131881806_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_089_132089829_qa_3/environment/bootstrap.sh b/tasks/0132_089_132089829_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_089_132089829_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_089_132089829_qa_3/environment/pull_bucket.py b/tasks/0132_089_132089829_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_089_132089829_qa_3/environment/pull_bucket.py +++ b/tasks/0132_089_132089829_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_089_132089829_qa_3/task.toml b/tasks/0132_089_132089829_qa_3/task.toml index 2db11c4d4b7a9ada202fadb3dbf7b18feee94598..a07e2a538654e6ab2ee3e8ab0ddcb24820b2f5ed 100644 --- a/tasks/0132_089_132089829_qa_3/task.toml +++ b/tasks/0132_089_132089829_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_099_132099772_qa_3/environment/bootstrap.sh b/tasks/0132_099_132099772_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_099_132099772_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_099_132099772_qa_3/environment/pull_bucket.py b/tasks/0132_099_132099772_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_099_132099772_qa_3/environment/pull_bucket.py +++ b/tasks/0132_099_132099772_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_099_132099772_qa_3/task.toml b/tasks/0132_099_132099772_qa_3/task.toml index 4057646436cecf22faa5d8afe88d294a06779d7c..7f0a47264853fe4f113b23008869a21f28d5a334 100644 --- a/tasks/0132_099_132099772_qa_3/task.toml +++ b/tasks/0132_099_132099772_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_138_132138987_qa_1/environment/bootstrap.sh b/tasks/0132_138_132138987_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_138_132138987_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_138_132138987_qa_1/environment/pull_bucket.py b/tasks/0132_138_132138987_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_138_132138987_qa_1/environment/pull_bucket.py +++ b/tasks/0132_138_132138987_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_138_132138987_qa_1/task.toml b/tasks/0132_138_132138987_qa_1/task.toml index df12a0b10797ea917254082be3e0e92a25e8b536..a13a86489a51ccdeee059651d5c7483c765396d8 100644 --- a/tasks/0132_138_132138987_qa_1/task.toml +++ b/tasks/0132_138_132138987_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_151_132151183_qa_1/environment/bootstrap.sh b/tasks/0132_151_132151183_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_151_132151183_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_151_132151183_qa_1/environment/pull_bucket.py b/tasks/0132_151_132151183_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_151_132151183_qa_1/environment/pull_bucket.py +++ b/tasks/0132_151_132151183_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_151_132151183_qa_1/task.toml b/tasks/0132_151_132151183_qa_1/task.toml index 56867a19ba35e4f981d72a917473eb82d8f682d7..cd56a7154631314978ed6b9c0540f044415cebc8 100644 --- a/tasks/0132_151_132151183_qa_1/task.toml +++ b/tasks/0132_151_132151183_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_151_132151183_qa_2/environment/bootstrap.sh b/tasks/0132_151_132151183_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_151_132151183_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_151_132151183_qa_2/environment/pull_bucket.py b/tasks/0132_151_132151183_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_151_132151183_qa_2/environment/pull_bucket.py +++ b/tasks/0132_151_132151183_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_151_132151183_qa_2/task.toml b/tasks/0132_151_132151183_qa_2/task.toml index a390c6c4f7227a594bfc63cfe0de1e16a7bddd8d..ce38aab12aa9c41895e23cbd5018c66d54d6c691 100644 --- a/tasks/0132_151_132151183_qa_2/task.toml +++ b/tasks/0132_151_132151183_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_169_132169068_qa_5/environment/bootstrap.sh b/tasks/0132_169_132169068_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_169_132169068_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_169_132169068_qa_5/environment/pull_bucket.py b/tasks/0132_169_132169068_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_169_132169068_qa_5/environment/pull_bucket.py +++ b/tasks/0132_169_132169068_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_169_132169068_qa_5/task.toml b/tasks/0132_169_132169068_qa_5/task.toml index 57b4e6a00a21978d618fd4205b6c57367f8a90bd..ed57f82cdd0e221ace9bf2796cf768b7de6de021 100644 --- a/tasks/0132_169_132169068_qa_5/task.toml +++ b/tasks/0132_169_132169068_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_236_132236539_qa_5/environment/bootstrap.sh b/tasks/0132_236_132236539_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_236_132236539_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_236_132236539_qa_5/environment/pull_bucket.py b/tasks/0132_236_132236539_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_236_132236539_qa_5/environment/pull_bucket.py +++ b/tasks/0132_236_132236539_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_236_132236539_qa_5/task.toml b/tasks/0132_236_132236539_qa_5/task.toml index 65b309e0af15a6d853e7c5f30c96b16a6ec62fc3..546fbf619abec59726077170aa8a1cc8082a8dc3 100644 --- a/tasks/0132_236_132236539_qa_5/task.toml +++ b/tasks/0132_236_132236539_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_270_132270430_qa_1/environment/bootstrap.sh b/tasks/0132_270_132270430_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_270_132270430_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_270_132270430_qa_1/environment/pull_bucket.py b/tasks/0132_270_132270430_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_270_132270430_qa_1/environment/pull_bucket.py +++ b/tasks/0132_270_132270430_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_270_132270430_qa_1/task.toml b/tasks/0132_270_132270430_qa_1/task.toml index e6a98b7a29e83e744300287bf7dc704c488882f4..5c5cfe445ec14e7bcf73f47c8d5eaa51ae51bd7d 100644 --- a/tasks/0132_270_132270430_qa_1/task.toml +++ b/tasks/0132_270_132270430_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_270_132270430_qa_4/environment/bootstrap.sh b/tasks/0132_270_132270430_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_270_132270430_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_270_132270430_qa_4/environment/pull_bucket.py b/tasks/0132_270_132270430_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_270_132270430_qa_4/environment/pull_bucket.py +++ b/tasks/0132_270_132270430_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_270_132270430_qa_4/task.toml b/tasks/0132_270_132270430_qa_4/task.toml index 28db2d858765de2141785f0751ca3c819aae525f..24c5afe6a0808523d3577a48e5fe22039e276fa1 100644 --- a/tasks/0132_270_132270430_qa_4/task.toml +++ b/tasks/0132_270_132270430_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_290_132290375_qa_2/environment/bootstrap.sh b/tasks/0132_290_132290375_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_290_132290375_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_290_132290375_qa_2/environment/pull_bucket.py b/tasks/0132_290_132290375_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_290_132290375_qa_2/environment/pull_bucket.py +++ b/tasks/0132_290_132290375_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_290_132290375_qa_2/task.toml b/tasks/0132_290_132290375_qa_2/task.toml index 0295bbb11751f068af3c47d70b3acd73240e361f..5d1b71a2e198ebbe6c2c249ae8ee3211c7b7c7d1 100644 --- a/tasks/0132_290_132290375_qa_2/task.toml +++ b/tasks/0132_290_132290375_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_422_132422220_qa_2/environment/bootstrap.sh b/tasks/0132_422_132422220_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_422_132422220_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_422_132422220_qa_2/environment/pull_bucket.py b/tasks/0132_422_132422220_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_422_132422220_qa_2/environment/pull_bucket.py +++ b/tasks/0132_422_132422220_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_422_132422220_qa_2/task.toml b/tasks/0132_422_132422220_qa_2/task.toml index 6f61abd50cb12c45a055ff5534523164a694db04..7b96bced7dcd73f9dd3e103894831d2ea3531636 100644 --- a/tasks/0132_422_132422220_qa_2/task.toml +++ b/tasks/0132_422_132422220_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_434_132434308_qa_2/environment/bootstrap.sh b/tasks/0132_434_132434308_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_434_132434308_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_434_132434308_qa_2/environment/pull_bucket.py b/tasks/0132_434_132434308_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_434_132434308_qa_2/environment/pull_bucket.py +++ b/tasks/0132_434_132434308_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_434_132434308_qa_2/task.toml b/tasks/0132_434_132434308_qa_2/task.toml index f1c560360ff9e1d62c0b40e9dc257b151d497de3..53af435bc96b4421cb2ee62add7e08a3b150ac62 100644 --- a/tasks/0132_434_132434308_qa_2/task.toml +++ b/tasks/0132_434_132434308_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_444_132444361_qa_4/environment/bootstrap.sh b/tasks/0132_444_132444361_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_444_132444361_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_444_132444361_qa_4/environment/pull_bucket.py b/tasks/0132_444_132444361_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_444_132444361_qa_4/environment/pull_bucket.py +++ b/tasks/0132_444_132444361_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_444_132444361_qa_4/task.toml b/tasks/0132_444_132444361_qa_4/task.toml index b1700dab480b093c567c88db0e6d4400a3847044..ec0bcb7a54d2fa6f368f1b006cca6dda8c19d3f2 100644 --- a/tasks/0132_444_132444361_qa_4/task.toml +++ b/tasks/0132_444_132444361_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_459_132459719_qa_3/environment/bootstrap.sh b/tasks/0132_459_132459719_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_459_132459719_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_459_132459719_qa_3/environment/pull_bucket.py b/tasks/0132_459_132459719_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_459_132459719_qa_3/environment/pull_bucket.py +++ b/tasks/0132_459_132459719_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_459_132459719_qa_3/task.toml b/tasks/0132_459_132459719_qa_3/task.toml index 2c1f14e30598cf0304ab907d1607493fef1a66d6..a2b1081e40c7a8ac3a9fa998c578fed69c9f585b 100644 --- a/tasks/0132_459_132459719_qa_3/task.toml +++ b/tasks/0132_459_132459719_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_471_132471120_qa_4/environment/bootstrap.sh b/tasks/0132_471_132471120_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_471_132471120_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_471_132471120_qa_4/environment/pull_bucket.py b/tasks/0132_471_132471120_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_471_132471120_qa_4/environment/pull_bucket.py +++ b/tasks/0132_471_132471120_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_471_132471120_qa_4/task.toml b/tasks/0132_471_132471120_qa_4/task.toml index 83098f9ee642972ccfebeea9450f833e06cca753..405b4b17fa975b6caf10bbc9ff89c5c0571eab32 100644 --- a/tasks/0132_471_132471120_qa_4/task.toml +++ b/tasks/0132_471_132471120_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_538_132538004_qa_1/environment/bootstrap.sh b/tasks/0132_538_132538004_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_538_132538004_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_538_132538004_qa_1/environment/pull_bucket.py b/tasks/0132_538_132538004_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_538_132538004_qa_1/environment/pull_bucket.py +++ b/tasks/0132_538_132538004_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_538_132538004_qa_1/task.toml b/tasks/0132_538_132538004_qa_1/task.toml index df8bea45a38707a479be5efa49151d6668c42917..f00f73894cf2cca61e36c104cd4d744c4c4c1bb8 100644 --- a/tasks/0132_538_132538004_qa_1/task.toml +++ b/tasks/0132_538_132538004_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_538_132538004_qa_5/environment/bootstrap.sh b/tasks/0132_538_132538004_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_538_132538004_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_538_132538004_qa_5/environment/pull_bucket.py b/tasks/0132_538_132538004_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_538_132538004_qa_5/environment/pull_bucket.py +++ b/tasks/0132_538_132538004_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_538_132538004_qa_5/task.toml b/tasks/0132_538_132538004_qa_5/task.toml index a1f3e8250093cf040b45308da00d3d38e588dcfc..1fb0112601745460711a226bf52bbb7c5d2fe52c 100644 --- a/tasks/0132_538_132538004_qa_5/task.toml +++ b/tasks/0132_538_132538004_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_564_132564402_qa_5/environment/bootstrap.sh b/tasks/0132_564_132564402_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_564_132564402_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_564_132564402_qa_5/environment/pull_bucket.py b/tasks/0132_564_132564402_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_564_132564402_qa_5/environment/pull_bucket.py +++ b/tasks/0132_564_132564402_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_564_132564402_qa_5/task.toml b/tasks/0132_564_132564402_qa_5/task.toml index 46226db6a08571db497f413c932f817ce934a813..951b1756ceb04ac21265f27b2b17221bad50f6de 100644 --- a/tasks/0132_564_132564402_qa_5/task.toml +++ b/tasks/0132_564_132564402_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_566_132566728_qa_4/environment/bootstrap.sh b/tasks/0132_566_132566728_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_566_132566728_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_566_132566728_qa_4/environment/pull_bucket.py b/tasks/0132_566_132566728_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_566_132566728_qa_4/environment/pull_bucket.py +++ b/tasks/0132_566_132566728_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_566_132566728_qa_4/task.toml b/tasks/0132_566_132566728_qa_4/task.toml index 28bd4aa49875c4331ce352b33a289ed49c4d5e45..517d034846bf287f370738898e76f74b38c75701 100644 --- a/tasks/0132_566_132566728_qa_4/task.toml +++ b/tasks/0132_566_132566728_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_576_132576525_qa_4/environment/bootstrap.sh b/tasks/0132_576_132576525_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_576_132576525_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_576_132576525_qa_4/environment/pull_bucket.py b/tasks/0132_576_132576525_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_576_132576525_qa_4/environment/pull_bucket.py +++ b/tasks/0132_576_132576525_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_576_132576525_qa_4/task.toml b/tasks/0132_576_132576525_qa_4/task.toml index 4e179672e8331cd6d7737e738954a20b2e5641f8..f8e6aea31eee99a49a367cb43f13a97cb8fe41e1 100644 --- a/tasks/0132_576_132576525_qa_4/task.toml +++ b/tasks/0132_576_132576525_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_596_132596500_qa_5/environment/bootstrap.sh b/tasks/0132_596_132596500_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_596_132596500_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_596_132596500_qa_5/environment/pull_bucket.py b/tasks/0132_596_132596500_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_596_132596500_qa_5/environment/pull_bucket.py +++ b/tasks/0132_596_132596500_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_596_132596500_qa_5/task.toml b/tasks/0132_596_132596500_qa_5/task.toml index e7e700ee3f9924a430c9a8e959d813459a6a3ef0..f2d20a79f37028d0c2f272f783b9550eae68ec77 100644 --- a/tasks/0132_596_132596500_qa_5/task.toml +++ b/tasks/0132_596_132596500_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_623_132623331_qa_1/environment/bootstrap.sh b/tasks/0132_623_132623331_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_623_132623331_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_623_132623331_qa_1/environment/pull_bucket.py b/tasks/0132_623_132623331_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_623_132623331_qa_1/environment/pull_bucket.py +++ b/tasks/0132_623_132623331_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_623_132623331_qa_1/task.toml b/tasks/0132_623_132623331_qa_1/task.toml index 0e455fdefea07083a4ded5cbee34b3427f78c522..efa69d14d54c129907c38b4627b0df8703b762d4 100644 --- a/tasks/0132_623_132623331_qa_1/task.toml +++ b/tasks/0132_623_132623331_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_624_132624870_qa_4/environment/bootstrap.sh b/tasks/0132_624_132624870_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_624_132624870_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_624_132624870_qa_4/environment/pull_bucket.py b/tasks/0132_624_132624870_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_624_132624870_qa_4/environment/pull_bucket.py +++ b/tasks/0132_624_132624870_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_624_132624870_qa_4/task.toml b/tasks/0132_624_132624870_qa_4/task.toml index b1007aa0e41c453f331bcc403e44abfa09831627..67c603780ae01dd9629cee6be4b4aff1238c4ea2 100644 --- a/tasks/0132_624_132624870_qa_4/task.toml +++ b/tasks/0132_624_132624870_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_624_132624870_qa_5/environment/bootstrap.sh b/tasks/0132_624_132624870_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_624_132624870_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_624_132624870_qa_5/environment/pull_bucket.py b/tasks/0132_624_132624870_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_624_132624870_qa_5/environment/pull_bucket.py +++ b/tasks/0132_624_132624870_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_624_132624870_qa_5/task.toml b/tasks/0132_624_132624870_qa_5/task.toml index 88199cd7044f53b43d42315ca7413218e6e80d47..6b810fdcbe8e3f2ab59756a3038a5026fa9025d7 100644 --- a/tasks/0132_624_132624870_qa_5/task.toml +++ b/tasks/0132_624_132624870_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_642_132642166_qa_1/environment/bootstrap.sh b/tasks/0132_642_132642166_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_642_132642166_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_642_132642166_qa_1/environment/pull_bucket.py b/tasks/0132_642_132642166_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_642_132642166_qa_1/environment/pull_bucket.py +++ b/tasks/0132_642_132642166_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_642_132642166_qa_1/task.toml b/tasks/0132_642_132642166_qa_1/task.toml index 74f2bf97ffd1c1d2f448e01432cd636d2ca4ca41..caa368158c65589b7cf02e8f47a0f0c35b10f219 100644 --- a/tasks/0132_642_132642166_qa_1/task.toml +++ b/tasks/0132_642_132642166_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_642_132642166_qa_2/environment/bootstrap.sh b/tasks/0132_642_132642166_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_642_132642166_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_642_132642166_qa_2/environment/pull_bucket.py b/tasks/0132_642_132642166_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_642_132642166_qa_2/environment/pull_bucket.py +++ b/tasks/0132_642_132642166_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_642_132642166_qa_2/task.toml b/tasks/0132_642_132642166_qa_2/task.toml index 57a3e0a561921b9349c1721fdadf2ca45f1675ef..c34b76105978ee02eb23ba85ac7965f55727f4e5 100644 --- a/tasks/0132_642_132642166_qa_2/task.toml +++ b/tasks/0132_642_132642166_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_642_132642166_qa_3/environment/bootstrap.sh b/tasks/0132_642_132642166_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_642_132642166_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_642_132642166_qa_3/environment/pull_bucket.py b/tasks/0132_642_132642166_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_642_132642166_qa_3/environment/pull_bucket.py +++ b/tasks/0132_642_132642166_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_642_132642166_qa_3/task.toml b/tasks/0132_642_132642166_qa_3/task.toml index eb84d453c9718eec7b282e7da744f0961d552b4e..db38d6fcf097e24f7acf3e69a0231c679bf04e7b 100644 --- a/tasks/0132_642_132642166_qa_3/task.toml +++ b/tasks/0132_642_132642166_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_665_132665003_qa_1/environment/bootstrap.sh b/tasks/0132_665_132665003_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_665_132665003_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_665_132665003_qa_1/environment/pull_bucket.py b/tasks/0132_665_132665003_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_665_132665003_qa_1/environment/pull_bucket.py +++ b/tasks/0132_665_132665003_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_665_132665003_qa_1/task.toml b/tasks/0132_665_132665003_qa_1/task.toml index 89c95941027281f0962f0ad43e08dfc61df7d7c5..9ba4b7c8df9b015b18585f6858e00390513a7c6c 100644 --- a/tasks/0132_665_132665003_qa_1/task.toml +++ b/tasks/0132_665_132665003_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_672_132672509_qa_1/environment/bootstrap.sh b/tasks/0132_672_132672509_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_672_132672509_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_672_132672509_qa_1/environment/pull_bucket.py b/tasks/0132_672_132672509_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_672_132672509_qa_1/environment/pull_bucket.py +++ b/tasks/0132_672_132672509_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_672_132672509_qa_1/task.toml b/tasks/0132_672_132672509_qa_1/task.toml index 4636d744033dd44e225aa91fa9d9aa7cbb89e130..deebdbc13b60e6448f8f0ab3b5cbdcfeb4cc4aa2 100644 --- a/tasks/0132_672_132672509_qa_1/task.toml +++ b/tasks/0132_672_132672509_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_672_132672509_qa_3/environment/bootstrap.sh b/tasks/0132_672_132672509_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_672_132672509_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_672_132672509_qa_3/environment/pull_bucket.py b/tasks/0132_672_132672509_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_672_132672509_qa_3/environment/pull_bucket.py +++ b/tasks/0132_672_132672509_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_672_132672509_qa_3/task.toml b/tasks/0132_672_132672509_qa_3/task.toml index 510097495a50023c405e07b3e29f1aa01f7055f7..a7b816dd5012a9c2391cbaf62aa714cb00291c93 100644 --- a/tasks/0132_672_132672509_qa_3/task.toml +++ b/tasks/0132_672_132672509_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_865_132865792_qa_1/environment/bootstrap.sh b/tasks/0132_865_132865792_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_865_132865792_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_865_132865792_qa_1/environment/pull_bucket.py b/tasks/0132_865_132865792_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_865_132865792_qa_1/environment/pull_bucket.py +++ b/tasks/0132_865_132865792_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_865_132865792_qa_1/task.toml b/tasks/0132_865_132865792_qa_1/task.toml index d65ac655d1535515c009a4413cbdac0f43c60111..30cc36ee3ccda0993e4fd6691ddfb5c2e0b82797 100644 --- a/tasks/0132_865_132865792_qa_1/task.toml +++ b/tasks/0132_865_132865792_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_865_132865792_qa_4/environment/bootstrap.sh b/tasks/0132_865_132865792_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_865_132865792_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_865_132865792_qa_4/environment/pull_bucket.py b/tasks/0132_865_132865792_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_865_132865792_qa_4/environment/pull_bucket.py +++ b/tasks/0132_865_132865792_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_865_132865792_qa_4/task.toml b/tasks/0132_865_132865792_qa_4/task.toml index 6d6575cf7d890e9f451527db90126108f16b7c6c..7952a3fcd7ad6de915ec0a276c2be0ca627ea3e7 100644 --- a/tasks/0132_865_132865792_qa_4/task.toml +++ b/tasks/0132_865_132865792_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_903_132903502_qa_3/environment/bootstrap.sh b/tasks/0132_903_132903502_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_903_132903502_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_903_132903502_qa_3/environment/pull_bucket.py b/tasks/0132_903_132903502_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_903_132903502_qa_3/environment/pull_bucket.py +++ b/tasks/0132_903_132903502_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_903_132903502_qa_3/task.toml b/tasks/0132_903_132903502_qa_3/task.toml index e35dd6ac307be4d0cacdbadde6a9af2dbfcd03a7..54807c51ec5fa631707b1b0f017711e6baf96345 100644 --- a/tasks/0132_903_132903502_qa_3/task.toml +++ b/tasks/0132_903_132903502_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_903_132903502_qa_5/environment/bootstrap.sh b/tasks/0132_903_132903502_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_903_132903502_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_903_132903502_qa_5/environment/pull_bucket.py b/tasks/0132_903_132903502_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_903_132903502_qa_5/environment/pull_bucket.py +++ b/tasks/0132_903_132903502_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_903_132903502_qa_5/task.toml b/tasks/0132_903_132903502_qa_5/task.toml index d6d4f24198118f644bb9026d23fabefa00e82179..bcb42c0a371a38c119293a19042a515b539935f3 100644 --- a/tasks/0132_903_132903502_qa_5/task.toml +++ b/tasks/0132_903_132903502_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_967_132967098_qa_4/environment/bootstrap.sh b/tasks/0132_967_132967098_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_967_132967098_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_967_132967098_qa_4/environment/pull_bucket.py b/tasks/0132_967_132967098_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_967_132967098_qa_4/environment/pull_bucket.py +++ b/tasks/0132_967_132967098_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_967_132967098_qa_4/task.toml b/tasks/0132_967_132967098_qa_4/task.toml index 7efe865eb00e0527f9f29d48015fd1222e0d81e4..806e5f8b01130eb976f392131debdda5f9c2861f 100644 --- a/tasks/0132_967_132967098_qa_4/task.toml +++ b/tasks/0132_967_132967098_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_967_132967098_qa_5/environment/bootstrap.sh b/tasks/0132_967_132967098_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_967_132967098_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_967_132967098_qa_5/environment/pull_bucket.py b/tasks/0132_967_132967098_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_967_132967098_qa_5/environment/pull_bucket.py +++ b/tasks/0132_967_132967098_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_967_132967098_qa_5/task.toml b/tasks/0132_967_132967098_qa_5/task.toml index 68e3ff66398fc07af0cc5c9617ff92baf0009d7a..a32e0b5c3a8fda10b222e0cbe96ac12e4c139738 100644 --- a/tasks/0132_967_132967098_qa_5/task.toml +++ b/tasks/0132_967_132967098_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0132_989_132989870_qa_5/environment/bootstrap.sh b/tasks/0132_989_132989870_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0132_989_132989870_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0132_989_132989870_qa_5/environment/pull_bucket.py b/tasks/0132_989_132989870_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0132_989_132989870_qa_5/environment/pull_bucket.py +++ b/tasks/0132_989_132989870_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0132_989_132989870_qa_5/task.toml b/tasks/0132_989_132989870_qa_5/task.toml index 7736f28a9cfce461ca87224cba97ca50ca5f2d06..fb6a6e2da6725afe82a71b5e14d20fc95fbbdb4d 100644 --- a/tasks/0132_989_132989870_qa_5/task.toml +++ b/tasks/0132_989_132989870_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_024_133024285_qa_4/environment/bootstrap.sh b/tasks/0133_024_133024285_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_024_133024285_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_024_133024285_qa_4/environment/pull_bucket.py b/tasks/0133_024_133024285_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_024_133024285_qa_4/environment/pull_bucket.py +++ b/tasks/0133_024_133024285_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_024_133024285_qa_4/task.toml b/tasks/0133_024_133024285_qa_4/task.toml index b734fc3bb6d32d9ab808b125035253967110bf65..45be6dd5981b8162ae872db80e9aa280db2d72fc 100644 --- a/tasks/0133_024_133024285_qa_4/task.toml +++ b/tasks/0133_024_133024285_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_040_133040358_qa_3/environment/bootstrap.sh b/tasks/0133_040_133040358_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_040_133040358_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_040_133040358_qa_3/environment/pull_bucket.py b/tasks/0133_040_133040358_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_040_133040358_qa_3/environment/pull_bucket.py +++ b/tasks/0133_040_133040358_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_040_133040358_qa_3/task.toml b/tasks/0133_040_133040358_qa_3/task.toml index 294df061912caa4c0bb83accc31091c747b25807..e2c9744d52590a59e4a26014c73dd294c7a4f8ba 100644 --- a/tasks/0133_040_133040358_qa_3/task.toml +++ b/tasks/0133_040_133040358_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_047_133047390_qa_2/environment/bootstrap.sh b/tasks/0133_047_133047390_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_047_133047390_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_047_133047390_qa_2/environment/pull_bucket.py b/tasks/0133_047_133047390_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_047_133047390_qa_2/environment/pull_bucket.py +++ b/tasks/0133_047_133047390_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_047_133047390_qa_2/task.toml b/tasks/0133_047_133047390_qa_2/task.toml index e9d490555ff1b0e0c0149b31d04800c2c6a80cbb..97c108c122659a19ac158e9fe3f4d057198bf91f 100644 --- a/tasks/0133_047_133047390_qa_2/task.toml +++ b/tasks/0133_047_133047390_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_078_133078833_qa_1/environment/bootstrap.sh b/tasks/0133_078_133078833_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_078_133078833_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_078_133078833_qa_1/environment/pull_bucket.py b/tasks/0133_078_133078833_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_078_133078833_qa_1/environment/pull_bucket.py +++ b/tasks/0133_078_133078833_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_078_133078833_qa_1/task.toml b/tasks/0133_078_133078833_qa_1/task.toml index 8d86889fa51e8ea8d144b8a81b129f0c5fe5a25a..060d0549aecee58f81b74520bf3b988d39f74530 100644 --- a/tasks/0133_078_133078833_qa_1/task.toml +++ b/tasks/0133_078_133078833_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_079_133079906_qa_3/environment/bootstrap.sh b/tasks/0133_079_133079906_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_079_133079906_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_079_133079906_qa_3/environment/pull_bucket.py b/tasks/0133_079_133079906_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_079_133079906_qa_3/environment/pull_bucket.py +++ b/tasks/0133_079_133079906_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_079_133079906_qa_3/task.toml b/tasks/0133_079_133079906_qa_3/task.toml index dcee390cca5a7b46be054c58198d88fd59d3a9c5..c4e0b14fee647898176fd179ff37b6255d1357fb 100644 --- a/tasks/0133_079_133079906_qa_3/task.toml +++ b/tasks/0133_079_133079906_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_079_133079906_qa_4/environment/bootstrap.sh b/tasks/0133_079_133079906_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_079_133079906_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_079_133079906_qa_4/environment/pull_bucket.py b/tasks/0133_079_133079906_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_079_133079906_qa_4/environment/pull_bucket.py +++ b/tasks/0133_079_133079906_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_079_133079906_qa_4/task.toml b/tasks/0133_079_133079906_qa_4/task.toml index 800811f4e8608b81c660e9ebf3c0e77ea803b7e2..9c824a294f7398c36acfbeacef23caadca0cf7a6 100644 --- a/tasks/0133_079_133079906_qa_4/task.toml +++ b/tasks/0133_079_133079906_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_089_133089049_qa_3/environment/bootstrap.sh b/tasks/0133_089_133089049_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_089_133089049_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_089_133089049_qa_3/environment/pull_bucket.py b/tasks/0133_089_133089049_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_089_133089049_qa_3/environment/pull_bucket.py +++ b/tasks/0133_089_133089049_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_089_133089049_qa_3/task.toml b/tasks/0133_089_133089049_qa_3/task.toml index 03f24418add2463f891d692d3f84de8ea5155d7d..56f01b5989739e2fddb4637dc1c4134985665e8c 100644 --- a/tasks/0133_089_133089049_qa_3/task.toml +++ b/tasks/0133_089_133089049_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_196_133196028_qa_4/environment/bootstrap.sh b/tasks/0133_196_133196028_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_196_133196028_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_196_133196028_qa_4/environment/pull_bucket.py b/tasks/0133_196_133196028_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_196_133196028_qa_4/environment/pull_bucket.py +++ b/tasks/0133_196_133196028_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_196_133196028_qa_4/task.toml b/tasks/0133_196_133196028_qa_4/task.toml index 451217947a7a078c5c519ac134bfbffcca294361..3d6920da0c0c338dc2ba750be387a36fe587b28c 100644 --- a/tasks/0133_196_133196028_qa_4/task.toml +++ b/tasks/0133_196_133196028_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_423_133423579_qa_4/environment/bootstrap.sh b/tasks/0133_423_133423579_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_423_133423579_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_423_133423579_qa_4/environment/pull_bucket.py b/tasks/0133_423_133423579_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_423_133423579_qa_4/environment/pull_bucket.py +++ b/tasks/0133_423_133423579_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_423_133423579_qa_4/task.toml b/tasks/0133_423_133423579_qa_4/task.toml index 6ca7b5d0e7658d3d1df267b0d0b9da588c449ca2..f74dc505a4c29619d143380dbbffab8603975dcd 100644 --- a/tasks/0133_423_133423579_qa_4/task.toml +++ b/tasks/0133_423_133423579_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_522_133522334_qa_5/environment/bootstrap.sh b/tasks/0133_522_133522334_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_522_133522334_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_522_133522334_qa_5/environment/pull_bucket.py b/tasks/0133_522_133522334_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_522_133522334_qa_5/environment/pull_bucket.py +++ b/tasks/0133_522_133522334_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_522_133522334_qa_5/task.toml b/tasks/0133_522_133522334_qa_5/task.toml index dd36711064d71e13e26a13f019bbbafc2f60274e..d258c844ceb76e3347448e0c5053a5302434dbba 100644 --- a/tasks/0133_522_133522334_qa_5/task.toml +++ b/tasks/0133_522_133522334_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_533_133533460_qa_2/environment/bootstrap.sh b/tasks/0133_533_133533460_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_533_133533460_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_533_133533460_qa_2/environment/pull_bucket.py b/tasks/0133_533_133533460_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_533_133533460_qa_2/environment/pull_bucket.py +++ b/tasks/0133_533_133533460_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_533_133533460_qa_2/task.toml b/tasks/0133_533_133533460_qa_2/task.toml index 5201cb7b30a49dac92a2cbcf388a5a6f2026ac97..3bd36324afb596aa0990ca4568b34a996daced18 100644 --- a/tasks/0133_533_133533460_qa_2/task.toml +++ b/tasks/0133_533_133533460_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_533_133533460_qa_5/environment/bootstrap.sh b/tasks/0133_533_133533460_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_533_133533460_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_533_133533460_qa_5/environment/pull_bucket.py b/tasks/0133_533_133533460_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_533_133533460_qa_5/environment/pull_bucket.py +++ b/tasks/0133_533_133533460_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_533_133533460_qa_5/task.toml b/tasks/0133_533_133533460_qa_5/task.toml index 6065f693e952a22df7607047aa642128997e3e3f..1438df724564234a0f96153e72eefaf468c83ab4 100644 --- a/tasks/0133_533_133533460_qa_5/task.toml +++ b/tasks/0133_533_133533460_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_561_133561697_qa_2/environment/bootstrap.sh b/tasks/0133_561_133561697_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_561_133561697_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_561_133561697_qa_2/environment/pull_bucket.py b/tasks/0133_561_133561697_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_561_133561697_qa_2/environment/pull_bucket.py +++ b/tasks/0133_561_133561697_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_561_133561697_qa_2/task.toml b/tasks/0133_561_133561697_qa_2/task.toml index d65eb427ad2c306da9144695e50b82110cf40c47..5cf7b9a4a1fce70a34f5781ad374dbb9700a0ea2 100644 --- a/tasks/0133_561_133561697_qa_2/task.toml +++ b/tasks/0133_561_133561697_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_586_133586216_qa_3/environment/bootstrap.sh b/tasks/0133_586_133586216_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_586_133586216_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_586_133586216_qa_3/environment/pull_bucket.py b/tasks/0133_586_133586216_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_586_133586216_qa_3/environment/pull_bucket.py +++ b/tasks/0133_586_133586216_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_586_133586216_qa_3/task.toml b/tasks/0133_586_133586216_qa_3/task.toml index 47e9c29bbf052244856d8b5915948520d7c703a0..b6e1de8dc115e36b8f183d0bdfb9995588681f2a 100644 --- a/tasks/0133_586_133586216_qa_3/task.toml +++ b/tasks/0133_586_133586216_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_586_133586216_qa_4/environment/bootstrap.sh b/tasks/0133_586_133586216_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_586_133586216_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_586_133586216_qa_4/environment/pull_bucket.py b/tasks/0133_586_133586216_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_586_133586216_qa_4/environment/pull_bucket.py +++ b/tasks/0133_586_133586216_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_586_133586216_qa_4/task.toml b/tasks/0133_586_133586216_qa_4/task.toml index 8916df3450c34727c66ea61477ac30317db32498..4a09345cbf10642bdbb63cf1068bd78224ecec40 100644 --- a/tasks/0133_586_133586216_qa_4/task.toml +++ b/tasks/0133_586_133586216_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_586_133586216_qa_5/environment/bootstrap.sh b/tasks/0133_586_133586216_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_586_133586216_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_586_133586216_qa_5/environment/pull_bucket.py b/tasks/0133_586_133586216_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_586_133586216_qa_5/environment/pull_bucket.py +++ b/tasks/0133_586_133586216_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_586_133586216_qa_5/task.toml b/tasks/0133_586_133586216_qa_5/task.toml index 1b1f476965812c9dbe889ab2e9f8b07c608dac3b..b8c17ef916772e1053025aac34d8787f2c5b5012 100644 --- a/tasks/0133_586_133586216_qa_5/task.toml +++ b/tasks/0133_586_133586216_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_597_133597962_qa_4/environment/bootstrap.sh b/tasks/0133_597_133597962_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_597_133597962_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_597_133597962_qa_4/environment/pull_bucket.py b/tasks/0133_597_133597962_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_597_133597962_qa_4/environment/pull_bucket.py +++ b/tasks/0133_597_133597962_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_597_133597962_qa_4/task.toml b/tasks/0133_597_133597962_qa_4/task.toml index eb50d199fa9e8ca3d20c3ba4123acb1c70131b56..adf86fefb0f3e0dc0b5531486bd931e711e55f99 100644 --- a/tasks/0133_597_133597962_qa_4/task.toml +++ b/tasks/0133_597_133597962_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_615_133615287_qa_1/environment/bootstrap.sh b/tasks/0133_615_133615287_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_615_133615287_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_615_133615287_qa_1/environment/pull_bucket.py b/tasks/0133_615_133615287_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_615_133615287_qa_1/environment/pull_bucket.py +++ b/tasks/0133_615_133615287_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_615_133615287_qa_1/task.toml b/tasks/0133_615_133615287_qa_1/task.toml index 8295c77a5ffcbb014ce91d972affe24d68445499..2979c335c5c0900f9f6963f28be6515c2ded3178 100644 --- a/tasks/0133_615_133615287_qa_1/task.toml +++ b/tasks/0133_615_133615287_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_615_133615287_qa_4/environment/bootstrap.sh b/tasks/0133_615_133615287_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_615_133615287_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_615_133615287_qa_4/environment/pull_bucket.py b/tasks/0133_615_133615287_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_615_133615287_qa_4/environment/pull_bucket.py +++ b/tasks/0133_615_133615287_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_615_133615287_qa_4/task.toml b/tasks/0133_615_133615287_qa_4/task.toml index 18fbbf92bddd34f8115c2efbeba3e50fb7b7d557..e5158e63933e079c6a389270fbf26621d8702e42 100644 --- a/tasks/0133_615_133615287_qa_4/task.toml +++ b/tasks/0133_615_133615287_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_625_133625301_qa_2/environment/bootstrap.sh b/tasks/0133_625_133625301_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_625_133625301_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_625_133625301_qa_2/environment/pull_bucket.py b/tasks/0133_625_133625301_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_625_133625301_qa_2/environment/pull_bucket.py +++ b/tasks/0133_625_133625301_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_625_133625301_qa_2/task.toml b/tasks/0133_625_133625301_qa_2/task.toml index cedb5cf0ff0f389172c7602161f4fe402ef0eae7..3a61e233cb2d50a353266e9b3bb1f985f17d6956 100644 --- a/tasks/0133_625_133625301_qa_2/task.toml +++ b/tasks/0133_625_133625301_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_688_133688260_qa_1/environment/bootstrap.sh b/tasks/0133_688_133688260_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_688_133688260_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_688_133688260_qa_1/environment/pull_bucket.py b/tasks/0133_688_133688260_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_688_133688260_qa_1/environment/pull_bucket.py +++ b/tasks/0133_688_133688260_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_688_133688260_qa_1/task.toml b/tasks/0133_688_133688260_qa_1/task.toml index 1ddf823c6c8ae21fcb4b475e1a6acd6ef019ac0d..2f51fad142cb3145ce13619bb4828833c4714548 100644 --- a/tasks/0133_688_133688260_qa_1/task.toml +++ b/tasks/0133_688_133688260_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_688_133688260_qa_4/environment/bootstrap.sh b/tasks/0133_688_133688260_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_688_133688260_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_688_133688260_qa_4/environment/pull_bucket.py b/tasks/0133_688_133688260_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_688_133688260_qa_4/environment/pull_bucket.py +++ b/tasks/0133_688_133688260_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_688_133688260_qa_4/task.toml b/tasks/0133_688_133688260_qa_4/task.toml index 45b3339f52494ec5d541803e31d62ea052e4198d..0e1c962eed30f04c763cd60ad22a0d80d783cfc2 100644 --- a/tasks/0133_688_133688260_qa_4/task.toml +++ b/tasks/0133_688_133688260_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_909_133909373_qa_3/environment/bootstrap.sh b/tasks/0133_909_133909373_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_909_133909373_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_909_133909373_qa_3/environment/pull_bucket.py b/tasks/0133_909_133909373_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_909_133909373_qa_3/environment/pull_bucket.py +++ b/tasks/0133_909_133909373_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_909_133909373_qa_3/task.toml b/tasks/0133_909_133909373_qa_3/task.toml index a1190f361f46ea42d987e28ebf394ae466b6b9a4..6c91ea1edfd4790555f97b71ecc1169ed2c6cdff 100644 --- a/tasks/0133_909_133909373_qa_3/task.toml +++ b/tasks/0133_909_133909373_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_918_133918365_qa_5/environment/bootstrap.sh b/tasks/0133_918_133918365_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_918_133918365_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_918_133918365_qa_5/environment/pull_bucket.py b/tasks/0133_918_133918365_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_918_133918365_qa_5/environment/pull_bucket.py +++ b/tasks/0133_918_133918365_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_918_133918365_qa_5/task.toml b/tasks/0133_918_133918365_qa_5/task.toml index 7223f14ec95c72da6a442ebb88ec18f06f5c3322..2de79b4c544ed43ed352ca63de5cd9da3be64bb7 100644 --- a/tasks/0133_918_133918365_qa_5/task.toml +++ b/tasks/0133_918_133918365_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_985_133985861_qa_1/environment/bootstrap.sh b/tasks/0133_985_133985861_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_985_133985861_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_985_133985861_qa_1/environment/pull_bucket.py b/tasks/0133_985_133985861_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_985_133985861_qa_1/environment/pull_bucket.py +++ b/tasks/0133_985_133985861_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_985_133985861_qa_1/task.toml b/tasks/0133_985_133985861_qa_1/task.toml index 4b29d6d8d266799a3d2e71fc9de2a8f265fea289..fd275ebcd44176c7f6c3d798e7a21377be5191bb 100644 --- a/tasks/0133_985_133985861_qa_1/task.toml +++ b/tasks/0133_985_133985861_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_988_133988312_qa_2/environment/bootstrap.sh b/tasks/0133_988_133988312_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_988_133988312_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_988_133988312_qa_2/environment/pull_bucket.py b/tasks/0133_988_133988312_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_988_133988312_qa_2/environment/pull_bucket.py +++ b/tasks/0133_988_133988312_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_988_133988312_qa_2/task.toml b/tasks/0133_988_133988312_qa_2/task.toml index e9df8f901d385abb01f42b935f8cb0aef6d67298..00299eb1b7346d45aa9d16482d04287675acf73f 100644 --- a/tasks/0133_988_133988312_qa_2/task.toml +++ b/tasks/0133_988_133988312_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0133_988_133988312_qa_4/environment/bootstrap.sh b/tasks/0133_988_133988312_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0133_988_133988312_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0133_988_133988312_qa_4/environment/pull_bucket.py b/tasks/0133_988_133988312_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0133_988_133988312_qa_4/environment/pull_bucket.py +++ b/tasks/0133_988_133988312_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0133_988_133988312_qa_4/task.toml b/tasks/0133_988_133988312_qa_4/task.toml index 2a47084683b94962f6e48090777d396b6e33a832..0515630c2f92462fe99384771f084d0708318c0c 100644 --- a/tasks/0133_988_133988312_qa_4/task.toml +++ b/tasks/0133_988_133988312_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_109_134109927_qa_3/environment/bootstrap.sh b/tasks/0134_109_134109927_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_109_134109927_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_109_134109927_qa_3/environment/pull_bucket.py b/tasks/0134_109_134109927_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_109_134109927_qa_3/environment/pull_bucket.py +++ b/tasks/0134_109_134109927_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_109_134109927_qa_3/task.toml b/tasks/0134_109_134109927_qa_3/task.toml index 373fba789050f0a6ea09305b10b400570917da52..2ac3abd8a7bfb12c0c8950ba44aa75ab35d05e7b 100644 --- a/tasks/0134_109_134109927_qa_3/task.toml +++ b/tasks/0134_109_134109927_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_377_134377308_qa_3/environment/bootstrap.sh b/tasks/0134_377_134377308_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_377_134377308_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_377_134377308_qa_3/environment/pull_bucket.py b/tasks/0134_377_134377308_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_377_134377308_qa_3/environment/pull_bucket.py +++ b/tasks/0134_377_134377308_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_377_134377308_qa_3/task.toml b/tasks/0134_377_134377308_qa_3/task.toml index 151757e4e38f4c33d0474a00299c6659d57997c5..10e7d7ecbebf37fb761f3855ef89de539c90dfb0 100644 --- a/tasks/0134_377_134377308_qa_3/task.toml +++ b/tasks/0134_377_134377308_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_445_134445739_qa_2/environment/bootstrap.sh b/tasks/0134_445_134445739_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_445_134445739_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_445_134445739_qa_2/environment/pull_bucket.py b/tasks/0134_445_134445739_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_445_134445739_qa_2/environment/pull_bucket.py +++ b/tasks/0134_445_134445739_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_445_134445739_qa_2/task.toml b/tasks/0134_445_134445739_qa_2/task.toml index b1d16dc3ffff21bf6526e8e6726b98b4467d0fc7..2de2a4e79e926023c661cf6ec3375b22d7279e74 100644 --- a/tasks/0134_445_134445739_qa_2/task.toml +++ b/tasks/0134_445_134445739_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_484_134484147_qa_1/environment/bootstrap.sh b/tasks/0134_484_134484147_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_484_134484147_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_484_134484147_qa_1/environment/pull_bucket.py b/tasks/0134_484_134484147_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_484_134484147_qa_1/environment/pull_bucket.py +++ b/tasks/0134_484_134484147_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_484_134484147_qa_1/task.toml b/tasks/0134_484_134484147_qa_1/task.toml index 35828c2e3f6d21fdc3a81ebe8dde133bd679445c..7425c13a5e4d0c21cc31f6d423b6bf1c0664db4a 100644 --- a/tasks/0134_484_134484147_qa_1/task.toml +++ b/tasks/0134_484_134484147_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_657_134657302_qa_1/environment/bootstrap.sh b/tasks/0134_657_134657302_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_657_134657302_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_657_134657302_qa_1/environment/pull_bucket.py b/tasks/0134_657_134657302_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_657_134657302_qa_1/environment/pull_bucket.py +++ b/tasks/0134_657_134657302_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_657_134657302_qa_1/task.toml b/tasks/0134_657_134657302_qa_1/task.toml index 14fe4c60b200bbb575ee40df4a9af95fb627227b..beedfc1089b4a85d2694affcb4903e97d24da704 100644 --- a/tasks/0134_657_134657302_qa_1/task.toml +++ b/tasks/0134_657_134657302_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_683_134683130_qa_5/environment/bootstrap.sh b/tasks/0134_683_134683130_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_683_134683130_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_683_134683130_qa_5/environment/pull_bucket.py b/tasks/0134_683_134683130_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_683_134683130_qa_5/environment/pull_bucket.py +++ b/tasks/0134_683_134683130_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_683_134683130_qa_5/task.toml b/tasks/0134_683_134683130_qa_5/task.toml index 7d735b9efd67d4d0c1e60f49ebfae1e86be57528..d9a22afc920e86062ea9b660fa67dfb6185e631e 100644 --- a/tasks/0134_683_134683130_qa_5/task.toml +++ b/tasks/0134_683_134683130_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_878_134878027_qa_1/environment/bootstrap.sh b/tasks/0134_878_134878027_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_878_134878027_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_878_134878027_qa_1/environment/pull_bucket.py b/tasks/0134_878_134878027_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_878_134878027_qa_1/environment/pull_bucket.py +++ b/tasks/0134_878_134878027_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_878_134878027_qa_1/task.toml b/tasks/0134_878_134878027_qa_1/task.toml index 9f466771934faa69dee666201e9ef3fd988a6a0a..5648ae2723912094515a1812fb3529b534c80e53 100644 --- a/tasks/0134_878_134878027_qa_1/task.toml +++ b/tasks/0134_878_134878027_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_878_134878027_qa_3/environment/bootstrap.sh b/tasks/0134_878_134878027_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_878_134878027_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_878_134878027_qa_3/environment/pull_bucket.py b/tasks/0134_878_134878027_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_878_134878027_qa_3/environment/pull_bucket.py +++ b/tasks/0134_878_134878027_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_878_134878027_qa_3/task.toml b/tasks/0134_878_134878027_qa_3/task.toml index cd88ab047bb872adffdf387b938d76c477344fa9..8571e6feddf8a77aa889e35f53723049f0010591 100644 --- a/tasks/0134_878_134878027_qa_3/task.toml +++ b/tasks/0134_878_134878027_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0134_941_134941943_qa_1/environment/bootstrap.sh b/tasks/0134_941_134941943_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0134_941_134941943_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0134_941_134941943_qa_1/environment/pull_bucket.py b/tasks/0134_941_134941943_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0134_941_134941943_qa_1/environment/pull_bucket.py +++ b/tasks/0134_941_134941943_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0134_941_134941943_qa_1/task.toml b/tasks/0134_941_134941943_qa_1/task.toml index f77e276e329fce4a86effaf295e846c40c3118b0..9271549144ae1b44d48ac82ee1733568b8247df8 100644 --- a/tasks/0134_941_134941943_qa_1/task.toml +++ b/tasks/0134_941_134941943_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_043_135043306_qa_2/environment/bootstrap.sh b/tasks/0135_043_135043306_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_043_135043306_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_043_135043306_qa_2/environment/pull_bucket.py b/tasks/0135_043_135043306_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_043_135043306_qa_2/environment/pull_bucket.py +++ b/tasks/0135_043_135043306_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_043_135043306_qa_2/task.toml b/tasks/0135_043_135043306_qa_2/task.toml index 3bad556cf1d1d8cd2fcfb714abfb38be2c0b4f37..2aa276c919a2d65ec9eea57371ccadbd1825de10 100644 --- a/tasks/0135_043_135043306_qa_2/task.toml +++ b/tasks/0135_043_135043306_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_064_135064960_qa_5/environment/bootstrap.sh b/tasks/0135_064_135064960_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_064_135064960_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_064_135064960_qa_5/environment/pull_bucket.py b/tasks/0135_064_135064960_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_064_135064960_qa_5/environment/pull_bucket.py +++ b/tasks/0135_064_135064960_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_064_135064960_qa_5/task.toml b/tasks/0135_064_135064960_qa_5/task.toml index ac01a672b8d23579387875ebe3a59bb0783ea64d..734223fc7b54661934be4193da1624b9988dc441 100644 --- a/tasks/0135_064_135064960_qa_5/task.toml +++ b/tasks/0135_064_135064960_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_081_135081430_qa_5/environment/bootstrap.sh b/tasks/0135_081_135081430_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_081_135081430_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_081_135081430_qa_5/environment/pull_bucket.py b/tasks/0135_081_135081430_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_081_135081430_qa_5/environment/pull_bucket.py +++ b/tasks/0135_081_135081430_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_081_135081430_qa_5/task.toml b/tasks/0135_081_135081430_qa_5/task.toml index 75eb38957641bbd1514d745be118c3d9b0e95daa..85287222fc56a5cf47a2ff3d844b97c2f904d5b0 100644 --- a/tasks/0135_081_135081430_qa_5/task.toml +++ b/tasks/0135_081_135081430_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_081_135081694_qa_2/environment/bootstrap.sh b/tasks/0135_081_135081694_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_081_135081694_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_081_135081694_qa_2/environment/pull_bucket.py b/tasks/0135_081_135081694_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_081_135081694_qa_2/environment/pull_bucket.py +++ b/tasks/0135_081_135081694_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_081_135081694_qa_2/task.toml b/tasks/0135_081_135081694_qa_2/task.toml index c9aac1eb0a3fcdfce445cf49fea9cfd2175324d0..2997c3b439c64232d3f9be691651f4e94668778d 100644 --- a/tasks/0135_081_135081694_qa_2/task.toml +++ b/tasks/0135_081_135081694_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_081_135081694_qa_4/environment/bootstrap.sh b/tasks/0135_081_135081694_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_081_135081694_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_081_135081694_qa_4/environment/pull_bucket.py b/tasks/0135_081_135081694_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_081_135081694_qa_4/environment/pull_bucket.py +++ b/tasks/0135_081_135081694_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_081_135081694_qa_4/task.toml b/tasks/0135_081_135081694_qa_4/task.toml index cfa0b261af6a98ee726af1e89fc73fa70cae37c0..80e5abeb9dd9ee4dcd6fca4d7042ff4b58297c08 100644 --- a/tasks/0135_081_135081694_qa_4/task.toml +++ b/tasks/0135_081_135081694_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_081_135081694_qa_5/environment/bootstrap.sh b/tasks/0135_081_135081694_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_081_135081694_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_081_135081694_qa_5/environment/pull_bucket.py b/tasks/0135_081_135081694_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_081_135081694_qa_5/environment/pull_bucket.py +++ b/tasks/0135_081_135081694_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_081_135081694_qa_5/task.toml b/tasks/0135_081_135081694_qa_5/task.toml index a18dfabb9918ca95b400be505242799c70d34c78..709efd8ef535089849c26a92884a19def937c285 100644 --- a/tasks/0135_081_135081694_qa_5/task.toml +++ b/tasks/0135_081_135081694_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_081_135081983_qa_3/environment/bootstrap.sh b/tasks/0135_081_135081983_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_081_135081983_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_081_135081983_qa_3/environment/pull_bucket.py b/tasks/0135_081_135081983_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_081_135081983_qa_3/environment/pull_bucket.py +++ b/tasks/0135_081_135081983_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_081_135081983_qa_3/task.toml b/tasks/0135_081_135081983_qa_3/task.toml index 602b2b594e04910ba3fd2ff04daae0bbb5cb333e..d5f3333fc81d168230ebdf912f39f54111c05e8b 100644 --- a/tasks/0135_081_135081983_qa_3/task.toml +++ b/tasks/0135_081_135081983_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_170_135170219_qa_1/environment/bootstrap.sh b/tasks/0135_170_135170219_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_170_135170219_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_170_135170219_qa_1/environment/pull_bucket.py b/tasks/0135_170_135170219_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_170_135170219_qa_1/environment/pull_bucket.py +++ b/tasks/0135_170_135170219_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_170_135170219_qa_1/task.toml b/tasks/0135_170_135170219_qa_1/task.toml index 01375c6a0086a5697da8e6588169469e5d25208d..133bb10b6bbc652fdb6a7222ce8c9e4faa33a03e 100644 --- a/tasks/0135_170_135170219_qa_1/task.toml +++ b/tasks/0135_170_135170219_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_170_135170219_qa_4/environment/bootstrap.sh b/tasks/0135_170_135170219_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_170_135170219_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_170_135170219_qa_4/environment/pull_bucket.py b/tasks/0135_170_135170219_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_170_135170219_qa_4/environment/pull_bucket.py +++ b/tasks/0135_170_135170219_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_170_135170219_qa_4/task.toml b/tasks/0135_170_135170219_qa_4/task.toml index 567678a99c4902bf8706cff17ffa7ebbad4a7760..cdf3fcfeab5b6e05df90226a9921465b2f7593d1 100644 --- a/tasks/0135_170_135170219_qa_4/task.toml +++ b/tasks/0135_170_135170219_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_174_135174197_qa_4/environment/bootstrap.sh b/tasks/0135_174_135174197_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_174_135174197_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_174_135174197_qa_4/environment/pull_bucket.py b/tasks/0135_174_135174197_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_174_135174197_qa_4/environment/pull_bucket.py +++ b/tasks/0135_174_135174197_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_174_135174197_qa_4/task.toml b/tasks/0135_174_135174197_qa_4/task.toml index de8b4192dc8af94de9c9a39507a53c18477b56f3..2b389a52955fcfb2dedc4f5bdd7e241c7df3722d 100644 --- a/tasks/0135_174_135174197_qa_4/task.toml +++ b/tasks/0135_174_135174197_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_324_135324126_qa_2/environment/bootstrap.sh b/tasks/0135_324_135324126_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_324_135324126_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_324_135324126_qa_2/environment/pull_bucket.py b/tasks/0135_324_135324126_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_324_135324126_qa_2/environment/pull_bucket.py +++ b/tasks/0135_324_135324126_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_324_135324126_qa_2/task.toml b/tasks/0135_324_135324126_qa_2/task.toml index 41f47bec423a8c2b335d0c2caa74bb7d80791e71..9f0424f474d3cea55b5aed1a4e9dab3240c9fc76 100644 --- a/tasks/0135_324_135324126_qa_2/task.toml +++ b/tasks/0135_324_135324126_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_324_135324126_qa_3/environment/bootstrap.sh b/tasks/0135_324_135324126_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_324_135324126_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_324_135324126_qa_3/environment/pull_bucket.py b/tasks/0135_324_135324126_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_324_135324126_qa_3/environment/pull_bucket.py +++ b/tasks/0135_324_135324126_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_324_135324126_qa_3/task.toml b/tasks/0135_324_135324126_qa_3/task.toml index 3146cd9f3493054f2dea8033fecedf5595e29d95..614d0414e40adba9d233102c690ee5ba5437428c 100644 --- a/tasks/0135_324_135324126_qa_3/task.toml +++ b/tasks/0135_324_135324126_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_324_135324126_qa_5/environment/bootstrap.sh b/tasks/0135_324_135324126_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_324_135324126_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_324_135324126_qa_5/environment/pull_bucket.py b/tasks/0135_324_135324126_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_324_135324126_qa_5/environment/pull_bucket.py +++ b/tasks/0135_324_135324126_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_324_135324126_qa_5/task.toml b/tasks/0135_324_135324126_qa_5/task.toml index 890a9c589a642c41dda68fbba727688e478d5aab..3cfa87bf0a20f71932a5954b6a9bd40e1dd327c0 100644 --- a/tasks/0135_324_135324126_qa_5/task.toml +++ b/tasks/0135_324_135324126_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_355_135355749_qa_3/environment/bootstrap.sh b/tasks/0135_355_135355749_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_355_135355749_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_355_135355749_qa_3/environment/pull_bucket.py b/tasks/0135_355_135355749_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_355_135355749_qa_3/environment/pull_bucket.py +++ b/tasks/0135_355_135355749_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_355_135355749_qa_3/task.toml b/tasks/0135_355_135355749_qa_3/task.toml index 77e01add6a90487098d2599d307c222f06166a9d..dff1dc8af7355b12020cbbad92b95dc934f49dc5 100644 --- a/tasks/0135_355_135355749_qa_3/task.toml +++ b/tasks/0135_355_135355749_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_364_135364354_qa_3/environment/bootstrap.sh b/tasks/0135_364_135364354_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_364_135364354_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_364_135364354_qa_3/environment/pull_bucket.py b/tasks/0135_364_135364354_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_364_135364354_qa_3/environment/pull_bucket.py +++ b/tasks/0135_364_135364354_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_364_135364354_qa_3/task.toml b/tasks/0135_364_135364354_qa_3/task.toml index d046ae2e0fff0016ac6a3d507ea5f5b6c47c2419..9de0d7ede58a0d2871a09797a3e5e232cc8cabbf 100644 --- a/tasks/0135_364_135364354_qa_3/task.toml +++ b/tasks/0135_364_135364354_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_364_135364354_qa_5/environment/bootstrap.sh b/tasks/0135_364_135364354_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_364_135364354_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_364_135364354_qa_5/environment/pull_bucket.py b/tasks/0135_364_135364354_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_364_135364354_qa_5/environment/pull_bucket.py +++ b/tasks/0135_364_135364354_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_364_135364354_qa_5/task.toml b/tasks/0135_364_135364354_qa_5/task.toml index 1711bd7a48357810fc98ff758e54c32df79782dc..fa4164933183109f1e1007baf4d5a10bedbd9165 100644 --- a/tasks/0135_364_135364354_qa_5/task.toml +++ b/tasks/0135_364_135364354_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_380_135380627_qa_1/environment/bootstrap.sh b/tasks/0135_380_135380627_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_380_135380627_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_380_135380627_qa_1/environment/pull_bucket.py b/tasks/0135_380_135380627_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_380_135380627_qa_1/environment/pull_bucket.py +++ b/tasks/0135_380_135380627_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_380_135380627_qa_1/task.toml b/tasks/0135_380_135380627_qa_1/task.toml index 32f3c577d5b0242512fb385d05f697b3351edc07..7606b4eb252189bf871156dea91fe32056958418 100644 --- a/tasks/0135_380_135380627_qa_1/task.toml +++ b/tasks/0135_380_135380627_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_380_135380654_qa_2/environment/bootstrap.sh b/tasks/0135_380_135380654_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_380_135380654_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_380_135380654_qa_2/environment/pull_bucket.py b/tasks/0135_380_135380654_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_380_135380654_qa_2/environment/pull_bucket.py +++ b/tasks/0135_380_135380654_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_380_135380654_qa_2/task.toml b/tasks/0135_380_135380654_qa_2/task.toml index 38420bc4cb2ce4718379ecf5c676fa226255c597..57953d325dae0975951c8cdbfd88c286d483003c 100644 --- a/tasks/0135_380_135380654_qa_2/task.toml +++ b/tasks/0135_380_135380654_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_380_135380654_qa_4/environment/bootstrap.sh b/tasks/0135_380_135380654_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_380_135380654_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_380_135380654_qa_4/environment/pull_bucket.py b/tasks/0135_380_135380654_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_380_135380654_qa_4/environment/pull_bucket.py +++ b/tasks/0135_380_135380654_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_380_135380654_qa_4/task.toml b/tasks/0135_380_135380654_qa_4/task.toml index 4b4e49ac9d5a6bd333c0956c0ace5be9e64811da..d86d9ebb70cff5251284e867d6b9e05d07922a89 100644 --- a/tasks/0135_380_135380654_qa_4/task.toml +++ b/tasks/0135_380_135380654_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_427_135427128_qa_2/environment/bootstrap.sh b/tasks/0135_427_135427128_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_427_135427128_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_427_135427128_qa_2/environment/pull_bucket.py b/tasks/0135_427_135427128_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_427_135427128_qa_2/environment/pull_bucket.py +++ b/tasks/0135_427_135427128_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_427_135427128_qa_2/task.toml b/tasks/0135_427_135427128_qa_2/task.toml index 1c2026ecfdf582401465815155807c33270e1183..3d03f1ac5a82b1838150a8b6c21182b750b70b62 100644 --- a/tasks/0135_427_135427128_qa_2/task.toml +++ b/tasks/0135_427_135427128_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_485_135485471_qa_4/environment/bootstrap.sh b/tasks/0135_485_135485471_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_485_135485471_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_485_135485471_qa_4/environment/pull_bucket.py b/tasks/0135_485_135485471_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_485_135485471_qa_4/environment/pull_bucket.py +++ b/tasks/0135_485_135485471_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_485_135485471_qa_4/task.toml b/tasks/0135_485_135485471_qa_4/task.toml index 21523fc4f86e0cf09be67111aad279990ec8ad5e..52578de19ff3798e4472a3e7dc17159d027bb398 100644 --- a/tasks/0135_485_135485471_qa_4/task.toml +++ b/tasks/0135_485_135485471_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_538_135538507_qa_5/environment/bootstrap.sh b/tasks/0135_538_135538507_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_538_135538507_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_538_135538507_qa_5/environment/pull_bucket.py b/tasks/0135_538_135538507_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_538_135538507_qa_5/environment/pull_bucket.py +++ b/tasks/0135_538_135538507_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_538_135538507_qa_5/task.toml b/tasks/0135_538_135538507_qa_5/task.toml index aecaf982e67e98af5fb0f015ab2dd0e9b5c0fd14..5c15c8a83aeb6724e25f3a480b4822e0b18d3fb5 100644 --- a/tasks/0135_538_135538507_qa_5/task.toml +++ b/tasks/0135_538_135538507_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_541_135541718_qa_1/environment/bootstrap.sh b/tasks/0135_541_135541718_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_541_135541718_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_541_135541718_qa_1/environment/pull_bucket.py b/tasks/0135_541_135541718_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_541_135541718_qa_1/environment/pull_bucket.py +++ b/tasks/0135_541_135541718_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_541_135541718_qa_1/task.toml b/tasks/0135_541_135541718_qa_1/task.toml index e85dbb0190f074887e41fdba1d857643c24c5c09..c47754e49d51436c88f36fde4ae901c0730b1a8f 100644 --- a/tasks/0135_541_135541718_qa_1/task.toml +++ b/tasks/0135_541_135541718_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_616_135616199_qa_1/environment/bootstrap.sh b/tasks/0135_616_135616199_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_616_135616199_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_616_135616199_qa_1/environment/pull_bucket.py b/tasks/0135_616_135616199_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_616_135616199_qa_1/environment/pull_bucket.py +++ b/tasks/0135_616_135616199_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_616_135616199_qa_1/task.toml b/tasks/0135_616_135616199_qa_1/task.toml index 207f3cee8fab77d2d6424409f993a0554eed641b..eb293889064dc90fd4cafc1b8a4ea00fb6ea63c4 100644 --- a/tasks/0135_616_135616199_qa_1/task.toml +++ b/tasks/0135_616_135616199_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_616_135616199_qa_4/environment/bootstrap.sh b/tasks/0135_616_135616199_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_616_135616199_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_616_135616199_qa_4/environment/pull_bucket.py b/tasks/0135_616_135616199_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_616_135616199_qa_4/environment/pull_bucket.py +++ b/tasks/0135_616_135616199_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_616_135616199_qa_4/task.toml b/tasks/0135_616_135616199_qa_4/task.toml index 9cf872bf9a20f6cfa0fb93ecbfcf7ef9ec075b09..fa39e79243e1a41ee8e37803bdf36b0c20798252 100644 --- a/tasks/0135_616_135616199_qa_4/task.toml +++ b/tasks/0135_616_135616199_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_616_135616199_qa_5/environment/bootstrap.sh b/tasks/0135_616_135616199_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_616_135616199_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_616_135616199_qa_5/environment/pull_bucket.py b/tasks/0135_616_135616199_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_616_135616199_qa_5/environment/pull_bucket.py +++ b/tasks/0135_616_135616199_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_616_135616199_qa_5/task.toml b/tasks/0135_616_135616199_qa_5/task.toml index 117c1ea6c7a73f938a47ef3b1bbf0bd689a332df..85ec55183d9535e2c39d3de6cdf8a5b4ef22951e 100644 --- a/tasks/0135_616_135616199_qa_5/task.toml +++ b/tasks/0135_616_135616199_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_674_135674700_qa_2/environment/bootstrap.sh b/tasks/0135_674_135674700_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_674_135674700_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_674_135674700_qa_2/environment/pull_bucket.py b/tasks/0135_674_135674700_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_674_135674700_qa_2/environment/pull_bucket.py +++ b/tasks/0135_674_135674700_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_674_135674700_qa_2/task.toml b/tasks/0135_674_135674700_qa_2/task.toml index cacab94501cbfa63b223a990e9aa98946399f0c5..714bda4aa38c5635ae35c718dc5d4dcf64cf879b 100644 --- a/tasks/0135_674_135674700_qa_2/task.toml +++ b/tasks/0135_674_135674700_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_674_135674700_qa_5/environment/bootstrap.sh b/tasks/0135_674_135674700_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_674_135674700_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_674_135674700_qa_5/environment/pull_bucket.py b/tasks/0135_674_135674700_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_674_135674700_qa_5/environment/pull_bucket.py +++ b/tasks/0135_674_135674700_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_674_135674700_qa_5/task.toml b/tasks/0135_674_135674700_qa_5/task.toml index 49beb3e14a33bdd9f7e88e23b0011ae08aafde5f..9a5c36f481ab81e30169bd5e8adab865a626c7c4 100644 --- a/tasks/0135_674_135674700_qa_5/task.toml +++ b/tasks/0135_674_135674700_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_716_135716121_qa_3/environment/bootstrap.sh b/tasks/0135_716_135716121_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_716_135716121_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_716_135716121_qa_3/environment/pull_bucket.py b/tasks/0135_716_135716121_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_716_135716121_qa_3/environment/pull_bucket.py +++ b/tasks/0135_716_135716121_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_716_135716121_qa_3/task.toml b/tasks/0135_716_135716121_qa_3/task.toml index b818a90a5809a4ee32d3a8b46f9bac321c8395df..3e3d0a58bd8b668054d14470fa4457b1313baf78 100644 --- a/tasks/0135_716_135716121_qa_3/task.toml +++ b/tasks/0135_716_135716121_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_720_135720396_qa_1/environment/bootstrap.sh b/tasks/0135_720_135720396_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_720_135720396_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_720_135720396_qa_1/environment/pull_bucket.py b/tasks/0135_720_135720396_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_720_135720396_qa_1/environment/pull_bucket.py +++ b/tasks/0135_720_135720396_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_720_135720396_qa_1/task.toml b/tasks/0135_720_135720396_qa_1/task.toml index 5b6d672adb5687cdca3b29c701ffa7dc87078bdd..63ec807e52b7518b13b1f04c673e2a356d09f030 100644 --- a/tasks/0135_720_135720396_qa_1/task.toml +++ b/tasks/0135_720_135720396_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_720_135720396_qa_5/environment/bootstrap.sh b/tasks/0135_720_135720396_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_720_135720396_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_720_135720396_qa_5/environment/pull_bucket.py b/tasks/0135_720_135720396_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_720_135720396_qa_5/environment/pull_bucket.py +++ b/tasks/0135_720_135720396_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_720_135720396_qa_5/task.toml b/tasks/0135_720_135720396_qa_5/task.toml index 8f1db8f8bdfe9e51d2046b23776e7f1667e18a52..58ca988f0f685b58cff8725c2ff0735bc84e448f 100644 --- a/tasks/0135_720_135720396_qa_5/task.toml +++ b/tasks/0135_720_135720396_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_734_135734200_qa_1/environment/bootstrap.sh b/tasks/0135_734_135734200_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_734_135734200_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_734_135734200_qa_1/environment/pull_bucket.py b/tasks/0135_734_135734200_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_734_135734200_qa_1/environment/pull_bucket.py +++ b/tasks/0135_734_135734200_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_734_135734200_qa_1/task.toml b/tasks/0135_734_135734200_qa_1/task.toml index c64d59ce3a8ad7a848aaa322525185aa06969958..4a724bc00c8fa4bcf2a48e322b757bacfe2f8b16 100644 --- a/tasks/0135_734_135734200_qa_1/task.toml +++ b/tasks/0135_734_135734200_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_735_135735954_qa_4/environment/bootstrap.sh b/tasks/0135_735_135735954_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_735_135735954_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_735_135735954_qa_4/environment/pull_bucket.py b/tasks/0135_735_135735954_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_735_135735954_qa_4/environment/pull_bucket.py +++ b/tasks/0135_735_135735954_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_735_135735954_qa_4/task.toml b/tasks/0135_735_135735954_qa_4/task.toml index e34ea3975d7c5dcafde6e6a9c62704e2e72156da..2e7b1adc56755cdb19686022b5dec8ac3c3bd6d6 100644 --- a/tasks/0135_735_135735954_qa_4/task.toml +++ b/tasks/0135_735_135735954_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_740_135740732_qa_2/environment/bootstrap.sh b/tasks/0135_740_135740732_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_740_135740732_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_740_135740732_qa_2/environment/pull_bucket.py b/tasks/0135_740_135740732_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_740_135740732_qa_2/environment/pull_bucket.py +++ b/tasks/0135_740_135740732_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_740_135740732_qa_2/task.toml b/tasks/0135_740_135740732_qa_2/task.toml index 745710703c0a595b60ee7f32664ec9478ebbe44b..dd19cf5b2aaf70506f2a01b4749bdfa486016705 100644 --- a/tasks/0135_740_135740732_qa_2/task.toml +++ b/tasks/0135_740_135740732_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_740_135740732_qa_3/environment/bootstrap.sh b/tasks/0135_740_135740732_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_740_135740732_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_740_135740732_qa_3/environment/pull_bucket.py b/tasks/0135_740_135740732_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_740_135740732_qa_3/environment/pull_bucket.py +++ b/tasks/0135_740_135740732_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_740_135740732_qa_3/task.toml b/tasks/0135_740_135740732_qa_3/task.toml index 432695479c63e529c170e827be89326fe66a7f64..9fc89821c82de44c552d3e691d07947777b7cadc 100644 --- a/tasks/0135_740_135740732_qa_3/task.toml +++ b/tasks/0135_740_135740732_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_920_135920645_qa_4/environment/bootstrap.sh b/tasks/0135_920_135920645_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_920_135920645_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_920_135920645_qa_4/environment/pull_bucket.py b/tasks/0135_920_135920645_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_920_135920645_qa_4/environment/pull_bucket.py +++ b/tasks/0135_920_135920645_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_920_135920645_qa_4/task.toml b/tasks/0135_920_135920645_qa_4/task.toml index 66b69931d479037b2ad685061dd73dbd2cb3b2c0..2d43caeb35737ee4c1b253625e899bda840ff4bf 100644 --- a/tasks/0135_920_135920645_qa_4/task.toml +++ b/tasks/0135_920_135920645_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_920_135920645_qa_5/environment/bootstrap.sh b/tasks/0135_920_135920645_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_920_135920645_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_920_135920645_qa_5/environment/pull_bucket.py b/tasks/0135_920_135920645_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_920_135920645_qa_5/environment/pull_bucket.py +++ b/tasks/0135_920_135920645_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_920_135920645_qa_5/task.toml b/tasks/0135_920_135920645_qa_5/task.toml index 88d36c6a3e74e1c4e5f52b71306d982fdd0b2a9a..0bdef7e2c179bee2c1712a10ed8aba0b2953c16c 100644 --- a/tasks/0135_920_135920645_qa_5/task.toml +++ b/tasks/0135_920_135920645_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_926_135926873_qa_2/environment/bootstrap.sh b/tasks/0135_926_135926873_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_926_135926873_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_926_135926873_qa_2/environment/pull_bucket.py b/tasks/0135_926_135926873_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_926_135926873_qa_2/environment/pull_bucket.py +++ b/tasks/0135_926_135926873_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_926_135926873_qa_2/task.toml b/tasks/0135_926_135926873_qa_2/task.toml index ad771bd6684d01a9c2e79aa871136c21a54e0c43..3767f87520f83e21d757af40939128ece3c34f59 100644 --- a/tasks/0135_926_135926873_qa_2/task.toml +++ b/tasks/0135_926_135926873_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_926_135926873_qa_3/environment/bootstrap.sh b/tasks/0135_926_135926873_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_926_135926873_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_926_135926873_qa_3/environment/pull_bucket.py b/tasks/0135_926_135926873_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_926_135926873_qa_3/environment/pull_bucket.py +++ b/tasks/0135_926_135926873_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_926_135926873_qa_3/task.toml b/tasks/0135_926_135926873_qa_3/task.toml index 085565148b3b74afdc0dd0175f871d0b6d1f6267..2d5ac3d34888fcb9208f8b611692e0f6589c8c59 100644 --- a/tasks/0135_926_135926873_qa_3/task.toml +++ b/tasks/0135_926_135926873_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_926_135926873_qa_4/environment/bootstrap.sh b/tasks/0135_926_135926873_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_926_135926873_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_926_135926873_qa_4/environment/pull_bucket.py b/tasks/0135_926_135926873_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_926_135926873_qa_4/environment/pull_bucket.py +++ b/tasks/0135_926_135926873_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_926_135926873_qa_4/task.toml b/tasks/0135_926_135926873_qa_4/task.toml index e62087160c76da351ac61b53a692b40590cfc75c..9e17d9e37a9ab42be17d7cae856ef6dfe8339830 100644 --- a/tasks/0135_926_135926873_qa_4/task.toml +++ b/tasks/0135_926_135926873_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_931_135931499_qa_2/environment/bootstrap.sh b/tasks/0135_931_135931499_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_931_135931499_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_931_135931499_qa_2/environment/pull_bucket.py b/tasks/0135_931_135931499_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_931_135931499_qa_2/environment/pull_bucket.py +++ b/tasks/0135_931_135931499_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_931_135931499_qa_2/task.toml b/tasks/0135_931_135931499_qa_2/task.toml index 497995510e519a83933b655ab21b28bbc3535d4e..5c8c7d92f2fc98bd2df1596a7b303e8be3d419fb 100644 --- a/tasks/0135_931_135931499_qa_2/task.toml +++ b/tasks/0135_931_135931499_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_931_135931499_qa_4/environment/bootstrap.sh b/tasks/0135_931_135931499_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_931_135931499_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_931_135931499_qa_4/environment/pull_bucket.py b/tasks/0135_931_135931499_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_931_135931499_qa_4/environment/pull_bucket.py +++ b/tasks/0135_931_135931499_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_931_135931499_qa_4/task.toml b/tasks/0135_931_135931499_qa_4/task.toml index 9ed2b8364763694373ba9f108909669c2f7325e1..978db12c7d6f07e39610088f0727b6141bf0e8ac 100644 --- a/tasks/0135_931_135931499_qa_4/task.toml +++ b/tasks/0135_931_135931499_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_968_135968027_qa_1/environment/bootstrap.sh b/tasks/0135_968_135968027_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_968_135968027_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_968_135968027_qa_1/environment/pull_bucket.py b/tasks/0135_968_135968027_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_968_135968027_qa_1/environment/pull_bucket.py +++ b/tasks/0135_968_135968027_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_968_135968027_qa_1/task.toml b/tasks/0135_968_135968027_qa_1/task.toml index f8e062cbe12c89dc5e9b6ce90a0bb3d474dd5f66..82d162e3648c062e3b7dd0f84e617dcfa3a9b67b 100644 --- a/tasks/0135_968_135968027_qa_1/task.toml +++ b/tasks/0135_968_135968027_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0135_968_135968027_qa_3/environment/bootstrap.sh b/tasks/0135_968_135968027_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0135_968_135968027_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0135_968_135968027_qa_3/environment/pull_bucket.py b/tasks/0135_968_135968027_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0135_968_135968027_qa_3/environment/pull_bucket.py +++ b/tasks/0135_968_135968027_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0135_968_135968027_qa_3/task.toml b/tasks/0135_968_135968027_qa_3/task.toml index 5304a5754ff8d0712102c267becd9f4c43d5de0e..7329cf0f5c0fb71f30903502b5eae4e71a4cdd4c 100644 --- a/tasks/0135_968_135968027_qa_3/task.toml +++ b/tasks/0135_968_135968027_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_044_136044627_qa_3/environment/bootstrap.sh b/tasks/0136_044_136044627_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_044_136044627_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_044_136044627_qa_3/environment/pull_bucket.py b/tasks/0136_044_136044627_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_044_136044627_qa_3/environment/pull_bucket.py +++ b/tasks/0136_044_136044627_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_044_136044627_qa_3/task.toml b/tasks/0136_044_136044627_qa_3/task.toml index c6505bf2999fcee0bca307144ae1cb3c94c1a0c3..590f19f0f188c23c31b69b16430efbb5790bb7ce 100644 --- a/tasks/0136_044_136044627_qa_3/task.toml +++ b/tasks/0136_044_136044627_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_044_136044627_qa_5/environment/bootstrap.sh b/tasks/0136_044_136044627_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_044_136044627_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_044_136044627_qa_5/environment/pull_bucket.py b/tasks/0136_044_136044627_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_044_136044627_qa_5/environment/pull_bucket.py +++ b/tasks/0136_044_136044627_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_044_136044627_qa_5/task.toml b/tasks/0136_044_136044627_qa_5/task.toml index edbac77bb29b2f6c4233927507351a59a448adc0..34d1830aa69b5f1f3bf110dc92872368312f5174 100644 --- a/tasks/0136_044_136044627_qa_5/task.toml +++ b/tasks/0136_044_136044627_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_053_136053251_qa_2/environment/bootstrap.sh b/tasks/0136_053_136053251_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_053_136053251_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_053_136053251_qa_2/environment/pull_bucket.py b/tasks/0136_053_136053251_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_053_136053251_qa_2/environment/pull_bucket.py +++ b/tasks/0136_053_136053251_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_053_136053251_qa_2/task.toml b/tasks/0136_053_136053251_qa_2/task.toml index 9eb2e7377f430e9da11b542707b8bb5a981f426c..9210b960b65ceb3ed7f0dd4cc8aadaa918440eea 100644 --- a/tasks/0136_053_136053251_qa_2/task.toml +++ b/tasks/0136_053_136053251_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_053_136053251_qa_4/environment/bootstrap.sh b/tasks/0136_053_136053251_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_053_136053251_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_053_136053251_qa_4/environment/pull_bucket.py b/tasks/0136_053_136053251_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_053_136053251_qa_4/environment/pull_bucket.py +++ b/tasks/0136_053_136053251_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_053_136053251_qa_4/task.toml b/tasks/0136_053_136053251_qa_4/task.toml index c6c35f5189509a7da9e7ff877be9294aa1912178..f3346a0507cdecf13d8e72533bbfb0bf83f8ce87 100644 --- a/tasks/0136_053_136053251_qa_4/task.toml +++ b/tasks/0136_053_136053251_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_157_136157860_qa_5/environment/bootstrap.sh b/tasks/0136_157_136157860_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_157_136157860_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_157_136157860_qa_5/environment/pull_bucket.py b/tasks/0136_157_136157860_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_157_136157860_qa_5/environment/pull_bucket.py +++ b/tasks/0136_157_136157860_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_157_136157860_qa_5/task.toml b/tasks/0136_157_136157860_qa_5/task.toml index a69287095d832d5fdb4be72e53db35869510fa37..6f967ba125da16791dfa88908f651107caf0f847 100644 --- a/tasks/0136_157_136157860_qa_5/task.toml +++ b/tasks/0136_157_136157860_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_175_136175034_qa_5/environment/bootstrap.sh b/tasks/0136_175_136175034_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_175_136175034_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_175_136175034_qa_5/environment/pull_bucket.py b/tasks/0136_175_136175034_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_175_136175034_qa_5/environment/pull_bucket.py +++ b/tasks/0136_175_136175034_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_175_136175034_qa_5/task.toml b/tasks/0136_175_136175034_qa_5/task.toml index 70bb21437cc02dafe9689498ef7f5794d0354526..355fc6f5ecc991dab4a15b652f75bc08751a8abc 100644 --- a/tasks/0136_175_136175034_qa_5/task.toml +++ b/tasks/0136_175_136175034_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_198_136198797_qa_1/environment/bootstrap.sh b/tasks/0136_198_136198797_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_198_136198797_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_198_136198797_qa_1/environment/pull_bucket.py b/tasks/0136_198_136198797_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_198_136198797_qa_1/environment/pull_bucket.py +++ b/tasks/0136_198_136198797_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_198_136198797_qa_1/task.toml b/tasks/0136_198_136198797_qa_1/task.toml index afc8670fb8cfd582f2f6cf1cd0b6d793275d372c..c77140781dbda0a8a8ff543806b249e4f7d118e7 100644 --- a/tasks/0136_198_136198797_qa_1/task.toml +++ b/tasks/0136_198_136198797_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_198_136198797_qa_2/environment/bootstrap.sh b/tasks/0136_198_136198797_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_198_136198797_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_198_136198797_qa_2/environment/pull_bucket.py b/tasks/0136_198_136198797_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_198_136198797_qa_2/environment/pull_bucket.py +++ b/tasks/0136_198_136198797_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_198_136198797_qa_2/task.toml b/tasks/0136_198_136198797_qa_2/task.toml index 0140049bd575f5402b9c92bbd33b4fc1425a99da..29fcc318b766e7dc7d4781a98fba4cac831d6718 100644 --- a/tasks/0136_198_136198797_qa_2/task.toml +++ b/tasks/0136_198_136198797_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_198_136198797_qa_3/environment/bootstrap.sh b/tasks/0136_198_136198797_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_198_136198797_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_198_136198797_qa_3/environment/pull_bucket.py b/tasks/0136_198_136198797_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_198_136198797_qa_3/environment/pull_bucket.py +++ b/tasks/0136_198_136198797_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_198_136198797_qa_3/task.toml b/tasks/0136_198_136198797_qa_3/task.toml index 121def47fd8a7ae5c4507d34a8a1e409999bc64f..0fc3b25262967cd7383979cdd6b62b68d4060ebd 100644 --- a/tasks/0136_198_136198797_qa_3/task.toml +++ b/tasks/0136_198_136198797_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_199_136199196_qa_3/environment/bootstrap.sh b/tasks/0136_199_136199196_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_199_136199196_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_199_136199196_qa_3/environment/pull_bucket.py b/tasks/0136_199_136199196_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_199_136199196_qa_3/environment/pull_bucket.py +++ b/tasks/0136_199_136199196_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_199_136199196_qa_3/task.toml b/tasks/0136_199_136199196_qa_3/task.toml index 8420db27d7a0be38fb236f58a351b4e19b0e82e4..d07a3bd01e85b528e9c38556817c9e8a377979bb 100644 --- a/tasks/0136_199_136199196_qa_3/task.toml +++ b/tasks/0136_199_136199196_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_242_136242885_qa_2/environment/bootstrap.sh b/tasks/0136_242_136242885_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_242_136242885_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_242_136242885_qa_2/environment/pull_bucket.py b/tasks/0136_242_136242885_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_242_136242885_qa_2/environment/pull_bucket.py +++ b/tasks/0136_242_136242885_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_242_136242885_qa_2/task.toml b/tasks/0136_242_136242885_qa_2/task.toml index 902f88b4f508d5c15b1014e640fbe31af2654d8d..d1edeefd3e8336229b9ecd04d39f473c0ecf1470 100644 --- a/tasks/0136_242_136242885_qa_2/task.toml +++ b/tasks/0136_242_136242885_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_395_136395303_qa_1/environment/bootstrap.sh b/tasks/0136_395_136395303_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_395_136395303_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_395_136395303_qa_1/environment/pull_bucket.py b/tasks/0136_395_136395303_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_395_136395303_qa_1/environment/pull_bucket.py +++ b/tasks/0136_395_136395303_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_395_136395303_qa_1/task.toml b/tasks/0136_395_136395303_qa_1/task.toml index f3c1452599f53d83efa7b29624a5351b814eab90..e7f77e381a09bf89bc0b0a3b9dc4a9987131079d 100644 --- a/tasks/0136_395_136395303_qa_1/task.toml +++ b/tasks/0136_395_136395303_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_396_136396252_qa_2/environment/bootstrap.sh b/tasks/0136_396_136396252_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_396_136396252_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_396_136396252_qa_2/environment/pull_bucket.py b/tasks/0136_396_136396252_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_396_136396252_qa_2/environment/pull_bucket.py +++ b/tasks/0136_396_136396252_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_396_136396252_qa_2/task.toml b/tasks/0136_396_136396252_qa_2/task.toml index 2ee03e9c44b6e9d21b1e1ac2f2aac9ebb36e3012..95dffc5d1a5892f6a40ee1e6362bc2462bff3ba4 100644 --- a/tasks/0136_396_136396252_qa_2/task.toml +++ b/tasks/0136_396_136396252_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_483_136483047_qa_4/environment/bootstrap.sh b/tasks/0136_483_136483047_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_483_136483047_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_483_136483047_qa_4/environment/pull_bucket.py b/tasks/0136_483_136483047_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_483_136483047_qa_4/environment/pull_bucket.py +++ b/tasks/0136_483_136483047_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_483_136483047_qa_4/task.toml b/tasks/0136_483_136483047_qa_4/task.toml index db473e983a04054602f10b4bde080dd2d06c6cae..cf647795f38776d4c92c4a8cfbf98d65b80bebb7 100644 --- a/tasks/0136_483_136483047_qa_4/task.toml +++ b/tasks/0136_483_136483047_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_604_136604936_qa_4/environment/bootstrap.sh b/tasks/0136_604_136604936_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_604_136604936_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_604_136604936_qa_4/environment/pull_bucket.py b/tasks/0136_604_136604936_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_604_136604936_qa_4/environment/pull_bucket.py +++ b/tasks/0136_604_136604936_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_604_136604936_qa_4/task.toml b/tasks/0136_604_136604936_qa_4/task.toml index 6df3039eaa01ac04dcd84a05532002cc300068bb..1600dc1ecce1d92bfea2d5b8260ca2420edfd340 100644 --- a/tasks/0136_604_136604936_qa_4/task.toml +++ b/tasks/0136_604_136604936_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_646_136646417_qa_2/environment/bootstrap.sh b/tasks/0136_646_136646417_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_646_136646417_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_646_136646417_qa_2/environment/pull_bucket.py b/tasks/0136_646_136646417_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_646_136646417_qa_2/environment/pull_bucket.py +++ b/tasks/0136_646_136646417_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_646_136646417_qa_2/task.toml b/tasks/0136_646_136646417_qa_2/task.toml index 38794486eae6886da53316233ccbb878860b89c3..9ca0dd601bfeeb11e17168adca4578228c6d6a0c 100644 --- a/tasks/0136_646_136646417_qa_2/task.toml +++ b/tasks/0136_646_136646417_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_646_136646417_qa_4/environment/bootstrap.sh b/tasks/0136_646_136646417_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_646_136646417_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_646_136646417_qa_4/environment/pull_bucket.py b/tasks/0136_646_136646417_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_646_136646417_qa_4/environment/pull_bucket.py +++ b/tasks/0136_646_136646417_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_646_136646417_qa_4/task.toml b/tasks/0136_646_136646417_qa_4/task.toml index fbbcc7bcd24b7e651b92fb13499c54b062283834..e82a4d2337bc6d1a8ab7610e556aa4105cd50676 100644 --- a/tasks/0136_646_136646417_qa_4/task.toml +++ b/tasks/0136_646_136646417_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_656_136656176_qa_2/environment/bootstrap.sh b/tasks/0136_656_136656176_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_656_136656176_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_656_136656176_qa_2/environment/pull_bucket.py b/tasks/0136_656_136656176_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_656_136656176_qa_2/environment/pull_bucket.py +++ b/tasks/0136_656_136656176_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_656_136656176_qa_2/task.toml b/tasks/0136_656_136656176_qa_2/task.toml index 452babc1b9eb08b46b96cdb78326d04b666fe1c8..b9ab6aeac0a1d9425ea80b60af0f641e04dcee11 100644 --- a/tasks/0136_656_136656176_qa_2/task.toml +++ b/tasks/0136_656_136656176_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_677_136677870_qa_1/environment/bootstrap.sh b/tasks/0136_677_136677870_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_677_136677870_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_677_136677870_qa_1/environment/pull_bucket.py b/tasks/0136_677_136677870_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_677_136677870_qa_1/environment/pull_bucket.py +++ b/tasks/0136_677_136677870_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_677_136677870_qa_1/task.toml b/tasks/0136_677_136677870_qa_1/task.toml index 049ac9b4a815c5dd325d7813bfaf2725b2f342eb..f9de3328f1584d31a9d2b58d7fb06dd6f8bff0a9 100644 --- a/tasks/0136_677_136677870_qa_1/task.toml +++ b/tasks/0136_677_136677870_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_683_136683073_qa_2/environment/bootstrap.sh b/tasks/0136_683_136683073_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_683_136683073_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_683_136683073_qa_2/environment/pull_bucket.py b/tasks/0136_683_136683073_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_683_136683073_qa_2/environment/pull_bucket.py +++ b/tasks/0136_683_136683073_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_683_136683073_qa_2/task.toml b/tasks/0136_683_136683073_qa_2/task.toml index 7bb1a06295c0ea0e4b531c4c4fc5057a78362762..2c1c0a5664735c03d788ec12c5d671a2f7e478ed 100644 --- a/tasks/0136_683_136683073_qa_2/task.toml +++ b/tasks/0136_683_136683073_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_683_136683073_qa_3/environment/bootstrap.sh b/tasks/0136_683_136683073_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_683_136683073_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_683_136683073_qa_3/environment/pull_bucket.py b/tasks/0136_683_136683073_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_683_136683073_qa_3/environment/pull_bucket.py +++ b/tasks/0136_683_136683073_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_683_136683073_qa_3/task.toml b/tasks/0136_683_136683073_qa_3/task.toml index db8aa90d62dba520bbcd421099d2c8a612596129..e79d1b02d9e1b1cf4d9d70907fbdbeff536869f5 100644 --- a/tasks/0136_683_136683073_qa_3/task.toml +++ b/tasks/0136_683_136683073_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_770_136770905_qa_3/environment/bootstrap.sh b/tasks/0136_770_136770905_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_770_136770905_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_770_136770905_qa_3/environment/pull_bucket.py b/tasks/0136_770_136770905_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_770_136770905_qa_3/environment/pull_bucket.py +++ b/tasks/0136_770_136770905_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_770_136770905_qa_3/task.toml b/tasks/0136_770_136770905_qa_3/task.toml index 23c9f8e27ae7198e25b7541fe059696432c69b2d..1d990f7c99c8c185e0d83609a9e28d7103c0b246 100644 --- a/tasks/0136_770_136770905_qa_3/task.toml +++ b/tasks/0136_770_136770905_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_825_136825945_qa_1/environment/bootstrap.sh b/tasks/0136_825_136825945_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_825_136825945_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_825_136825945_qa_1/environment/pull_bucket.py b/tasks/0136_825_136825945_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_825_136825945_qa_1/environment/pull_bucket.py +++ b/tasks/0136_825_136825945_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_825_136825945_qa_1/task.toml b/tasks/0136_825_136825945_qa_1/task.toml index b3c0221480e760d7f9cafcf2ff8d9a48eed9017a..7c15b47fafa24cee207c07d6c74a285bac2c6bbf 100644 --- a/tasks/0136_825_136825945_qa_1/task.toml +++ b/tasks/0136_825_136825945_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_825_136825945_qa_5/environment/bootstrap.sh b/tasks/0136_825_136825945_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_825_136825945_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_825_136825945_qa_5/environment/pull_bucket.py b/tasks/0136_825_136825945_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_825_136825945_qa_5/environment/pull_bucket.py +++ b/tasks/0136_825_136825945_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_825_136825945_qa_5/task.toml b/tasks/0136_825_136825945_qa_5/task.toml index 7cb8df78d32eb0c91181eee77b90ce805fb01e1e..b9355e4357694c352a216ddcd52e2b3deac8876d 100644 --- a/tasks/0136_825_136825945_qa_5/task.toml +++ b/tasks/0136_825_136825945_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_845_136845893_qa_1/environment/bootstrap.sh b/tasks/0136_845_136845893_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_845_136845893_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_845_136845893_qa_1/environment/pull_bucket.py b/tasks/0136_845_136845893_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_845_136845893_qa_1/environment/pull_bucket.py +++ b/tasks/0136_845_136845893_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_845_136845893_qa_1/task.toml b/tasks/0136_845_136845893_qa_1/task.toml index 3e95039fe805c199ec4ed54744d7b847fc1ff07a..5158543cbb7643ac52f931a12a5b83e7fba6909e 100644 --- a/tasks/0136_845_136845893_qa_1/task.toml +++ b/tasks/0136_845_136845893_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_845_136845893_qa_4/environment/bootstrap.sh b/tasks/0136_845_136845893_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_845_136845893_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_845_136845893_qa_4/environment/pull_bucket.py b/tasks/0136_845_136845893_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_845_136845893_qa_4/environment/pull_bucket.py +++ b/tasks/0136_845_136845893_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_845_136845893_qa_4/task.toml b/tasks/0136_845_136845893_qa_4/task.toml index c2cc66a0ab6b23b617facb79fedab0d14f85d18d..b96fb3e90e7dec8e3950065d609e88e0276f05aa 100644 --- a/tasks/0136_845_136845893_qa_4/task.toml +++ b/tasks/0136_845_136845893_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_874_136874999_qa_1/environment/bootstrap.sh b/tasks/0136_874_136874999_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_874_136874999_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_874_136874999_qa_1/environment/pull_bucket.py b/tasks/0136_874_136874999_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_874_136874999_qa_1/environment/pull_bucket.py +++ b/tasks/0136_874_136874999_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_874_136874999_qa_1/task.toml b/tasks/0136_874_136874999_qa_1/task.toml index 1ddc374ef3a547e5c55b1aa08aea9a0ddb265a3a..368220e52d799b5f43a296c72588b77f2c036f67 100644 --- a/tasks/0136_874_136874999_qa_1/task.toml +++ b/tasks/0136_874_136874999_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_874_136874999_qa_3/environment/bootstrap.sh b/tasks/0136_874_136874999_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_874_136874999_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_874_136874999_qa_3/environment/pull_bucket.py b/tasks/0136_874_136874999_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_874_136874999_qa_3/environment/pull_bucket.py +++ b/tasks/0136_874_136874999_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_874_136874999_qa_3/task.toml b/tasks/0136_874_136874999_qa_3/task.toml index e9e70f68e51389ce98cceb53c3b9159b2479b84d..546deefece1aaace43cd934e0fb4ca73f1cf1805 100644 --- a/tasks/0136_874_136874999_qa_3/task.toml +++ b/tasks/0136_874_136874999_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0136_961_136961156_qa_5/environment/bootstrap.sh b/tasks/0136_961_136961156_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0136_961_136961156_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0136_961_136961156_qa_5/environment/pull_bucket.py b/tasks/0136_961_136961156_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0136_961_136961156_qa_5/environment/pull_bucket.py +++ b/tasks/0136_961_136961156_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0136_961_136961156_qa_5/task.toml b/tasks/0136_961_136961156_qa_5/task.toml index 69efb1c8995908262631396e77728a45d2225c94..07e8b53c30f0f867684c873bbef359e15b0f66d0 100644 --- a/tasks/0136_961_136961156_qa_5/task.toml +++ b/tasks/0136_961_136961156_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_028_137028436_qa_3/environment/bootstrap.sh b/tasks/0137_028_137028436_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_028_137028436_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_028_137028436_qa_3/environment/pull_bucket.py b/tasks/0137_028_137028436_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_028_137028436_qa_3/environment/pull_bucket.py +++ b/tasks/0137_028_137028436_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_028_137028436_qa_3/task.toml b/tasks/0137_028_137028436_qa_3/task.toml index 2022bd47e32e23d66ad2c0bd1c97d9913b2d9bff..f978475240b8410f96ccefbf9c5cdff4e46ad094 100644 --- a/tasks/0137_028_137028436_qa_3/task.toml +++ b/tasks/0137_028_137028436_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_061_137061428_qa_2/environment/bootstrap.sh b/tasks/0137_061_137061428_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_061_137061428_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_061_137061428_qa_2/environment/pull_bucket.py b/tasks/0137_061_137061428_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_061_137061428_qa_2/environment/pull_bucket.py +++ b/tasks/0137_061_137061428_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_061_137061428_qa_2/task.toml b/tasks/0137_061_137061428_qa_2/task.toml index 6aabafdd4a2aec649d3ed71394a37b29c7ebea46..15354f2691c1459ddc48126e972748bdc13a1936 100644 --- a/tasks/0137_061_137061428_qa_2/task.toml +++ b/tasks/0137_061_137061428_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_091_137091910_qa_3/environment/bootstrap.sh b/tasks/0137_091_137091910_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_091_137091910_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_091_137091910_qa_3/environment/pull_bucket.py b/tasks/0137_091_137091910_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_091_137091910_qa_3/environment/pull_bucket.py +++ b/tasks/0137_091_137091910_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_091_137091910_qa_3/task.toml b/tasks/0137_091_137091910_qa_3/task.toml index 62cecdba6f0448c77f57234930828c980462679d..898a0eff90de0b238686671cfb7dccf39212208d 100644 --- a/tasks/0137_091_137091910_qa_3/task.toml +++ b/tasks/0137_091_137091910_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_091_137091910_qa_4/environment/bootstrap.sh b/tasks/0137_091_137091910_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_091_137091910_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_091_137091910_qa_4/environment/pull_bucket.py b/tasks/0137_091_137091910_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_091_137091910_qa_4/environment/pull_bucket.py +++ b/tasks/0137_091_137091910_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_091_137091910_qa_4/task.toml b/tasks/0137_091_137091910_qa_4/task.toml index 5db6ea47b76cc9bf418d4b656e2cfb4482f55755..a0c91dec222ee014711c1659599757aae24aeecb 100644 --- a/tasks/0137_091_137091910_qa_4/task.toml +++ b/tasks/0137_091_137091910_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_213_137213710_qa_1/environment/bootstrap.sh b/tasks/0137_213_137213710_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_213_137213710_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_213_137213710_qa_1/environment/pull_bucket.py b/tasks/0137_213_137213710_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_213_137213710_qa_1/environment/pull_bucket.py +++ b/tasks/0137_213_137213710_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_213_137213710_qa_1/task.toml b/tasks/0137_213_137213710_qa_1/task.toml index 1f71cc763adc78a258746410db3711a469f1ae12..d39d8eaa14345abfe2f20e127bb2944b130c6046 100644 --- a/tasks/0137_213_137213710_qa_1/task.toml +++ b/tasks/0137_213_137213710_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_314_137314470_qa_3/environment/bootstrap.sh b/tasks/0137_314_137314470_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_314_137314470_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_314_137314470_qa_3/environment/pull_bucket.py b/tasks/0137_314_137314470_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_314_137314470_qa_3/environment/pull_bucket.py +++ b/tasks/0137_314_137314470_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_314_137314470_qa_3/task.toml b/tasks/0137_314_137314470_qa_3/task.toml index a2c9382e6342db752ffbfdf0ec8bfb4c1c786ffc..f9520babad1094068cbf03eb01a25a82c538a536 100644 --- a/tasks/0137_314_137314470_qa_3/task.toml +++ b/tasks/0137_314_137314470_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_338_137338171_qa_1/environment/bootstrap.sh b/tasks/0137_338_137338171_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_338_137338171_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_338_137338171_qa_1/environment/pull_bucket.py b/tasks/0137_338_137338171_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_338_137338171_qa_1/environment/pull_bucket.py +++ b/tasks/0137_338_137338171_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_338_137338171_qa_1/task.toml b/tasks/0137_338_137338171_qa_1/task.toml index 2dc4c61d73dfab7c8691ba45f4fa576595fc6b0f..9a88a06fc9402ddefd57ac4e853883315eb75c34 100644 --- a/tasks/0137_338_137338171_qa_1/task.toml +++ b/tasks/0137_338_137338171_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_398_137398822_qa_1/environment/bootstrap.sh b/tasks/0137_398_137398822_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_398_137398822_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_398_137398822_qa_1/environment/pull_bucket.py b/tasks/0137_398_137398822_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_398_137398822_qa_1/environment/pull_bucket.py +++ b/tasks/0137_398_137398822_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_398_137398822_qa_1/task.toml b/tasks/0137_398_137398822_qa_1/task.toml index 13c5eab8c4e825b463b71246f1028a7b5743f742..11d113846e3cf8204918b46ba22c318d02596e16 100644 --- a/tasks/0137_398_137398822_qa_1/task.toml +++ b/tasks/0137_398_137398822_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_398_137398822_qa_3/environment/bootstrap.sh b/tasks/0137_398_137398822_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_398_137398822_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_398_137398822_qa_3/environment/pull_bucket.py b/tasks/0137_398_137398822_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_398_137398822_qa_3/environment/pull_bucket.py +++ b/tasks/0137_398_137398822_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_398_137398822_qa_3/task.toml b/tasks/0137_398_137398822_qa_3/task.toml index f628eb2d3a31ce13902c9a3c9056e10083048c90..b8903eb63173631f5c921a253fccf1c95ea54eb3 100644 --- a/tasks/0137_398_137398822_qa_3/task.toml +++ b/tasks/0137_398_137398822_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_398_137398822_qa_4/environment/bootstrap.sh b/tasks/0137_398_137398822_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_398_137398822_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_398_137398822_qa_4/environment/pull_bucket.py b/tasks/0137_398_137398822_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_398_137398822_qa_4/environment/pull_bucket.py +++ b/tasks/0137_398_137398822_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_398_137398822_qa_4/task.toml b/tasks/0137_398_137398822_qa_4/task.toml index aa94c002c29db74520a3b6d9f8c346f134a7ba59..5703e3a10d669d5349c40b8a0e85f522215db77e 100644 --- a/tasks/0137_398_137398822_qa_4/task.toml +++ b/tasks/0137_398_137398822_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_519_137519596_qa_5/environment/bootstrap.sh b/tasks/0137_519_137519596_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_519_137519596_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_519_137519596_qa_5/environment/pull_bucket.py b/tasks/0137_519_137519596_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_519_137519596_qa_5/environment/pull_bucket.py +++ b/tasks/0137_519_137519596_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_519_137519596_qa_5/task.toml b/tasks/0137_519_137519596_qa_5/task.toml index 0346aa64444ebff62e278a52120b978e88e58c3c..92c984f2e5df3413bc3d368c9063e7222adbfca2 100644 --- a/tasks/0137_519_137519596_qa_5/task.toml +++ b/tasks/0137_519_137519596_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_571_137571277_qa_3/environment/bootstrap.sh b/tasks/0137_571_137571277_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_571_137571277_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_571_137571277_qa_3/environment/pull_bucket.py b/tasks/0137_571_137571277_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_571_137571277_qa_3/environment/pull_bucket.py +++ b/tasks/0137_571_137571277_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_571_137571277_qa_3/task.toml b/tasks/0137_571_137571277_qa_3/task.toml index b6da7c1a3fd6fe745275e34d5a55181c4f9427fd..d80f3f5f7ff37128f90acbe81b485057b982e034 100644 --- a/tasks/0137_571_137571277_qa_3/task.toml +++ b/tasks/0137_571_137571277_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_586_137586595_qa_2/environment/bootstrap.sh b/tasks/0137_586_137586595_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_586_137586595_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_586_137586595_qa_2/environment/pull_bucket.py b/tasks/0137_586_137586595_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_586_137586595_qa_2/environment/pull_bucket.py +++ b/tasks/0137_586_137586595_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_586_137586595_qa_2/task.toml b/tasks/0137_586_137586595_qa_2/task.toml index 7610434d72846e3d0c00ba08a335d611ec20bf33..8061015c6767fd2748d1f50ff93e604470b23912 100644 --- a/tasks/0137_586_137586595_qa_2/task.toml +++ b/tasks/0137_586_137586595_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_619_137619562_qa_3/environment/bootstrap.sh b/tasks/0137_619_137619562_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_619_137619562_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_619_137619562_qa_3/environment/pull_bucket.py b/tasks/0137_619_137619562_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_619_137619562_qa_3/environment/pull_bucket.py +++ b/tasks/0137_619_137619562_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_619_137619562_qa_3/task.toml b/tasks/0137_619_137619562_qa_3/task.toml index badd96e2a2cea8eff8abb55586c80714e669e5d3..e088208d43852df83873019f22a7174feb959e89 100644 --- a/tasks/0137_619_137619562_qa_3/task.toml +++ b/tasks/0137_619_137619562_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_660_137660235_qa_2/environment/bootstrap.sh b/tasks/0137_660_137660235_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_660_137660235_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_660_137660235_qa_2/environment/pull_bucket.py b/tasks/0137_660_137660235_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_660_137660235_qa_2/environment/pull_bucket.py +++ b/tasks/0137_660_137660235_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_660_137660235_qa_2/task.toml b/tasks/0137_660_137660235_qa_2/task.toml index a5a1fee1580b4a715c4d6724821eff93676d9d56..22b3668e0277f80138ae58d840825061169e84fa 100644 --- a/tasks/0137_660_137660235_qa_2/task.toml +++ b/tasks/0137_660_137660235_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_745_137745793_qa_4/environment/bootstrap.sh b/tasks/0137_745_137745793_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_745_137745793_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_745_137745793_qa_4/environment/pull_bucket.py b/tasks/0137_745_137745793_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_745_137745793_qa_4/environment/pull_bucket.py +++ b/tasks/0137_745_137745793_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_745_137745793_qa_4/task.toml b/tasks/0137_745_137745793_qa_4/task.toml index f316373a380e471088b3ecef3d6fae7c5afa6f54..5abb2d5c605e0b7d20e4d0d2e3c0471358306e18 100644 --- a/tasks/0137_745_137745793_qa_4/task.toml +++ b/tasks/0137_745_137745793_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_754_137754074_qa_3/environment/bootstrap.sh b/tasks/0137_754_137754074_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_754_137754074_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_754_137754074_qa_3/environment/pull_bucket.py b/tasks/0137_754_137754074_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_754_137754074_qa_3/environment/pull_bucket.py +++ b/tasks/0137_754_137754074_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_754_137754074_qa_3/task.toml b/tasks/0137_754_137754074_qa_3/task.toml index 163b0dc3c935f9743d39851422448a06ee7f6b2d..d191aac9e299f890c2aa422a682e3c4ea0569cd4 100644 --- a/tasks/0137_754_137754074_qa_3/task.toml +++ b/tasks/0137_754_137754074_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_769_137769141_qa_3/environment/bootstrap.sh b/tasks/0137_769_137769141_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_769_137769141_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_769_137769141_qa_3/environment/pull_bucket.py b/tasks/0137_769_137769141_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_769_137769141_qa_3/environment/pull_bucket.py +++ b/tasks/0137_769_137769141_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_769_137769141_qa_3/task.toml b/tasks/0137_769_137769141_qa_3/task.toml index 0199398c9c88b7be48be6c1dbab967d2fcdbcc10..1a2dabf7a4638a7c3113a24749fbce8ebf287dc2 100644 --- a/tasks/0137_769_137769141_qa_3/task.toml +++ b/tasks/0137_769_137769141_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_769_137769141_qa_4/environment/bootstrap.sh b/tasks/0137_769_137769141_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_769_137769141_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_769_137769141_qa_4/environment/pull_bucket.py b/tasks/0137_769_137769141_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_769_137769141_qa_4/environment/pull_bucket.py +++ b/tasks/0137_769_137769141_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_769_137769141_qa_4/task.toml b/tasks/0137_769_137769141_qa_4/task.toml index 32f97f791d5b91abdabcb2c8ac1b159c284af117..357198c60faae84e462a4d3ccff3cf1caf9030c1 100644 --- a/tasks/0137_769_137769141_qa_4/task.toml +++ b/tasks/0137_769_137769141_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_769_137769141_qa_5/environment/bootstrap.sh b/tasks/0137_769_137769141_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_769_137769141_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_769_137769141_qa_5/environment/pull_bucket.py b/tasks/0137_769_137769141_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_769_137769141_qa_5/environment/pull_bucket.py +++ b/tasks/0137_769_137769141_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_769_137769141_qa_5/task.toml b/tasks/0137_769_137769141_qa_5/task.toml index 9f7c943d2af120067836dc03270b0c5d950dd528..6a788ce0ad97cef5a92cc82fd52a17d22787cc71 100644 --- a/tasks/0137_769_137769141_qa_5/task.toml +++ b/tasks/0137_769_137769141_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_818_137818878_qa_4/environment/bootstrap.sh b/tasks/0137_818_137818878_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_818_137818878_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_818_137818878_qa_4/environment/pull_bucket.py b/tasks/0137_818_137818878_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_818_137818878_qa_4/environment/pull_bucket.py +++ b/tasks/0137_818_137818878_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_818_137818878_qa_4/task.toml b/tasks/0137_818_137818878_qa_4/task.toml index 6b85b651308d189738fa23c63543301e16528baa..77276f6ea7e927fc37bb2d5565490f8fe593f2b8 100644 --- a/tasks/0137_818_137818878_qa_4/task.toml +++ b/tasks/0137_818_137818878_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0137_970_137970410_qa_4/environment/bootstrap.sh b/tasks/0137_970_137970410_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0137_970_137970410_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0137_970_137970410_qa_4/environment/pull_bucket.py b/tasks/0137_970_137970410_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0137_970_137970410_qa_4/environment/pull_bucket.py +++ b/tasks/0137_970_137970410_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0137_970_137970410_qa_4/task.toml b/tasks/0137_970_137970410_qa_4/task.toml index d77d88a78ad50875d217d5d27097390f778c9000..80642c2a7d40b99e232b0f7c780604831caa4e08 100644 --- a/tasks/0137_970_137970410_qa_4/task.toml +++ b/tasks/0137_970_137970410_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_103_138103420_qa_2/environment/bootstrap.sh b/tasks/0138_103_138103420_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_103_138103420_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_103_138103420_qa_2/environment/pull_bucket.py b/tasks/0138_103_138103420_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_103_138103420_qa_2/environment/pull_bucket.py +++ b/tasks/0138_103_138103420_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_103_138103420_qa_2/task.toml b/tasks/0138_103_138103420_qa_2/task.toml index ef7509b9dc6aff4a70af13de60201e87e90162d6..32266bdc73f9fa56ca2ee8c465ddd283ab76d9a6 100644 --- a/tasks/0138_103_138103420_qa_2/task.toml +++ b/tasks/0138_103_138103420_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_103_138103420_qa_4/environment/bootstrap.sh b/tasks/0138_103_138103420_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_103_138103420_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_103_138103420_qa_4/environment/pull_bucket.py b/tasks/0138_103_138103420_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_103_138103420_qa_4/environment/pull_bucket.py +++ b/tasks/0138_103_138103420_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_103_138103420_qa_4/task.toml b/tasks/0138_103_138103420_qa_4/task.toml index 98dbeaedd01d5c6a4618edf9f953be05a26809cd..c0df39d9b39318601badc57ea9f9288d334e33ee 100644 --- a/tasks/0138_103_138103420_qa_4/task.toml +++ b/tasks/0138_103_138103420_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_107_138107886_qa_1/environment/bootstrap.sh b/tasks/0138_107_138107886_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_107_138107886_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_107_138107886_qa_1/environment/pull_bucket.py b/tasks/0138_107_138107886_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_107_138107886_qa_1/environment/pull_bucket.py +++ b/tasks/0138_107_138107886_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_107_138107886_qa_1/task.toml b/tasks/0138_107_138107886_qa_1/task.toml index 01ef84ef87a2fe37e187e2d067d2bf64d895097e..d8d34b4302e43d3e536098385d832ce6ff586de7 100644 --- a/tasks/0138_107_138107886_qa_1/task.toml +++ b/tasks/0138_107_138107886_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_107_138107886_qa_3/environment/bootstrap.sh b/tasks/0138_107_138107886_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_107_138107886_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_107_138107886_qa_3/environment/pull_bucket.py b/tasks/0138_107_138107886_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_107_138107886_qa_3/environment/pull_bucket.py +++ b/tasks/0138_107_138107886_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_107_138107886_qa_3/task.toml b/tasks/0138_107_138107886_qa_3/task.toml index e4b15a3a4feed6eef6432c72d847a519efba79a3..82a4b5c9b5645b30778678015ae31978eeccb6c9 100644 --- a/tasks/0138_107_138107886_qa_3/task.toml +++ b/tasks/0138_107_138107886_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_141_138141265_qa_5/environment/bootstrap.sh b/tasks/0138_141_138141265_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_141_138141265_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_141_138141265_qa_5/environment/pull_bucket.py b/tasks/0138_141_138141265_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_141_138141265_qa_5/environment/pull_bucket.py +++ b/tasks/0138_141_138141265_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_141_138141265_qa_5/task.toml b/tasks/0138_141_138141265_qa_5/task.toml index df89dc119839e67b126d59babc96b50d0c20daf2..0ffa54ac3a3673f16f54291a9dda2ed5eead897d 100644 --- a/tasks/0138_141_138141265_qa_5/task.toml +++ b/tasks/0138_141_138141265_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_147_138147004_qa_2/environment/bootstrap.sh b/tasks/0138_147_138147004_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_147_138147004_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_147_138147004_qa_2/environment/pull_bucket.py b/tasks/0138_147_138147004_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_147_138147004_qa_2/environment/pull_bucket.py +++ b/tasks/0138_147_138147004_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_147_138147004_qa_2/task.toml b/tasks/0138_147_138147004_qa_2/task.toml index a89176a21faafb03acd556a867f5a22fde02df25..247d009a1c93f047f9580ee2cac36b3fe5e658bd 100644 --- a/tasks/0138_147_138147004_qa_2/task.toml +++ b/tasks/0138_147_138147004_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_147_138147004_qa_4/environment/bootstrap.sh b/tasks/0138_147_138147004_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_147_138147004_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_147_138147004_qa_4/environment/pull_bucket.py b/tasks/0138_147_138147004_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_147_138147004_qa_4/environment/pull_bucket.py +++ b/tasks/0138_147_138147004_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_147_138147004_qa_4/task.toml b/tasks/0138_147_138147004_qa_4/task.toml index 145fb67c05af247becd3a330341c0db0541131da..4a3411dd82bcb77c43d9f776d2e191b824c44b23 100644 --- a/tasks/0138_147_138147004_qa_4/task.toml +++ b/tasks/0138_147_138147004_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_302_138302934_qa_3/environment/bootstrap.sh b/tasks/0138_302_138302934_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_302_138302934_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_302_138302934_qa_3/environment/pull_bucket.py b/tasks/0138_302_138302934_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_302_138302934_qa_3/environment/pull_bucket.py +++ b/tasks/0138_302_138302934_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_302_138302934_qa_3/task.toml b/tasks/0138_302_138302934_qa_3/task.toml index d10a27486b1550c4ddb3a4b98d712e4f8a089a2b..f4cdeb3812ef8b140cbd1dd660996924ec21298d 100644 --- a/tasks/0138_302_138302934_qa_3/task.toml +++ b/tasks/0138_302_138302934_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_344_138344760_qa_5/environment/bootstrap.sh b/tasks/0138_344_138344760_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_344_138344760_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_344_138344760_qa_5/environment/pull_bucket.py b/tasks/0138_344_138344760_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_344_138344760_qa_5/environment/pull_bucket.py +++ b/tasks/0138_344_138344760_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_344_138344760_qa_5/task.toml b/tasks/0138_344_138344760_qa_5/task.toml index 8909ae92e854db9afc2661284bebfc9f88c84fd3..bb8c14ef6a2f1615604863db3170bb8b17ca7198 100644 --- a/tasks/0138_344_138344760_qa_5/task.toml +++ b/tasks/0138_344_138344760_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_435_138435541_qa_5/environment/bootstrap.sh b/tasks/0138_435_138435541_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_435_138435541_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_435_138435541_qa_5/environment/pull_bucket.py b/tasks/0138_435_138435541_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_435_138435541_qa_5/environment/pull_bucket.py +++ b/tasks/0138_435_138435541_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_435_138435541_qa_5/task.toml b/tasks/0138_435_138435541_qa_5/task.toml index d46f3f468fb132a0764de5bcdd23f4c715775748..7888f4ef574d1c55064f0f39fe888a048f0a7c43 100644 --- a/tasks/0138_435_138435541_qa_5/task.toml +++ b/tasks/0138_435_138435541_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_488_138488828_qa_2/environment/bootstrap.sh b/tasks/0138_488_138488828_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_488_138488828_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_488_138488828_qa_2/environment/pull_bucket.py b/tasks/0138_488_138488828_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_488_138488828_qa_2/environment/pull_bucket.py +++ b/tasks/0138_488_138488828_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_488_138488828_qa_2/task.toml b/tasks/0138_488_138488828_qa_2/task.toml index 389b19313ad0227b71ec1f683b2de28df7c2fd72..1e2fa92eef26469b4e8e80ed125897ad3ea916ce 100644 --- a/tasks/0138_488_138488828_qa_2/task.toml +++ b/tasks/0138_488_138488828_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_488_138488828_qa_4/environment/bootstrap.sh b/tasks/0138_488_138488828_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_488_138488828_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_488_138488828_qa_4/environment/pull_bucket.py b/tasks/0138_488_138488828_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_488_138488828_qa_4/environment/pull_bucket.py +++ b/tasks/0138_488_138488828_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_488_138488828_qa_4/task.toml b/tasks/0138_488_138488828_qa_4/task.toml index 4515cee2e9f241eb4219714d9464b47dd327f972..e0511b796d3cee1e1f3d837c1a528fa8620fb88b 100644 --- a/tasks/0138_488_138488828_qa_4/task.toml +++ b/tasks/0138_488_138488828_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_488_138488828_qa_5/environment/bootstrap.sh b/tasks/0138_488_138488828_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_488_138488828_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_488_138488828_qa_5/environment/pull_bucket.py b/tasks/0138_488_138488828_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_488_138488828_qa_5/environment/pull_bucket.py +++ b/tasks/0138_488_138488828_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_488_138488828_qa_5/task.toml b/tasks/0138_488_138488828_qa_5/task.toml index 8b0d5344b163000bb3a9bc3f80bde9291a70b4a9..181bd6302195db6ba96e29a6054d32ce2d518deb 100644 --- a/tasks/0138_488_138488828_qa_5/task.toml +++ b/tasks/0138_488_138488828_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_490_138490152_qa_3/environment/bootstrap.sh b/tasks/0138_490_138490152_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_490_138490152_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_490_138490152_qa_3/environment/pull_bucket.py b/tasks/0138_490_138490152_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_490_138490152_qa_3/environment/pull_bucket.py +++ b/tasks/0138_490_138490152_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_490_138490152_qa_3/task.toml b/tasks/0138_490_138490152_qa_3/task.toml index a53279ee636dd681c6bc374d4ef3c28e0d9c8198..4a42ab46ef1593d0a5a9ccaf241e82e2318206d6 100644 --- a/tasks/0138_490_138490152_qa_3/task.toml +++ b/tasks/0138_490_138490152_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_500_138500399_qa_5/environment/bootstrap.sh b/tasks/0138_500_138500399_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_500_138500399_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_500_138500399_qa_5/environment/pull_bucket.py b/tasks/0138_500_138500399_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_500_138500399_qa_5/environment/pull_bucket.py +++ b/tasks/0138_500_138500399_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_500_138500399_qa_5/task.toml b/tasks/0138_500_138500399_qa_5/task.toml index d9276fbfbf74797d14da016d990365546b5bda8b..f92797984c6e6b8070ddf12959006dcadeb8222e 100644 --- a/tasks/0138_500_138500399_qa_5/task.toml +++ b/tasks/0138_500_138500399_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_500_138500445_qa_4/environment/bootstrap.sh b/tasks/0138_500_138500445_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_500_138500445_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_500_138500445_qa_4/environment/pull_bucket.py b/tasks/0138_500_138500445_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_500_138500445_qa_4/environment/pull_bucket.py +++ b/tasks/0138_500_138500445_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_500_138500445_qa_4/task.toml b/tasks/0138_500_138500445_qa_4/task.toml index 5b661751f089697bfd68c7ae476646b98f5f18fa..a4bb0704d16756dbe912475a2b45dc1d49173d67 100644 --- a/tasks/0138_500_138500445_qa_4/task.toml +++ b/tasks/0138_500_138500445_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_573_138573264_qa_3/environment/bootstrap.sh b/tasks/0138_573_138573264_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_573_138573264_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_573_138573264_qa_3/environment/pull_bucket.py b/tasks/0138_573_138573264_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_573_138573264_qa_3/environment/pull_bucket.py +++ b/tasks/0138_573_138573264_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_573_138573264_qa_3/task.toml b/tasks/0138_573_138573264_qa_3/task.toml index cf40e4d3f49bcd5bfe58a624820ef54bd20bd5a7..c7763c293ecde1f34b3b7a934313f20f4580cd61 100644 --- a/tasks/0138_573_138573264_qa_3/task.toml +++ b/tasks/0138_573_138573264_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_684_138684554_qa_1/environment/bootstrap.sh b/tasks/0138_684_138684554_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_684_138684554_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_684_138684554_qa_1/environment/pull_bucket.py b/tasks/0138_684_138684554_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_684_138684554_qa_1/environment/pull_bucket.py +++ b/tasks/0138_684_138684554_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_684_138684554_qa_1/task.toml b/tasks/0138_684_138684554_qa_1/task.toml index c87addb338ed7987f99d78a6a17c3f3815670160..7d1f1252f3396875086fe88741419a253189ac97 100644 --- a/tasks/0138_684_138684554_qa_1/task.toml +++ b/tasks/0138_684_138684554_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_684_138684554_qa_2/environment/bootstrap.sh b/tasks/0138_684_138684554_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_684_138684554_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_684_138684554_qa_2/environment/pull_bucket.py b/tasks/0138_684_138684554_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_684_138684554_qa_2/environment/pull_bucket.py +++ b/tasks/0138_684_138684554_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_684_138684554_qa_2/task.toml b/tasks/0138_684_138684554_qa_2/task.toml index 044ac5eb542524f339d90c031383c3a75c400319..e1aeb6b4a872da652356c00ee944e51c0d1e5fa1 100644 --- a/tasks/0138_684_138684554_qa_2/task.toml +++ b/tasks/0138_684_138684554_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_697_138697027_qa_1/environment/bootstrap.sh b/tasks/0138_697_138697027_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_697_138697027_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_697_138697027_qa_1/environment/pull_bucket.py b/tasks/0138_697_138697027_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_697_138697027_qa_1/environment/pull_bucket.py +++ b/tasks/0138_697_138697027_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_697_138697027_qa_1/task.toml b/tasks/0138_697_138697027_qa_1/task.toml index 1752c91cee5e9e82e2a0ed3d675c88434c2724b7..6e6757a59eb8f2d1d6096e212f7db13e79a3ced7 100644 --- a/tasks/0138_697_138697027_qa_1/task.toml +++ b/tasks/0138_697_138697027_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_755_138755530_qa_1/environment/bootstrap.sh b/tasks/0138_755_138755530_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_755_138755530_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_755_138755530_qa_1/environment/pull_bucket.py b/tasks/0138_755_138755530_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_755_138755530_qa_1/environment/pull_bucket.py +++ b/tasks/0138_755_138755530_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_755_138755530_qa_1/task.toml b/tasks/0138_755_138755530_qa_1/task.toml index 251a92d1362b725a7e7360ca91d6fa55d8135888..3894ae54b7b71884e5eb503e6d08469af34d30c5 100644 --- a/tasks/0138_755_138755530_qa_1/task.toml +++ b/tasks/0138_755_138755530_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_755_138755530_qa_2/environment/bootstrap.sh b/tasks/0138_755_138755530_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_755_138755530_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_755_138755530_qa_2/environment/pull_bucket.py b/tasks/0138_755_138755530_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_755_138755530_qa_2/environment/pull_bucket.py +++ b/tasks/0138_755_138755530_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_755_138755530_qa_2/task.toml b/tasks/0138_755_138755530_qa_2/task.toml index c71abff9e10f766cfc703d0c81bf5a18b9c25d1c..c0bc323dc10f3c9d6c5c8ee7feb75f64965b55a9 100644 --- a/tasks/0138_755_138755530_qa_2/task.toml +++ b/tasks/0138_755_138755530_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_777_138777709_qa_1/environment/bootstrap.sh b/tasks/0138_777_138777709_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_777_138777709_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_777_138777709_qa_1/environment/pull_bucket.py b/tasks/0138_777_138777709_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_777_138777709_qa_1/environment/pull_bucket.py +++ b/tasks/0138_777_138777709_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_777_138777709_qa_1/task.toml b/tasks/0138_777_138777709_qa_1/task.toml index 068d4869d6675fa8d586d99de72603c6c5bc2a60..c84034ba96981ed3c83234c7dae799ee25f97e0a 100644 --- a/tasks/0138_777_138777709_qa_1/task.toml +++ b/tasks/0138_777_138777709_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_787_138787148_qa_2/environment/bootstrap.sh b/tasks/0138_787_138787148_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_787_138787148_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_787_138787148_qa_2/environment/pull_bucket.py b/tasks/0138_787_138787148_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_787_138787148_qa_2/environment/pull_bucket.py +++ b/tasks/0138_787_138787148_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_787_138787148_qa_2/task.toml b/tasks/0138_787_138787148_qa_2/task.toml index 239322dae09195534679a9e43084498595e1e484..13cef69cfe3fb1f6c314d2eea995f86de69a53a3 100644 --- a/tasks/0138_787_138787148_qa_2/task.toml +++ b/tasks/0138_787_138787148_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_791_138791955_qa_4/environment/bootstrap.sh b/tasks/0138_791_138791955_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_791_138791955_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_791_138791955_qa_4/environment/pull_bucket.py b/tasks/0138_791_138791955_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_791_138791955_qa_4/environment/pull_bucket.py +++ b/tasks/0138_791_138791955_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_791_138791955_qa_4/task.toml b/tasks/0138_791_138791955_qa_4/task.toml index b7719c23e112f4e0e7510550f0a986864b5a8b17..54beace62ec381ec3318fe96ade01f1b45850a4c 100644 --- a/tasks/0138_791_138791955_qa_4/task.toml +++ b/tasks/0138_791_138791955_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_791_138791955_qa_5/environment/bootstrap.sh b/tasks/0138_791_138791955_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_791_138791955_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_791_138791955_qa_5/environment/pull_bucket.py b/tasks/0138_791_138791955_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_791_138791955_qa_5/environment/pull_bucket.py +++ b/tasks/0138_791_138791955_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_791_138791955_qa_5/task.toml b/tasks/0138_791_138791955_qa_5/task.toml index 860080b79ac0eef6af5fe0b6452ba33b0edb09c5..4d1c7e2f3495c19e433e3e68e38f4fe042db9b9c 100644 --- a/tasks/0138_791_138791955_qa_5/task.toml +++ b/tasks/0138_791_138791955_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_805_138805260_qa_1/environment/bootstrap.sh b/tasks/0138_805_138805260_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_805_138805260_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_805_138805260_qa_1/environment/pull_bucket.py b/tasks/0138_805_138805260_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_805_138805260_qa_1/environment/pull_bucket.py +++ b/tasks/0138_805_138805260_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_805_138805260_qa_1/task.toml b/tasks/0138_805_138805260_qa_1/task.toml index 4ad58576e9e21cd6c8bc065e92962b0e166139b5..20ffc82b98a8f71fcd3b5cd0960f5b717ed10bd8 100644 --- a/tasks/0138_805_138805260_qa_1/task.toml +++ b/tasks/0138_805_138805260_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_805_138805260_qa_2/environment/bootstrap.sh b/tasks/0138_805_138805260_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_805_138805260_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_805_138805260_qa_2/environment/pull_bucket.py b/tasks/0138_805_138805260_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_805_138805260_qa_2/environment/pull_bucket.py +++ b/tasks/0138_805_138805260_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_805_138805260_qa_2/task.toml b/tasks/0138_805_138805260_qa_2/task.toml index 2a796875bcdb7320b99a378cdb0d351f2d08bef5..748ae050b229bb1074fff0d468e88855f708d94d 100644 --- a/tasks/0138_805_138805260_qa_2/task.toml +++ b/tasks/0138_805_138805260_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_930_138930992_qa_1/environment/bootstrap.sh b/tasks/0138_930_138930992_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_930_138930992_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_930_138930992_qa_1/environment/pull_bucket.py b/tasks/0138_930_138930992_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_930_138930992_qa_1/environment/pull_bucket.py +++ b/tasks/0138_930_138930992_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_930_138930992_qa_1/task.toml b/tasks/0138_930_138930992_qa_1/task.toml index aac8b8d7211e726277b7b58ca1b0ef357e8df442..288db8f49977b914c9cff022da91683a24a5abfd 100644 --- a/tasks/0138_930_138930992_qa_1/task.toml +++ b/tasks/0138_930_138930992_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0138_984_138984324_qa_4/environment/bootstrap.sh b/tasks/0138_984_138984324_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0138_984_138984324_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0138_984_138984324_qa_4/environment/pull_bucket.py b/tasks/0138_984_138984324_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0138_984_138984324_qa_4/environment/pull_bucket.py +++ b/tasks/0138_984_138984324_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0138_984_138984324_qa_4/task.toml b/tasks/0138_984_138984324_qa_4/task.toml index 10d703d9a784bb6767e13395c8a36816ddf5f86c..b9d3c150ddcb8ff9aadedfee2fcd7a3706ea9779 100644 --- a/tasks/0138_984_138984324_qa_4/task.toml +++ b/tasks/0138_984_138984324_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_066_139066922_qa_2/environment/bootstrap.sh b/tasks/0139_066_139066922_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_066_139066922_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_066_139066922_qa_2/environment/pull_bucket.py b/tasks/0139_066_139066922_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_066_139066922_qa_2/environment/pull_bucket.py +++ b/tasks/0139_066_139066922_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_066_139066922_qa_2/task.toml b/tasks/0139_066_139066922_qa_2/task.toml index fcc9a7c0b6bb56a0a9a62062dab3958e7b6373c3..2ab58f4f9b4c8462cc422a758ba8fbae4c931c9f 100644 --- a/tasks/0139_066_139066922_qa_2/task.toml +++ b/tasks/0139_066_139066922_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_066_139066922_qa_3/environment/bootstrap.sh b/tasks/0139_066_139066922_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_066_139066922_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_066_139066922_qa_3/environment/pull_bucket.py b/tasks/0139_066_139066922_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_066_139066922_qa_3/environment/pull_bucket.py +++ b/tasks/0139_066_139066922_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_066_139066922_qa_3/task.toml b/tasks/0139_066_139066922_qa_3/task.toml index 7c8b069749ccae394f2bfa8fc4413c8c8de5ed9c..7e82b058383e7726bd4c17c3c2dd4f13299d397b 100644 --- a/tasks/0139_066_139066922_qa_3/task.toml +++ b/tasks/0139_066_139066922_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_071_139071391_qa_3/environment/bootstrap.sh b/tasks/0139_071_139071391_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_071_139071391_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_071_139071391_qa_3/environment/pull_bucket.py b/tasks/0139_071_139071391_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_071_139071391_qa_3/environment/pull_bucket.py +++ b/tasks/0139_071_139071391_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_071_139071391_qa_3/task.toml b/tasks/0139_071_139071391_qa_3/task.toml index 31c7c06f504cf49c29124027ef987bf460ce7b15..e9fd27e370cdee96b1d18c5f41f3a668f119a84b 100644 --- a/tasks/0139_071_139071391_qa_3/task.toml +++ b/tasks/0139_071_139071391_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_071_139071391_qa_4/environment/bootstrap.sh b/tasks/0139_071_139071391_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_071_139071391_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_071_139071391_qa_4/environment/pull_bucket.py b/tasks/0139_071_139071391_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_071_139071391_qa_4/environment/pull_bucket.py +++ b/tasks/0139_071_139071391_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_071_139071391_qa_4/task.toml b/tasks/0139_071_139071391_qa_4/task.toml index d0bde5795e15e6d8a1139139c2bfe7c3a4f6744b..5d49696e73bd06a216678ab16735193a02488546 100644 --- a/tasks/0139_071_139071391_qa_4/task.toml +++ b/tasks/0139_071_139071391_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_103_139103748_qa_4/environment/bootstrap.sh b/tasks/0139_103_139103748_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_103_139103748_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_103_139103748_qa_4/environment/pull_bucket.py b/tasks/0139_103_139103748_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_103_139103748_qa_4/environment/pull_bucket.py +++ b/tasks/0139_103_139103748_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_103_139103748_qa_4/task.toml b/tasks/0139_103_139103748_qa_4/task.toml index c41ea9ad3ca6733e7fea7a17ba90c00c330eb27f..5ac8ec9d5670c756059505b8cbd83dd707e88f57 100644 --- a/tasks/0139_103_139103748_qa_4/task.toml +++ b/tasks/0139_103_139103748_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_112_139112787_qa_2/environment/bootstrap.sh b/tasks/0139_112_139112787_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_112_139112787_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_112_139112787_qa_2/environment/pull_bucket.py b/tasks/0139_112_139112787_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_112_139112787_qa_2/environment/pull_bucket.py +++ b/tasks/0139_112_139112787_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_112_139112787_qa_2/task.toml b/tasks/0139_112_139112787_qa_2/task.toml index 5e5ef187cc70330ba444155f96b41cd499cd79c7..d6b74a8225f55a4d2bb3f92505027841cfe45774 100644 --- a/tasks/0139_112_139112787_qa_2/task.toml +++ b/tasks/0139_112_139112787_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_117_139117477_qa_2/environment/bootstrap.sh b/tasks/0139_117_139117477_qa_2/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_117_139117477_qa_2/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_117_139117477_qa_2/environment/pull_bucket.py b/tasks/0139_117_139117477_qa_2/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_117_139117477_qa_2/environment/pull_bucket.py +++ b/tasks/0139_117_139117477_qa_2/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_117_139117477_qa_2/task.toml b/tasks/0139_117_139117477_qa_2/task.toml index d57915bdd79d47a1bb8fac86d4c0a068d2b3acfc..395f3eabe52bfdba2b03629e51f1a1dce0b405bd 100644 --- a/tasks/0139_117_139117477_qa_2/task.toml +++ b/tasks/0139_117_139117477_qa_2/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_117_139117477_qa_5/environment/bootstrap.sh b/tasks/0139_117_139117477_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_117_139117477_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_117_139117477_qa_5/environment/pull_bucket.py b/tasks/0139_117_139117477_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_117_139117477_qa_5/environment/pull_bucket.py +++ b/tasks/0139_117_139117477_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_117_139117477_qa_5/task.toml b/tasks/0139_117_139117477_qa_5/task.toml index 62e1ef76fed2eef38db8d7739dbca76cc2fbb0d7..f70566ad8d16319ced34e470ab683bf9396cb84d 100644 --- a/tasks/0139_117_139117477_qa_5/task.toml +++ b/tasks/0139_117_139117477_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_173_139173112_qa_5/environment/bootstrap.sh b/tasks/0139_173_139173112_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_173_139173112_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_173_139173112_qa_5/environment/pull_bucket.py b/tasks/0139_173_139173112_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_173_139173112_qa_5/environment/pull_bucket.py +++ b/tasks/0139_173_139173112_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_173_139173112_qa_5/task.toml b/tasks/0139_173_139173112_qa_5/task.toml index cb8c56528e70495cd66715cb54161841e1320aa2..7ba50be438c12e4ec915f68451ebfaa88f585c77 100644 --- a/tasks/0139_173_139173112_qa_5/task.toml +++ b/tasks/0139_173_139173112_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_181_139181470_qa_3/environment/bootstrap.sh b/tasks/0139_181_139181470_qa_3/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_181_139181470_qa_3/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_181_139181470_qa_3/environment/pull_bucket.py b/tasks/0139_181_139181470_qa_3/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_181_139181470_qa_3/environment/pull_bucket.py +++ b/tasks/0139_181_139181470_qa_3/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_181_139181470_qa_3/task.toml b/tasks/0139_181_139181470_qa_3/task.toml index c79083287de16282c62762676c6eeea455d731ae..2e611b758b01b4897b73bff3b70704ca4866e561 100644 --- a/tasks/0139_181_139181470_qa_3/task.toml +++ b/tasks/0139_181_139181470_qa_3/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_186_139186690_qa_1/environment/bootstrap.sh b/tasks/0139_186_139186690_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_186_139186690_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_186_139186690_qa_1/environment/pull_bucket.py b/tasks/0139_186_139186690_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_186_139186690_qa_1/environment/pull_bucket.py +++ b/tasks/0139_186_139186690_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_186_139186690_qa_1/task.toml b/tasks/0139_186_139186690_qa_1/task.toml index 17d57f3b594ec8b7800abd556dfbad57bdda46d6..b2eee7be39d5e70acd14bcb604afa41c61d08ced 100644 --- a/tasks/0139_186_139186690_qa_1/task.toml +++ b/tasks/0139_186_139186690_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_186_139186690_qa_5/environment/bootstrap.sh b/tasks/0139_186_139186690_qa_5/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_186_139186690_qa_5/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_186_139186690_qa_5/environment/pull_bucket.py b/tasks/0139_186_139186690_qa_5/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_186_139186690_qa_5/environment/pull_bucket.py +++ b/tasks/0139_186_139186690_qa_5/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_186_139186690_qa_5/task.toml b/tasks/0139_186_139186690_qa_5/task.toml index 736a462889b9788effc62dd362a46201faca1ce8..8bd9c6e27394a30486f1d30f885d8be12476a499 100644 --- a/tasks/0139_186_139186690_qa_5/task.toml +++ b/tasks/0139_186_139186690_qa_5/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_196_139196764_qa_4/environment/bootstrap.sh b/tasks/0139_196_139196764_qa_4/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_196_139196764_qa_4/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_196_139196764_qa_4/environment/pull_bucket.py b/tasks/0139_196_139196764_qa_4/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_196_139196764_qa_4/environment/pull_bucket.py +++ b/tasks/0139_196_139196764_qa_4/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_196_139196764_qa_4/task.toml b/tasks/0139_196_139196764_qa_4/task.toml index 13c9a76cec6aebfaa3d26280276d8d664202ef96..d6101368589fa33c6a1c1689725062368d6106cb 100644 --- a/tasks/0139_196_139196764_qa_4/task.toml +++ b/tasks/0139_196_139196764_qa_4/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tasks/0139_223_139223525_qa_1/environment/bootstrap.sh b/tasks/0139_223_139223525_qa_1/environment/bootstrap.sh deleted file mode 100644 index 41bed5f5edeebc9bc842b5337fc7372502de36aa..0000000000000000000000000000000000000000 --- a/tasks/0139_223_139223525_qa_1/environment/bootstrap.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -# Harbor uploads this directory before the pre-agent healthcheck runs. -if [ ! -f .bootstrap-complete ]; then - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y --no-install-recommends ca-certificates curl git - rm -rf /var/lib/apt/lists/* - python3 -m pip install --no-cache-dir --requirement requirements.txt - mkdir -p /home/user/input /workdir - touch .bootstrap-complete -fi - -# Always finish the whole pull, including after an interrupted earlier attempt. -python3 pull_bucket.py diff --git a/tasks/0139_223_139223525_qa_1/environment/pull_bucket.py b/tasks/0139_223_139223525_qa_1/environment/pull_bucket.py index 3c3f3564be870e1f47d0068aeef172f2cf015bfd..7b495b4b27f7341997aea0b3198b5c31efa785da 100644 --- a/tasks/0139_223_139223525_qa_1/environment/pull_bucket.py +++ b/tasks/0139_223_139223525_qa_1/environment/pull_bucket.py @@ -1,8 +1,8 @@ """Pull this task's bucket prefix into /home/user/input/. -Invoked by bootstrap.sh through Harbor's pre-agent healthcheck. -Always finish the complete pull: existing files may be left by an -interrupted attempt and do not prove the task data are ready. +Invoked by Harbor's [environment.healthcheck] command (declared in task.toml) +— runs after container start, before the agent. Idempotent: skips work if +files are already present from a prior pull. """ import os @@ -18,6 +18,11 @@ def main() -> int: dest = Path("/home/user/input") dest.mkdir(parents=True, exist_ok=True) + existing = [p for p in dest.iterdir() if p.is_file()] + if existing: + print(f"[pull_bucket] {dest}/ already has {len(existing)} file(s); skipping", flush=True) + return 0 + targets = [ (it.path, str(dest / Path(it.path).name)) for it in list_bucket_tree(bucket, prefix=prefix, recursive=True) diff --git a/tasks/0139_223_139223525_qa_1/task.toml b/tasks/0139_223_139223525_qa_1/task.toml index e1bdc479182b340e66d01dfcfdbe54f6149c5788..637b924fb370ce925a9bee0578c1c34513757bd2 100644 --- a/tasks/0139_223_139223525_qa_1/task.toml +++ b/tasks/0139_223_139223525_qa_1/task.toml @@ -30,11 +30,15 @@ gpus = 0 allow_internet = true mcp_servers = [] -# Harbor uploads environment/ into /workdir, then runs this pre-agent hook. -# Install the pinned dependencies and pull this task's bucket prefix before -# agent setup. No task-specific container build is needed. +# Install dependencies and pull task data before agent setup. [environment.healthcheck] -command = "bash /workdir/bootstrap.sh" +command = ''' +apt-get update && +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git && +python3 -m pip install --no-cache-dir -r /workdir/requirements.txt && +python3 /workdir/pull_bucket.py && +test -n "$(ls /home/user/input)" +''' interval_sec = 2.0 timeout_sec = 600.0 start_period_sec = 0.0 diff --git a/tests/test_environment.py b/tests/test_environment.py deleted file mode 100644 index 47d5e37a516832fbe5bbd840fb826de04c496670..0000000000000000000000000000000000000000 --- a/tests/test_environment.py +++ /dev/null @@ -1,91 +0,0 @@ -"""Offline checks: python3 -m unittest discover -s tests -v.""" - -import importlib.util -import os -import sys -import tempfile -import tomllib -import types -import unittest -from pathlib import Path -from unittest.mock import Mock, patch - - -ROOT = Path(__file__).resolve().parents[1] -TASKS = sorted((ROOT / "tasks").iterdir()) -ENV = TASKS[0] / "environment" - - -class EnvironmentTests(unittest.TestCase): - def test_suite_bootstrap_contract(self): - self.assertEqual(len(TASKS), 5000) - expected = {name: (ENV / name).read_bytes() for name in ( - "bootstrap.sh", "requirements.txt", "pull_bucket.py" - )} - image = tomllib.loads((TASKS[0] / "task.toml").read_text())["environment"]["docker_image"] - self.assertIn("@sha256:", image) - self.assertTrue(image.startswith("python@sha256:")) - for task in TASKS: - with self.subTest(task=task.name): - config = tomllib.loads((task / "task.toml").read_text())["environment"] - self.assertEqual(config["docker_image"], image) - self.assertEqual(config["workdir"], "/workdir") - self.assertEqual(config["healthcheck"]["command"], "bash /workdir/bootstrap.sh") - self.assertEqual(config["env"]["TAR_OPTIONS"], "--no-same-owner") - self.assertFalse((task / "environment/Dockerfile").exists()) - self.assertFalse((task / "environment/docker-compose.yaml").exists()) - for name, content in expected.items(): - self.assertEqual((task / "environment" / name).read_bytes(), content) - - def load_pull(self): - hub = types.ModuleType("huggingface_hub") - hub.list_bucket_tree = Mock(return_value=[ - types.SimpleNamespace(type="file", path="prefix/a.csv"), - types.SimpleNamespace(type="file", path="prefix/b.csv"), - ]) - hub.download_bucket_files = Mock() - spec = importlib.util.spec_from_file_location("pull_bucket", ENV / "pull_bucket.py") - module = importlib.util.module_from_spec(spec) - with patch.dict(sys.modules, {"huggingface_hub": hub}): - spec.loader.exec_module(module) - return module, hub - - def test_failed_pull_is_completed_on_retry(self): - module, hub = self.load_pull() - with tempfile.TemporaryDirectory() as tmp: - dest = Path(tmp) - attempts = 0 - - def download(bucket, files): - nonlocal attempts - attempts += 1 - Path(files[0][1]).write_text("first file") - if attempts == 1: - raise OSError("interrupted download") - Path(files[1][1]).write_text("second file") - - hub.download_bucket_files.side_effect = download - path = lambda value: dest if value == "/home/user/input" else Path(value) - with patch.object(module, "Path", side_effect=path), patch.dict(os.environ, { - "HF_BUCKET": "test/bucket", "BUCKET_PREFIX": "prefix" - }): - with self.assertRaisesRegex(OSError, "interrupted"): - module.main() - self.assertEqual(module.main(), 0) - self.assertEqual(attempts, 2) - self.assertEqual((dest / "b.csv").read_text(), "second file") - - def test_empty_bucket_prefix_fails(self): - module, hub = self.load_pull() - hub.list_bucket_tree.return_value = [] - with tempfile.TemporaryDirectory() as tmp: - path = lambda value: Path(tmp) if value == "/home/user/input" else Path(value) - with patch.object(module, "Path", side_effect=path), patch.dict(os.environ, { - "HF_BUCKET": "test/bucket", "BUCKET_PREFIX": "prefix" - }): - self.assertEqual(module.main(), 2) - hub.download_bucket_files.assert_not_called() - - -if __name__ == "__main__": - unittest.main()